DbDriver: fixed save/load optimized mesh errors (0.17)

This commit is contained in:
matlabbe
2018-04-05 10:15:06 -04:00
parent db0e833ce9
commit b3b0caa038

View File

@@ -4570,7 +4570,7 @@ void DBDriverSqlite3::saveOptimizedMeshQuery(
if(cloud.empty()) if(cloud.empty())
{ {
// set all fields to null // set all fields to null
for(int i=1; i<=7; ++i) for(int i=1; i<=5; ++i)
{ {
rc = sqlite3_bind_null(ppStmt, i); rc = sqlite3_bind_null(ppStmt, i);
UASSERT_MSG(rc == SQLITE_OK, uFormat("DB error (%s): %s", _version.c_str(), sqlite3_errmsg(_ppDb)).c_str()); UASSERT_MSG(rc == SQLITE_OK, uFormat("DB error (%s): %s", _version.c_str(), sqlite3_errmsg(_ppDb)).c_str());
@@ -4784,16 +4784,6 @@ cv::Mat DBDriverSqlite3::loadOptimizedMeshQuery(
} }
UDEBUG("Cloud=%d points", cloud.cols); UDEBUG("Cloud=%d points", cloud.cols);
//opt_poses
cv::Mat serializedIds;
data = sqlite3_column_blob(ppStmt, index);
dataSize = sqlite3_column_bytes(ppStmt, index++);
if(dataSize>0 && data)
{
serializedIds = uncompressData(cv::Mat(1, dataSize, CV_8UC1, (void *)data));
UDEBUG("serializedIds=%d", serializedIds.cols);
}
//opt_polygons_size //opt_polygons_size
int polygonSize = sqlite3_column_int(ppStmt, index++); int polygonSize = sqlite3_column_int(ppStmt, index++);
UDEBUG("polygonSize=%d", polygonSize); UDEBUG("polygonSize=%d", polygonSize);