How can I convert an 8 bit mat to a 32 bit mat to use in the kmeans function. I tried to use ConvertScale, but the compiler said it was an unknown function. I am using OpenCV 2.3.1 and want to avoid using the API calls from older versions.
Thanks in advance!
you can use convertTo
cv::Mat mat = do your thing using CV_8S (or CV_8U)
cv::Mat dst = do your other thing
mat.convertTo(dst, CV_32S);
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