MCPcopy Create free account
hub / github.com/creatale/node-dv / addChildContour

Function addChildContour

deps/opencv/modules/imgproc/src/contours.cpp:1764–1787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1762{
1763
1764static void addChildContour(InputArrayOfArrays contours,
1765 size_t ncontours,
1766 const Vec4i* hierarchy,
1767 int i, vector<CvSeq>& seq,
1768 vector<CvSeqBlock>& block)
1769{
1770 for( ; i >= 0; i = hierarchy[i][0] )
1771 {
1772 Mat ci = contours.getMat(i);
1773 cvMakeSeqHeaderForArray(CV_SEQ_POLYGON, sizeof(CvSeq), sizeof(Point),
1774 !ci.empty() ? (void*)ci.data : 0, (int)ci.total(),
1775 &seq[i], &block[i] );
1776
1777 int h_next = hierarchy[i][0], h_prev = hierarchy[i][1],
1778 v_next = hierarchy[i][2], v_prev = hierarchy[i][3];
1779 seq[i].h_next = (size_t)h_next < ncontours ? &seq[h_next] : 0;
1780 seq[i].h_prev = (size_t)h_prev < ncontours ? &seq[h_prev] : 0;
1781 seq[i].v_next = (size_t)v_next < ncontours ? &seq[v_next] : 0;
1782 seq[i].v_prev = (size_t)v_prev < ncontours ? &seq[v_prev] : 0;
1783
1784 if( v_next >= 0 )
1785 addChildContour(contours, ncontours, hierarchy, v_next, seq, block);
1786 }
1787}
1788
1789}
1790

Callers 1

drawContoursMethod · 0.85

Calls 4

cvMakeSeqHeaderForArrayFunction · 0.85
getMatMethod · 0.45
emptyMethod · 0.45
totalMethod · 0.45

Tested by

no test coverage detected