ImageView: fixed depth colormap in height with multicameras

This commit is contained in:
matlabbe
2026-01-12 10:42:46 -08:00
parent 92aff2129f
commit 93ca4ed8d7
+2 -2
View File
@@ -1401,7 +1401,7 @@ void ImageView::setImageDepth(const cv::Mat & imageDepth, const cv::Mat & imageD
cv::Point3f pt; cv::Point3f pt;
int cameraIndex = u/subImageWidth; int cameraIndex = u/subImageWidth;
UASSERT(cameraIndex>=0 && cameraIndex < (int)models.size() && subImageWidth == models[cameraIndex].imageWidth()); UASSERT(cameraIndex>=0 && cameraIndex < (int)models.size() && subImageWidth == models[cameraIndex].imageWidth());
models[cameraIndex].project(u,v,float(val)/1000.0f, pt.x, pt.y, pt.z); models[cameraIndex].project(u-(cameraIndex*subImageWidth),v,float(val)/1000.0f, pt.x, pt.y, pt.z);
pt = util3d::transformPoint(pt, models[cameraIndex].localTransform()); pt = util3d::transformPoint(pt, models[cameraIndex].localTransform());
val = (unsigned short)(pt.z*1000.0f); val = (unsigned short)(pt.z*1000.0f);
} }
@@ -1417,7 +1417,7 @@ void ImageView::setImageDepth(const cv::Mat & imageDepth, const cv::Mat & imageD
cv::Point3f pt; cv::Point3f pt;
int cameraIndex = u/subImageWidth; int cameraIndex = u/subImageWidth;
UASSERT(cameraIndex>=0 && cameraIndex < (int)models.size() && subImageWidth == models[cameraIndex].imageWidth()); UASSERT(cameraIndex>=0 && cameraIndex < (int)models.size() && subImageWidth == models[cameraIndex].imageWidth());
models[cameraIndex].project(u,v,val, pt.x, pt.y, pt.z); models[cameraIndex].project(u-(cameraIndex*subImageWidth),v,val, pt.x, pt.y, pt.z);
pt = util3d::transformPoint(pt, models[cameraIndex].localTransform()); pt = util3d::transformPoint(pt, models[cameraIndex].localTransform());
val = pt.z; val = pt.z;
} }