findContours
retrieves contours from a binary image using
the algorithm by Suzuki & Be (1985).
findContours(image, mode = "external", method = "simple",
offset = c(0, 0))
image | An 8-bit (8U) single-channel |
---|---|
mode | Mode of the contour retrieval algorithm. It can take the following values:
|
method | Method for approximating the contours. It can take the following values:
|
offset | A 2-element vector representing the offset by which every
contour point should be shifted (default: |
A list of two data frames:
"contours": a data frame with 3 columns:
"id": the contour identity (indicates the set of points belonging to the same contour).
"x": the x coordinates of the contour points.
"y": the y coordinates of the contour points.
"hierarchy": a data frame with 5 columns:
"id": the contour identity.
"after": the identity of the next contour at the same hierarchical level.
"before": the identity of the previous contour at the same hierarchical level.
"child": the identity of the first child contour.
"parent": the identity of the parent contour.
Suzuki, S., and Be, K. (1985). Topological structural analysis of digitized binary images by border following. Computer Vision, Graphics, and Image Processing 30, 32–46. doi:10.1016/0734-189X(85)90016-7.
Teh, C.-H., and Chin, R. T. (1989). On the detection of dominant points on digital curves. IEEE Trans. Pattern Anal. Mach. Intell. 11, 859–872. doi:10.1109/34.31447.
Simon Garnier, garnier@njit.edu
# TODO