Package org.opencv.core

Examples of org.opencv.core.Rect


* @see <a href="http://docs.opencv.org/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#boundingrect">org.opencv.imgproc.Imgproc.boundingRect</a>
*/
    public static Rect boundingRect(MatOfPoint points)
    {
        Mat points_mat = points;
        Rect retVal = new Rect(boundingRect_0(points_mat.nativeObj));

        return retVal;
    }
View Full Code Here


    //

    public static Rect getValidDisparityROI(Rect roi1, Rect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize)
    {

        Rect retVal = new Rect(getValidDisparityROI_0(roi1.x, roi1.y, roi1.width, roi1.height, roi2.x, roi2.y, roi2.width, roi2.height, minDisparity, numberOfDisparities, SADWindowSize));

        return retVal;
    }
View Full Code Here

        templateImage_ = OpenCvUtils.convertBufferedImage(templateImage_,BufferedImage.TYPE_INT_ARGB);  
        cameraImage_ = OpenCvUtils.convertBufferedImage(cameraImage_, BufferedImage.TYPE_INT_ARGB);
       
        Mat templateImage = OpenCvUtils.toMat(templateImage_);
        Mat cameraImage = OpenCvUtils.toMat(cameraImage_);
        Mat roiImage = new Mat(cameraImage, new Rect(roiX, roiY, roiWidth, roiHeight));
       
        // http://stackoverflow.com/questions/17001083/opencv-template-matching-example-in-android
        Mat resultImage = new Mat(
                roiImage.cols() - templateImage.cols() + 1,
                roiImage.rows() - templateImage.rows() + 1,
View Full Code Here

* @see <a href="http://docs.opencv.org/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#boundingrect">org.opencv.imgproc.Imgproc.boundingRect</a>
*/
    public static Rect boundingRect(MatOfPoint points)
    {
        Mat points_mat = points;
        Rect retVal = new Rect(boundingRect_0(points_mat.nativeObj));

        return retVal;
    }
View Full Code Here

  public Contour(PApplet parent, MatOfPoint mat){
    polygonApproximationFactor = mat.size().height * 0.01;
    this.parent = parent;
    this.pointMat = mat;
   
    Rect r = Imgproc.boundingRect(mat);
    boundingBox = new Rectangle(r.x, r.y, r.width, r.height);
      loadPoints(mat.toArray());
  }
View Full Code Here

  public Contour(PApplet parent, MatOfPoint2f mat){
    polygonApproximationFactor = mat.size().height * 0.01;
    this.parent = parent;
    this.pointMat = new MatOfPoint(mat.toArray());
   
    Rect r = Imgproc.minAreaRect(mat).boundingRect();
    boundingBox = new Rectangle(r.x, r.y, r.width, r.height);
    loadPoints(mat.toArray());     
  }
View Full Code Here

      roiWidth = w;
      roiHeight = h;
   
      if(useColor){
        nonROImat = matBGRA;
        matROI = new Mat(matBGRA, new Rect(x, y, w, h));
      } else {
        nonROImat = matGray;
        matROI = new Mat(matGray, new Rect(x, y, w, h));
      }
      useROI = true;
     
      return true;
    }
View Full Code Here

TOP

Related Classes of org.opencv.core.Rect

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.