OpenCV filter2D: Is there a use for cores not pinned to the center?

I am currently working on folding in OpenCV using the filter2D function. Almost always I found that the core is anchored in the center (using the default anchor = (-1, -1)).

Are there cases where the core needs to be anchored from the center? What are the benefits of this, if any?

There are similar posts on SE ( post 1 , post 2 ), but I couldn't get my answer.

+3


source to share


1 answer


Yes. Mostly if you are using an unbalanced kernel.

Most of the time people use the kernel, which is square, circle, or gaussian. In these cases, you probably want the anchor to be in the center.



But there are other uses for filter2D - trying to find the location of certain artifacts. In these cases, the artifact can be located, for example, to the left of the point of interest. In this case, the anchor will be to the right of the kernel (and the kernel will look like the artifact you are looking for)

+4


source







All Articles