Attention! This forum will be made read-only by Dec-20. Please migrate to Most of existing active users should've received invitation by e-mail.
Ask Your Question

Questions about the filter2D

asked 2013-10-25 22:41:16 -0500

Yi Zhang gravatar image

The parameter anchor of the function filter2D indicates the relative position of a filtered point within the kernel; But what is the detail of processing the value of the anchor?

For example: image description

The default value (-1,-1) means that the anchor is at the kernel center, but I think in this case the anchor.x and anchor.y are not equal to -1? What is the real value of the anchor? And how dose OpenCV process the value of the anchor?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-10-26 04:26:00 -0500

Ilya Lavrenov gravatar image

updated 2013-10-26 04:27:08 -0500

the anchor Point(-1, -1) means that OpenCV function must automatically puts a filtered pixel at the kernel center. For example, if a kernel has size Size(5, 5) then an anchor will be Point(2, 2).

edit flag offensive delete link more



That means anchor.x = 2 and anchor.y = 2?

Yi Zhang gravatar imageYi Zhang ( 2013-10-30 21:13:01 -0500 )edit

yes, anchor.x = anchor.y = 2 for this case.

Ilya Lavrenov gravatar imageIlya Lavrenov ( 2013-11-08 15:04:38 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-10-25 22:41:16 -0500

Seen: 90 times

Last updated: Oct 26 '13