org.openimaj.math.geometry.shape.Rectangle.minY()方法的使用及代码示例

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

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

Rectangle.minY介绍

暂无

代码示例

代码示例来源:origin: openimaj/openimaj

@Override
public double minY() {
  return this.calculateRegularBoundingBox().minY();
}

代码示例来源:origin: openimaj/openimaj

/**
 * @return The top-left coordinate
 */
public Point2d getTopLeft() {
  return new Point2dImpl((float) minX(), (float) minY());
}

代码示例来源:origin: openimaj/openimaj

/**
 * Removes zero-valued pixels from around the outside of the image.
 * Analagous to {@link String#trim()}.
 *
 * @return A new image containing the trimmed image.
 */
public I trim() {
  final Rectangle rect = this.getContentArea();
  return this.extractROI((int) rect.minX(), (int) rect.minY(), (int) (rect.getWidth()), (int) (rect.getHeight()));
}

代码示例来源:origin: org.openimaj/core-image

/**
 * Removes zero-valued pixels from around the outside of the image.
 * Analagous to {@link String#trim()}.
 *
 * @return A new image containing the trimmed image.
 */
public I trim() {
  final Rectangle rect = this.getContentArea();
  return this.extractROI((int) rect.minX(), (int) rect.minY(), (int) (rect.getWidth()), (int) (rect.getHeight()));
}

代码示例来源:origin: openimaj/openimaj

&& (!((s_bbox[s].maxY() < c_bbox[c].minY()) || (s_bbox[s]
    .minY() > c_bbox[c].maxY())));

代码示例来源:origin: openimaj/openimaj

/**
 * {@inheritDoc}
 *
 * @see org.openimaj.image.Image#getContentArea()
 */
@Override
public Rectangle getContentArea() {
  int minx = this.getWidth(), maxx = 0, miny = this.getHeight(), maxy = 0;
  for (int i = 0; i < this.numBands(); i++) {
    final Rectangle box = this.getBand(i).getContentArea();
    if (box.minX() < minx)
      minx = (int) box.minX();
    if (box.maxX() > maxx)
      maxx = (int) box.maxX();
    if (box.minY() < miny)
      miny = (int) box.minY();
    if (box.maxY() > maxy)
      maxy = (int) box.maxY();
  }
  return new Rectangle(minx, miny, maxx - minx, maxy - miny);
}

代码示例来源:origin: org.openimaj/core-image

/**
 * {@inheritDoc}
 *
 * @see org.openimaj.image.Image#getContentArea()
 */
@Override
public Rectangle getContentArea() {
  int minx = this.getWidth(), maxx = 0, miny = this.getHeight(), maxy = 0;
  for (int i = 0; i < this.numBands(); i++) {
    final Rectangle box = this.getBand(i).getContentArea();
    if (box.minX() < minx)
      minx = (int) box.minX();
    if (box.maxX() > maxx)
      maxx = (int) box.maxX();
    if (box.minY() < miny)
      miny = (int) box.minY();
    if (box.maxY() > maxy)
      maxy = (int) box.maxY();
  }
  return new Rectangle(minx, miny, maxx - minx, maxy - miny);
}

相关文章