fixed problem with Nx2 numpy arrays in geometrical functions (#2783)
This commit is contained in:
@@ -47,11 +47,15 @@ CV_IMPL CvSeq* cvPointSeqFromMat( int seq_kind, const CvArr* arr,
|
||||
CV_Assert( arr != 0 && contour_header != 0 && block != 0 );
|
||||
|
||||
int eltype;
|
||||
CvMat hdr;
|
||||
CvMat* mat = (CvMat*)arr;
|
||||
|
||||
if( !CV_IS_MAT( mat ))
|
||||
CV_Error( CV_StsBadArg, "Input array is not a valid matrix" );
|
||||
|
||||
if( CV_MAT_CN(mat->type) == 1 && mat->width == 2 )
|
||||
mat = cvReshape(mat, &hdr, 2);
|
||||
|
||||
eltype = CV_MAT_TYPE( mat->type );
|
||||
if( eltype != CV_32SC2 && eltype != CV_32FC2 )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
|
Reference in New Issue
Block a user