Problem cvCanny and float 32 bits (IPL_DEPTH_32F)

I have some problems with OpenCV cvCanny (...) , and image data types can handle it. Well maybe you guys / gala know the solution.

I have a 32 bit floating image and I want to execute cvCanny. The problem is that cvCanny can only handle "IPL_DEPTH_8S" or U (signed / unsigned short) or at least what I suspect. The OpenCV manual does not indicate how much it can handle, and this line in cv / cvcanny.cpp did not have any hopes:

...
if( CV_MAT_TYPE( src->type ) != CV_8UC1 ||
CV_MAT_TYPE( dst->type ) != CV_8UC1 )
CV_ERROR( CV_StsUnsupportedFormat, "" );
...

The images I have are greyscale / single channel float32 bit and the values ​​in the image are between 0.0 and 16.0. Casting my float32 into unsigned short didn't help much, as the values ​​would lose their accuracy and I would skip the edges with open source canvas.

Do you guys / gala know how to solve the problem? (besides using ITK :))

+3
source share
1 answer

, cvCanny 8- , , , - 255/16 CV_8UC1, 0 - 255, .

+3

Source: https://habr.com/ru/post/1720598/


All Articles