示例#1
0
 /**
  * Clips the (axis aligned) rectangle specified by the points min and max to the image size.
  *
  * @param img
  * @param min
  * @param max
  * @return the clipped rectangle
  */
 public static CvRect clip(IplImage img, Vector min, Vector max) {
   int xmin = Image.clipX(img, min.x);
   int xmax = Image.clipX(img, max.x);
   int ymin = Image.clipY(img, min.y);
   int ymax = Image.clipY(img, max.y);
   return cvRect(xmin, ymin, xmax - xmin, ymax - ymin);
 }
示例#2
0
 public Rectangle makeRectangle() {
   return new Rectangle(x, y, coinImage.getWidth(null), coinImage.getHeight(null));
 }