Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6812 Discussions

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

Deleted_U_Intel
Employee
494 Views
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
*/
0 Kudos
1 Reply
Intel_C_Intel
Employee
494 Views

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

0 Kudos
Reply