From faee18961df4aa7b754a10eb0d8ee7416a990532 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Thu, 17 Feb 2011 09:29:29 +0000 Subject: [PATCH] fixed colorizing disparity --- samples/cpp/kinect_maps.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/cpp/kinect_maps.cpp b/samples/cpp/kinect_maps.cpp index f3b936a745..432b29aee9 100644 --- a/samples/cpp/kinect_maps.cpp +++ b/samples/cpp/kinect_maps.cpp @@ -35,6 +35,10 @@ void colorizeDisparity( const Mat& gray, Mat& rgb, double maxDisp=-1.f, float S= } rgb.create( gray.size(), CV_8UC3 ); + rgb = Scalar::all(0); + if( maxDisp < 1 ) + return; + for( int y = 0; y < gray.rows; y++ ) { for( int x = 0; x < gray.cols; x++ )