ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I got the solution from Opencv tutorial web site, just use one simple function to convert data 32FC1 to 8UC1, and the result looks good as same sam the image of depth/image from the other openni2_camera source
double minVal, maxVal;
minMaxLoc(cv_ptr->image, &minVal, &maxVal); //find minimum and maximum intensities
//Mat draw;
cv_ptr->image.convertTo(blur_img, CV_8U, 255.0/(maxVal - minVal), -minVal * 255.0/(maxVal - minVal));
P/S: minVal, maxVal you can set it constant in mm based on your camera properties