Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++ convert cv::Mat from CV_8U to CV_32F

Tags:

c++

image

opencv

I'm having an issue with OpenCV (Assertion Failure) as the image is being loaded as CV_8U when it should be loaded as CV_32F.

So how can i convert from CV_8U to CV_32F?

Many Thanks.

like image 454
MLMLTL Avatar asked Sep 18 '25 12:09

MLMLTL


1 Answers

Using convertTo

input.convertTo(output, CV_32F)
like image 100
seokrae.kim Avatar answered Sep 21 '25 02:09

seokrae.kim