File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -873,10 +873,13 @@ extractMSER_8uC3( const Mat& src,
873
873
const MSER_Impl::Params& params )
874
874
{
875
875
bboxvec.clear ();
876
- MSCRNode* map = (MSCRNode*)cvAlloc ( src.cols *src.rows *sizeof (map[0 ]) );
876
+ AutoBuffer<MSCRNode> mapBuf (src.cols *src.rows );
877
+ MSCRNode* map = mapBuf.data ();
877
878
int Ne = src.cols *src.rows *2 -src.cols -src.rows ;
878
- MSCREdge* edge = (MSCREdge*)cvAlloc ( Ne*sizeof (edge[0 ]) );
879
- TempMSCR* mscr = (TempMSCR*)cvAlloc ( src.cols *src.rows *sizeof (mscr[0 ]) );
879
+ AutoBuffer<MSCREdge> edgeBuf (Ne);
880
+ MSCREdge* edge = edgeBuf.data ();
881
+ AutoBuffer<TempMSCR> mscrBuf (src.cols *src.rows );
882
+ TempMSCR* mscr = mscrBuf.data ();
880
883
double emean = 0 ;
881
884
Mat dx ( src.rows , src.cols -1 , CV_64FC1 );
882
885
Mat dy ( src.rows -1 , src.cols , CV_64FC1 );
@@ -987,9 +990,6 @@ extractMSER_8uC3( const Mat& src,
987
990
}
988
991
bboxvec.push_back (Rect (xmin, ymin, xmax - xmin + 1 , ymax - ymin + 1 ));
989
992
}
990
- cvFree ( &mscr );
991
- cvFree ( &edge );
992
- cvFree ( &map );
993
993
}
994
994
995
995
void MSER_Impl::detectRegions ( InputArray _src, vector<vector<Point> >& msers, vector<Rect>& bboxes )
You can’t perform that action at this time.
0 commit comments