Package org.opencv.core

Examples of org.opencv.core.MatOfRect


    public List<ArtifactDetectedObject> detectObjects(BufferedImage bImage) {
        List<ArtifactDetectedObject> detectedObjectList = new ArrayList<ArtifactDetectedObject>();
        Mat image = OpenCVUtils.bufferedImageToMat(bImage);
        if (image != null) {
            MatOfRect faceDetections = new MatOfRect();
            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


   */
  public Rectangle[] detect(double scaleFactor , int minNeighbors , int flags, int minSize , int maxSize){
    Size minS = new Size(minSize, minSize);
    Size maxS = new Size(maxSize, maxSize);
   
    MatOfRect detections = new MatOfRect();
    classifier.detectMultiScale(getCurrentMat(), detections, scaleFactor, minNeighbors, flags, minS, maxS );

    return OpenCV.toProcessing(detections.toArray());
  }
View Full Code Here

   *
   * @return
   *     An array of java.awt.Rectnangle objects with the location, width, and height of each detected object.
   */
  public Rectangle[] detect(){
    MatOfRect detections = new MatOfRect();
    classifier.detectMultiScale(getCurrentMat(), detections);
   
    return OpenCV.toProcessing(detections.toArray());
  }
View Full Code Here

TOP

Related Classes of org.opencv.core.MatOfRect

Copyright © 2018 www.massapicom. 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.