org.opencv.core.Rect.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中org.opencv.core.Rect.<init>方法的一些代码示例,展示了Rect.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rect.<init>方法的具体详情如下:
包路径:org.opencv.core.Rect
类名称:Rect
方法名:<init>

Rect.<init>介绍

暂无

代码示例

代码示例来源:origin: RaiMan/SikuliX2

/**
 * create a sub image from this image
 *
 * @param x pixel column
 * @param y pixel row
 * @param w width
 * @param h height
 * @return the new image
 */
public Picture getSub(int x, int y, int w, int h) {
 Picture img = new Picture();
 if (isValid()) {
  img = new Picture(getContent().submat(new Rect(x, y, w, h)));
 }
 return img;
}

代码示例来源:origin: RaiMan/SikuliX2

public Mat getContent(Element elem) {
 if (SX.isNull(elem)) {
  return makeContent();
 } else {
  return makeContent().submat(new Rect(elem.x, elem.y, elem.w, elem.h));
 }
}

代码示例来源:origin: RaiMan/SikuliX2

Math.min(target.h + 2 * margin, mBase.height()));
rSub = new Rectangle(0, 0, mBase.cols(), mBase.rows()).intersection(rSub);
Rect rectSub = new Rect(rSub.x, rSub.y, rSub.width, rSub.height);
mResult = doFindMatch(target, mBase.submat(rectSub), null);
mMinMax = Core.minMaxLoc(mResult);

代码示例来源:origin: kongqw/OpenCVForAndroid

public  Rect getROI1()
{
  
  Rect retVal = new Rect(getROI1_0(nativeObj));
  
  return retVal;
}

代码示例来源:origin: kongqw/OpenCVForAndroid

public Rect boundingRect()
{
  Point pt[] = new Point[4];
  points(pt);
  Rect r = new Rect((int) Math.floor(Math.min(Math.min(Math.min(pt[0].x, pt[1].x), pt[2].x), pt[3].x)),
      (int) Math.floor(Math.min(Math.min(Math.min(pt[0].y, pt[1].y), pt[2].y), pt[3].y)),
      (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].x, pt[1].x), pt[2].x), pt[3].x)),
      (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].y, pt[1].y), pt[2].y), pt[3].y)));
  r.width -= r.x - 1;
  r.height -= r.y - 1;
  return r;
}

代码示例来源:origin: kongqw/OpenCVForAndroid

public static Rect boundingRect(MatOfPoint points)
{
  Mat points_mat = points;
  Rect retVal = new Rect(boundingRect_0(points_mat.nativeObj));
  
  return retVal;
}

代码示例来源:origin: farkam135/GoIV

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;
}

代码示例来源:origin: farkam135/GoIV

public  Rect getROI1()
{
  
  Rect retVal = new Rect(getROI1_0(nativeObj));
  
  return retVal;
}

代码示例来源:origin: farkam135/GoIV

public  Rect getROI2()
{
  
  Rect retVal = new Rect(getROI2_0(nativeObj));
  
  return retVal;
}

代码示例来源:origin: tz28/Chinese-number-gestures-recognition

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;
}

代码示例来源:origin: leadrien/opencv_native_androidstudio

public static Rect boundingRect(MatOfPoint points)
{
  Mat points_mat = points;
  Rect retVal = new Rect(boundingRect_0(points_mat.nativeObj));
  
  return retVal;
}

代码示例来源:origin: leadrien/opencv_native_androidstudio

public  Rect getROI2()
{
  
  Rect retVal = new Rect(getROI2_0(nativeObj));
  
  return retVal;
}

代码示例来源:origin: nu.pattern/opencv

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;
}

代码示例来源:origin: DuckDeck/AndroidDemo

public  Rect getROI1()
{
  
  Rect retVal = new Rect(getROI1_0(nativeObj));
  
  return retVal;
}

代码示例来源:origin: ytai/IOIOPlotter

public Rect boundingRect()
{
  Point pt[] = new Point[4];
  points(pt);
  Rect r = new Rect((int) Math.floor(Math.min(Math.min(Math.min(pt[0].x, pt[1].x), pt[2].x), pt[3].x)),
      (int) Math.floor(Math.min(Math.min(Math.min(pt[0].y, pt[1].y), pt[2].y), pt[3].y)),
      (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].x, pt[1].x), pt[2].x), pt[3].x)),
      (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].y, pt[1].y), pt[2].y), pt[3].y)));
  r.width -= r.x - 1;
  r.height -= r.y - 1;
  return r;
}

代码示例来源:origin: kongqw/OpenCVForAndroid

public Rect[] toArray() {
  int num = (int) total();
  Rect[] a = new Rect[num];
  if(num == 0)
    return a;
  int buff[] = new int[num * _channels];
  get(0, 0, buff); //TODO: check ret val!
  for(int i=0; i<num; i++)
    a[i] = new Rect(buff[i*_channels], buff[i*_channels+1], buff[i*_channels+2], buff[i*_channels+3]);
  return a;
}
public void fromList(List<Rect> lr) {

代码示例来源:origin: kongqw/OpenCVForAndroid

public ObjectTracker() {
  hist = new Mat();
  trackRect = new Rect();
  rotatedRect = new RotatedRect();
  hsvList = new Vector<>();
  hueList = new Vector<>();
  ranges = new MatOfFloat(0f, 256f);
}

代码示例来源:origin: com.sikulix/sikulixapi

public Rect[] toArray() {
  int num = (int) total();
  Rect[] a = new Rect[num];
  if(num == 0)
    return a;
  int buff[] = new int[num * _channels];
  get(0, 0, buff); //TODO: check ret val!
  for(int i=0; i<num; i++)
    a[i] = new Rect(buff[i*_channels], buff[i*_channels+1], buff[i*_channels+2], buff[i*_channels+3]);
  return a;
}
public void fromList(List<Rect> lr) {

代码示例来源:origin: nu.pattern/opencv

public Rect[] toArray() {
  int num = (int) total();
  Rect[] a = new Rect[num];
  if(num == 0)
    return a;
  int buff[] = new int[num * _channels];
  get(0, 0, buff); //TODO: check ret val!
  for(int i=0; i<num; i++)
    a[i] = new Rect(buff[i*_channels], buff[i*_channels+1], buff[i*_channels+2], buff[i*_channels+3]);
  return a;
}
public void fromList(List<Rect> lr) {

代码示例来源:origin: DuckDeck/AndroidDemo

public Rect[] toArray() {
  int num = (int) total();
  Rect[] a = new Rect[num];
  if(num == 0)
    return a;
  int buff[] = new int[num * _channels];
  get(0, 0, buff); //TODO: check ret val!
  for(int i=0; i<num; i++)
    a[i] = new Rect(buff[i*_channels], buff[i*_channels+1], buff[i*_channels+2], buff[i*_channels+3]);
  return a;
}
public void fromList(List<Rect> lr) {

相关文章