ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I guess I figured it out. Did I make any mistakes?

cv::Mat dImg =  cv_ptr->image;
     double min = 0;
     double max = 1000;
cv::Mat img_scaled_8u;
cv::Mat(cv_ptr->image-min).convertTo(img_scaled_8u, CV_8UC1, 255. / (max - min));
cv::cvtColor(img_scaled_8u, dImg, CV_GRAY2RGB);
//if (cv_ptr->image.rows > 60 && cv_ptr->image.cols > 60)
//cv::circle(dImg, cv::Point(px, py), 10, CV_RGB(255,0,0));
// Update GUI Window
cv::imshow(OPENCV_WINDOW, dImg);
cv::waitKey(3);