2

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.

f10w
  • 1,524
  • 4
  • 24
  • 39
  • I am able to give you just a hint: use the disparity value as Hue in a HSV image, where Saturation and Value are all at maximum. Please answer to your own question if you can come up with working solution, it looks like an interesting feature – Antonio Apr 04 '15 at 21:35
  • http://docs.opencv.org/modules/contrib/doc/facerec/colormaps.html – berak Apr 05 '15 at 09:16

1 Answers1

1

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.

kcc__
  • 1,638
  • 4
  • 30
  • 59