how to view Mat image with 32FC1 image format. or how to convert it into 8UC1(I know an old method cvConvertImage, but I need new method)
Isn't the new interface nice?
Mat floatMat(w, h, CV_32FC1);
Mat ucharMat, ucharMatScaled;
floatMat.convertTo(ucharMat, CV_8UC1);
// scale values from 0..1 to 0..255
floatMat.convertTo(ucharMatScaled, CV_8UC1, 255, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With