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

Function cvConvexHull2

deps/opencv/modules/imgproc/src/convhull.cpp:221–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219
220
221CV_IMPL CvSeq*
222cvConvexHull2( const CvArr* array, void* hull_storage,
223 int orientation, int return_points )
224{
225 union { CvContour* c; CvSeq* s; } hull;
226 cv::AutoBuffer<CvPoint*> _pointer;
227 CvPoint** pointer;
228 CvPoint2D32f** pointerf = 0;
229 cv::AutoBuffer<int> _stack;
230 int* stack;
231
232 hull.s = 0;
233
234 CvMat* mat = 0;
235 CvSeqReader reader;
236 CvSeqWriter writer;
237 CvContour contour_header;
238 union { CvContour c; CvSeq s; } hull_header;
239 CvSeqBlock block, hullblock;
240 CvSeq* ptseq = 0;
241 CvSeq* hullseq = 0;
242 int is_float;
243 int* t_stack;
244 int t_count;
245 int i, miny_ind = 0, maxy_ind = 0, total;
246 int hulltype;
247 int stop_idx;
248 sklansky_func sklansky;
249
250 if( CV_IS_SEQ( array ))
251 {
252 ptseq = (CvSeq*)array;
253 if( !CV_IS_SEQ_POINT_SET( ptseq ))
254 CV_Error( CV_StsBadArg, "Unsupported sequence type" );
255 if( hull_storage == 0 )
256 hull_storage = ptseq->storage;
257 }
258 else
259 {
260 ptseq = cvPointSeqFromMat( CV_SEQ_KIND_GENERIC, array, &contour_header, &block );
261 }
262
263 if( CV_IS_STORAGE( hull_storage ))
264 {
265 if( return_points )
266 {
267 hullseq = cvCreateSeq(
268 CV_SEQ_KIND_CURVE|CV_SEQ_ELTYPE(ptseq)|
269 CV_SEQ_FLAG_CLOSED|CV_SEQ_FLAG_CONVEX,
270 sizeof(CvContour), sizeof(CvPoint),(CvMemStorage*)hull_storage );
271 }
272 else
273 {
274 hullseq = cvCreateSeq(
275 CV_SEQ_KIND_CURVE|CV_SEQ_ELTYPE_PPOINT|
276 CV_SEQ_FLAG_CLOSED|CV_SEQ_FLAG_CONVEX,
277 sizeof(CvContour), sizeof(CvPoint*), (CvMemStorage*)hull_storage );
278 }

Callers 2

convexHullMethod · 0.85
cvMinAreaRect2Function · 0.85

Calls 10

cvPointSeqFromMatFunction · 0.85
cvCreateSeqFunction · 0.85
cvMakeSeqHeaderForArrayFunction · 0.85
cvClearSeqFunction · 0.85
cvStartAppendToSeqFunction · 0.85
cvStartReadSeqFunction · 0.85
icvCalcAndWritePtIndicesFunction · 0.85
cvEndWriteSeqFunction · 0.85
cvBoundingRectFunction · 0.85
allocateMethod · 0.45

Tested by

no test coverage detected