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

Function cvarrToMat

deps/opencv/modules/core/src/matrix.cpp:682–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680
681
682Mat cvarrToMat(const CvArr* arr, bool copyData,
683 bool /*allowND*/, int coiMode)
684{
685 if( !arr )
686 return Mat();
687 if( CV_IS_MAT(arr) )
688 return Mat((const CvMat*)arr, copyData );
689 if( CV_IS_MATND(arr) )
690 return Mat((const CvMatND*)arr, copyData );
691 if( CV_IS_IMAGE(arr) )
692 {
693 const IplImage* iplimg = (const IplImage*)arr;
694 if( coiMode == 0 && iplimg->roi && iplimg->roi->coi > 0 )
695 CV_Error(CV_BadCOI, "COI is not supported by the function");
696 return Mat(iplimg, copyData);
697 }
698 if( CV_IS_SEQ(arr) )
699 {
700 CvSeq* seq = (CvSeq*)arr;
701 CV_Assert(seq->total > 0 && CV_ELEM_SIZE(seq->flags) == seq->elem_size);
702 if(!copyData && seq->first->next == seq->first)
703 return Mat(seq->total, 1, CV_MAT_TYPE(seq->flags), seq->first->data);
704 Mat buf(seq->total, 1, CV_MAT_TYPE(seq->flags));
705 cvCvtSeqToArray(seq, buf.data, CV_WHOLE_SEQ);
706 return buf;
707 }
708 CV_Error(CV_StsBadArg, "Unknown array type");
709 return Mat();
710}
711
712void Mat::locateROI( Size& wholeSize, Point& ofs ) const
713{

Callers 15

convert.cppFile · 0.85
cvDetFunction · 0.85
cvInvertFunction · 0.85
cvSolveFunction · 0.85
cvEigenVVFunction · 0.85
cvSVDFunction · 0.85
cvSVBkSbFunction · 0.85
cvDrawContoursFunction · 0.85
cvInitLineIteratorFunction · 0.85
cvLineFunction · 0.85
cvRectangleFunction · 0.85
cvRectangleRFunction · 0.85

Calls 2

MatClass · 0.85
cvCvtSeqToArrayFunction · 0.85

Tested by

no test coverage detected