The findContours algorithm is one of the most used OpenCV algorithms in regards to segment objects. This is because this algorithm was included in OpenCV from version 1.0 and gives developers more information and descriptors, including shapes, topological organizations, and so on:
void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point())
Let's explain each parameter:
- Image: Input binary image.
- Contours: A contour's output where each detected contour is a vector of points.
- Hierarchy: This is the optional output vector where the hierarchy of contours is saved. This is the topology of the image where we can get the relations between ...