List of usage examples for org.opencv.core MatOfPoint release
public void release()
From source file:team492.GripVision.java
License:Open Source License
@Override public Rect[] getDetectedObjectRects() { Rect[] objectRects = null;//from w ww. j av a2 s. c om ArrayList<MatOfPoint> detectedObjects = pipeline.findContoursOutput(); // // If we detected any objects, convert them into an array of rectangles. // if (detectedObjects != null && !detectedObjects.isEmpty()) { objectRects = new Rect[detectedObjects.size()]; for (int i = 0; i < objectRects.length; i++) { MatOfPoint object = detectedObjects.get(i); objectRects[i] = Imgproc.boundingRect(object); object.release(); } } return objectRects; }