OpenCV中的findContours函数参数详解
正一番薯:
Optional output vector (e.g. std::vector), containing information about the image topology. It has as many elements as the number of contours. For each i-th contour contours[i], the elements hierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , and hierarchy[i][3] are set to 0-based indices in contours of the next and previous contours at the same hierarchical level, the first child contour and the parent contour, respectively. If for the contour i there are no next, previous, parent, or nested contours, the corresponding elements of hierarchy[i] will be negative.
https://docs.opencv.org/3.4/d3/dc0/group__imgproc__shape.html#ga17ed9f5d79ae97bd4c7cf18403e1689a
opencv 3.4文档说hierarchy[2],hierarchy[3]分别是子轮廓、父轮廓的索引,与博主描述的有出入,请确认一下哈
|