Example usage for org.opencv.core MatOfPoint2f empty

List of usage examples for org.opencv.core MatOfPoint2f empty

Introduction

In this page you can find the example usage for org.opencv.core MatOfPoint2f empty.

Prototype

public boolean empty() 

Source Link

Usage

From source file:org.openpnp.vision.FluentCv.java

License:Open Source License

public FluentCv getContourRects(List<MatOfPoint> contours, List<RotatedRect> rects) {
    for (int i = 0; i < contours.size(); i++) {
        MatOfPoint2f contour_ = new MatOfPoint2f();
        contours.get(i).convertTo(contour_, CvType.CV_32FC2);
        if (contour_.empty()) {
            continue;
        }/*from www.  ja v  a  2s  .com*/
        RotatedRect rect = Imgproc.minAreaRect(contour_);
        rects.add(rect);
    }
    return this;
}