Package org.opencv.core

Examples of org.opencv.core.MatOfRect.toArray()


            double width = image.width();
            double height = image.height();
            for (CascadeClassifierHolder objectClassifier : objectClassifiers) {
                objectClassifier.cascadeClassifier.detectMultiScale(image, faceDetections);

                for (Rect rect : faceDetections.toArray()) {
                    ArtifactDetectedObject detectedObject = new ArtifactDetectedObject(
                            rect.x / width,
                            rect.y / height,
                            (rect.x + rect.width) / width,
                            (rect.y + rect.height) / height,
View Full Code Here


    Size maxS = new Size(maxSize, maxSize);
   
    MatOfRect detections = new MatOfRect();
    classifier.detectMultiScale(getCurrentMat(), detections, scaleFactor, minNeighbors, flags, minS, maxS );

    return OpenCV.toProcessing(detections.toArray());
  }
 
  /**
   * Detect objects using the cascade classifier. loadCascade() must already
   * have been called to setup the classifier.
View Full Code Here

   */
  public Rectangle[] detect(){
    MatOfRect detections = new MatOfRect();
    classifier.detectMultiScale(getCurrentMat(), detections);
   
    return OpenCV.toProcessing(detections.toArray());
  }
 
  /**
   * Setup background subtraction. After calling this function,
   * updateBackground() must be called with each new frame
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.