参考文档.../docs/opencvman_old.pdf里面第三章有介绍。
英文如下:
Contour Retrieving Algorithm
Four variations of algorithms described in [Suzuki85] are used in the library to retrieve
borders.
1. The first algorithm finds only the extreme outer contours in the image and
returns them linked to the list. Figure 1-2 shows these external boundaries of
W1, W2, and W3 domains.
2. The second algorithm returns all contours linked to the list. Figure 1-2 shows
the total of 8 such contours.
3. The third algorithm finds all connected components by building a two-level
hierarchical structure: on the top are the external boundaries of 1-domains and
every external boundary contains a link to the list of holes of the
corresponding component. The third algorithm returns all the connected
components as a two-level hierarchical structure: on the top are the external
boundaries of 1-domains and every external boundary contour header contains
a link to the list of holes in the corresponding component. The list can be
accessed via v_next field of the external contour header. Figure 1-2 shows
that W2, W5, and W6 domains have no holes; consequently, their boundary
contour headers refer to empty lists of hole contours. W1 domain has two holes
- the external boundary contour of W1 refers to a list of two hole contours.
Finally, W3 external boundary contour refers to a list of the single hole
contour.
4. The fourth algorithm returns the complete hierarchical tree where all the
contours contain a list of contours surrounded by the contour directly, that is,
the hole contour of W3 domain has two children: external boundary contours
of W5 and W6 domains.
如果找不到opencvman_old.pdf,可以私信我。