# What does isContourConvex actually do?

Hi,

I am using `isContourConvex`

to remove some contours in my image and it also works quite well. But now I want to know what the function actually does?
I found some threads where it says, that `isContourConvex`

can distinguish between closed and open contours. In my example "boomerang-shaped" contours which **in fact are closed** get marked as false and I can remove them (exactly what I want).

I found this: https://docs.opencv.org/2.4/modules/i... and this: https://github.com/opencv/opencv/blob... but the explanation is really small and I don't understand the source code.

A convex shape is a shape (defined by its contour) where if you choose two points belonging to this shape then line between this two points belongs to shape. A disk is convex not a star... boomerang-shaped is not convex

What is an open contour in opencv ?

open set but it is topology

A convex hull can always be built around a set of vertices. Once the convex hull is built, and if there are extra vertices inside the convex hull, then it's not a convex shape.

Thanks, I understand the definition of convex shape now! Did they build the source code of this function like this? Do they test all possible lines between points of the contour and if one intersects the contour the say it is not a convex shape? Or do they follow sjhalayka's approach?