Ask Your Question
1

Which other values does the anchor point in blur function take?

asked May 23 '13

muglikar gravatar image

updated Jun 12 '13

This link says:

anchor – anchor point; default value Point(-1,-1) means that the anchor is at the kernel center.

I could change this value to (0,0) and it worked with the image slightly shifted to top left. But it did not work for any other value i.e. it gives Unhandled Exception (Unhandled exception at 0x75d8d36f in testCV.exe: Microsoft C++ exception: cv::Exception at memory location 0x0020ee6c..) for any other value of the coordinates of the anchor point. So, I'm a bit unclear about what does it exactly mean?

blur(src, dst, Size(i, i), Point( 2, 2 )); // The point takes on (0,0) & (-1,-1) values for now. Why???

Preview: (hide)

2 answers

Sort by » oldest newest most voted
2

answered Sep 11 '19

Freeman gravatar image

The anchor point indicates how the kernel is aligned with the source image. cv::point(-1-1) indicates that the anchor is at the kernel center, i.e., it is equivalent to kernelWidth/2 and kernelHeight/2. In my case, with a 3x3 kernel it works (does not crash) with anchor points from (0,0) to (2,2). In particular, with this way of calling:

cv::blur(src,t1, cv::Size(3,3), cv::Point(2,2));

In this call the anchor is cv::Point(2,2) and so the filter weighted average takes values from the current pixels and from up to 2 left and and upper pixels.

Preview: (hide)
1

answered May 23 '13

Notas gravatar image

sigh What does "did not work" mean? Did the program crash? What kernel did you even use? I guess it was a 1x1 one, hence only (0,0) worked.

Preview: (hide)

Question Tools

Stats

Asked: May 23 '13

Seen: 1,852 times

Last updated: Sep 11 '19