Bug in lib or documetation of Canny/Sobel functions ??

Bug in lib or documetation of Canny/Sobel functions ??

hi,

I found out, that ippiCanny_16s8u_C1R does not work right
when fed with the output coming from ippiFilterSobelHoriz/Vert
functions.
Horizontal & vertical edges are found correctly. But diagonal
edges look strange.
When the output of ippiFilterSobelVert is negated and then
used as input for ippiCanny_16s8u_C1R it works perfectly.
In addition to that, I guess the kernels presented in the documentation do not match the implemented kernels (see attached demo program).

alexander pfaff

/* Demo program to show mismatch of implementation and documentation of
*
* ippiFilterSobelHoriz_XYZ
* ------------------------
* Kernel as shown in documentation:
* 1 2 1
* 0 0 0
* -1 -2 -1
* Kernel implemented in library:
* -1 -2 -1
* 0 0 0
* 1 2 1
*
* ippiFilterSobelVert_XYZ
* ------------------------
* Kernel as shown in documentation:
* -1 0 1
* -2 0 2
* -1 0 1
*
* Kernel implemented:
* 1 0 -1
* 2 0 -2
* 1 0 -1
*/

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Sobel convolutions that are implemented in ippCV and OpenCV libraries are really correlations ie their kernels for odd derivatives are reflected on x=0 or y=0.

So, Sobel functions for first or third derivative on one direction and even derivative on the other direction result in pixels with different size in comparison with "right" definition of convolution operation.

Regards,
Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today