mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-05 01:27:46 +08:00
ImageView: fixed depth colormap in height with multicameras
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user