How does CV_CHAIN_APPROX_SIMPLE work?

asked 2017-11-26 05:40:14 -0600

Jeana gravatar image

From the documentation of Imgproc.findContours :

CV_CHAIN_APPROX_SIMPLE compresses horizontal, vertical, and diagonal segments and leaves only their end points. For example, an up-right rectangular contour is encoded with 4 points.

How does this work exactly? Does this use the Douglas-Peucker algorithm?

edit retag flag offensive close merge delete

Comments

I'm interpreting it wrong I think, it just ignores points if they're on a horizontal/diagonal/vertical line but doesn't do anything too fancy? ApproxPolyDP uses Douglas-Peucker.

Jeana gravatar imageJeana ( 2017-11-26 07:08:17 -0600 )edit

take a look at the code

i can say it uses a simple method not Douglas-Peucker algorithm

sturkmen gravatar imagesturkmen ( 2017-11-26 07:20:57 -0600 )edit