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

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

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

Rectangle.getHeight介绍

暂无

代码示例

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

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

代码示例来源: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: org.openimaj/core-image

switch (sty.getVerticalAlignment()) {
case VERTICAL_BOTTOM:
  y -= rect.getHeight();
  break;
case VERTICAL_HALF:
  y -= rect.getHeight()/2f;
  break;
default:

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

switch (sty.getVerticalAlignment()) {
case VERTICAL_BOTTOM:
  y -= rect.getHeight();
  break;
case VERTICAL_HALF:
  y -= rect.getHeight()/2f;
  break;
default:

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

/**
 * Create a transform to transform from one rectangle to another.
 *
 * @param from
 *            first rectangle
 * @param to
 *            second rectangle
 * @return the transform
 */
public static Matrix makeTransform(Rectangle from, Rectangle to) {
  final Point2d trans = to.getTopLeft().minus(from.getTopLeft());
  final double scaleW = to.getWidth() / from.getWidth();
  final double scaleH = to.getHeight() / from.getHeight();
  return TransformUtilities.scaleMatrix(scaleW, scaleH).times(
      TransformUtilities.translateMatrix(trans.getX(), trans.getY()));
}

相关文章