Right format to use to display an image cv::Mat CV_32F normalized
Unsolved
General and Desktop
-
I have an image cv::Mat CV_32F normalized like this:
depthImage.convertTo(depthImageNormalized, CV_32F, 1.0 / 65535, 0);
normalize(depthImageNormalized, depthImageNormalized, 0, 1, cv::NORM_MINMAX);And I want to display it on a label
ui->label_phone_depth->setPixmap(QPixmap::fromImage(QImage(depth.data, depth.cols, depth.rows, depth.step, QImage::Format_Grayscale16)));
On the left image you can see the original image, and on the left what is outputted
-
Hi and welcome to devnet,
You can't jump from a 32bit float image to 16bit integer one like that.
Convert your OpenCV image to 16 bit before making a QImage out of it.