• DepthAI
  • Edges much stronger from depthai EdgeDetector compared to opencv Sobel

Hi,

I really like the edges from depthai EdgeDetector. However, I wanted the x and y gradient components separately so I applied opencv's Sobel function on the image. But I noticed the gradient magnitudes from opencv were nowhere near as high as the depthai edges.

Please see below images for comparison. Are the two expected to be the same or is there some sort of gradient magnitude scaling in the depthai EdgeDetector?

Also, is it possible to get the x and y components of the gradient separately from depthai EdgeDetector?

Image

From depthai EdgeDetector

From opencv Sobel

Best,
AB

    jakaskerl

    Many thanks for pointing out we can use custom kernels in that manner. Apologies I had not paid attention to that bit in the documentation.

    I guess to get the horizontal gradient we can just set the vertical kernel to all zeros and vice versa?

    Best,
    AB