display a 16-bit grayscale images from a thermal camera in OpenCV
I would like to display a 16-bit grayscale images from a thermal camera in OpenCV. I tried different images' encoding but what I get is either totally black or totally white picture. my code looks like this:
void imageCallback(const sensor_msgs::ImageConstPtr& img)
{
cv_bridge::CvImagePtr cv_ptr;
cv_ptr = cv_bridge::toCvCopy(img);
cv::imshow("16-bit Mono", cv_ptr->image);
cv::waitKey(1);
}