@@ -47,8 +47,8 @@ class CascadeClassifier implements ffi.Finalizable {
4747 Size minSize = (0 , 0 ),
4848 Size maxSize = (0 , 0 ),
4949 }) {
50- final rects = using< cvg. Rects > ((arena) {
51- final _rects = _bindings.CascadeClassifier_DetectMultiScaleWithParams (
50+ return using <List < Rect > >((arena) {
51+ final rects = _bindings.CascadeClassifier_DetectMultiScaleWithParams (
5252 _ptr,
5353 image.ptr,
5454 scaleFactor,
@@ -57,9 +57,8 @@ class CascadeClassifier implements ffi.Finalizable {
5757 minSize.toSize (arena).ref,
5858 maxSize.toSize (arena).ref,
5959 );
60- return _rects ;
60+ return Rects . toList (rects) ;
6161 });
62- return Rects .toList (rects);
6362 }
6463
6564 cvg.CascadeClassifier _ptr;
@@ -92,8 +91,8 @@ class HOGDescriptor implements ffi.Finalizable {
9291 double groupThreshold = 2.0 ,
9392 bool useMeanshiftGrouping = false ,
9493 }) {
95- final rects = using< cvg. Rects > ((arena) {
96- final _rects = _bindings.HOGDescriptor_DetectMultiScaleWithParams (
94+ return using <List < Rect > >((arena) {
95+ final rects = _bindings.HOGDescriptor_DetectMultiScaleWithParams (
9796 _ptr,
9897 image.ptr,
9998 hitThreshold,
@@ -103,9 +102,8 @@ class HOGDescriptor implements ffi.Finalizable {
103102 groupThreshold,
104103 useMeanshiftGrouping,
105104 );
106- return _rects ;
105+ return Rects . toList (rects) ;
107106 });
108- return Rects .toList (rects);
109107 }
110108
111109 /// HOGDefaultPeopleDetector returns a new Mat with the HOG DefaultPeopleDetector.
@@ -134,11 +132,10 @@ class HOGDescriptor implements ffi.Finalizable {
134132// For further details, please see:
135133// https://docs.opencv.org/master/d5/d54/group__objdetect.html#ga3dba897ade8aa8227edda66508e16ab9
136134List <Rect > groupRectangles (List <Rect > rects, int groupThreshold, double eps) {
137- final ret = using <List <Rect >>((arena) {
138- final _rects = _bindings.GroupRectangles (rects.toNative (arena).ref, groupThreshold, eps);
139- return Rects .toList (_rects );
135+ return using <List <Rect >>((arena) {
136+ final rectsNew = _bindings.GroupRectangles (rects.toNative (arena).ref, groupThreshold, eps);
137+ return Rects .toList (rectsNew );
140138 });
141- return ret;
142139}
143140
144141// QRCodeDetector groups the object candidate rectangles.
0 commit comments