size_t mWidth;
size_t mHeight;
- size_t mMinDisp;
- size_t mMaxDisp;
+ int mMinDisp;
+ int mMaxDisp;
double mSamplingRatio;
int mOutlierRemovalPoints;
double mOutlierRemovalRadius;
std::string pointcloudOutputPath)
{
mMode = mode;
- mWidth = width;
- mHeight = height;
+ mWidth = static_cast<size_t>(width);
+ mHeight = static_cast<size_t>(height);
mMinDisp = minDisp;
mMaxDisp = maxDisp;
mSamplingRatio = samplingRatio;
return ret;
}
+ if (depthWidth <= 0 || depthHeight <= 0) {
+ LOGE("Invalid depth resolution %d x %d", depthWidth, depthHeight);
+ return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+ }
+
ret = mv_engine_config_get_int_attribute(
engine_config, MV_3D_DEPTH_MIN_DISPARITY, &minDisp);
if (ret != MEDIA_VISION_ERROR_NONE) {
if (sscanf(line, "width= %d", &iVal) == 1) width = iVal;
if (sscanf(line, "height= %d", &iVal) == 1) height = iVal;
}
+ fclose(fp);
+ } else {
+ printf("Fail to open %s\n", calibFilename);
+ goto _err;
}
- fclose(fp);
int minDisp = static_cast<int>(dmin);
int maxDisp = static_cast<int>(dmax);
if (path_to_dataset)
free(path_to_dataset);
+ if (suffix_for_algo)
+ free(suffix_for_algo);
+
if (engine_config)
mv_destroy_engine_config(engine_config);
camera::PinholeCameraIntrinsic intrinsic;
io::ReadIJsonConvertible(INTRINSIC_FILE_PATH, intrinsic);
- vertex3d = (float *)malloc(width * height * 4);
+ vertex3d = new float[width * height * 4];
memset(vertex3d, 0, width * height * 4);
utility::LogInfo("focal_x = {}", intrinsic.GetFocalLength().first);
utility::LogInfo("focal_y = {}", intrinsic.GetFocalLength().second);