My question is how to color disparity maps like this page: http://vision.middlebury.edu/stereo/data/scenes2014/.
Thank you in advance for any suggestions.
My question is how to color disparity maps like this page: http://vision.middlebury.edu/stereo/data/scenes2014/.
Thank you in advance for any suggestions.
Those Disparity map is created using the depth information and u can color the depth map using axis direction.
Also you can create your own method by Building a JetColor Map.
template<typename T, typename U, typename V>
inline cv::Scalar cvJetColourMat(T v, U vmin, V vmax) {
cv::Scalar c = cv::Scalar(1.0, 1.0, 1.0); // white
T dv;
if (v < vmin)
v = vmin;
if (v > vmax)
v = vmax;
dv = vmax - vmin;
if (v < (vmin + 0.25 * dv)) {
c.val[0] = 0;
c.val[1] = 4 * (v - vmin) / dv;
} else if (v < (vmin + 0.5 * dv)) {
c.val[0] = 0;
c.val[2] = 1 + 4 * (vmin + 0.25 * dv - v) / dv;
} else if (v < (vmin + 0.75 * dv)) {
c.val[0] = 4 * (v - vmin - 0.5 * dv) / dv;
c.val[2] = 0;
} else {
c.val[1] = 1 + 4 * (vmin + 0.75 * dv - v) / dv;
c.val[2] = 0;
}
return(c);
}
Note that you can change to other color components incase you need it.