本文整理汇总了Java中org.opencv.core.Rect.tl方法的典型用法代码示例。如果您正苦于以下问题:Java Rect.tl方法的具体用法?Java Rect.tl怎么用?Java Rect.tl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opencv.core.Rect
的用法示例。
在下文中一共展示了Rect.tl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawFaceShapes
import org.opencv.core.Rect; //导入方法依赖的package包/类
public static void drawFaceShapes(Rect face, Mat matrixRGBA) {
Point start = face.tl();
int h = (int) start.y + (face.height / 2);
int w = (int) start.x + (face.width / 2);
Imgproc.rectangle(matrixRGBA, start, face.br(),
FACE_RECT_COLOR, 3);
Point center = new Point(w, h);
Imgproc.circle(matrixRGBA, center, 10, new Scalar(255, 0, 0, 255), 3);
}
示例2: verticalScale
import org.opencv.core.Rect; //导入方法依赖的package包/类
public static Rect verticalScale(Rect original, double factor) {
double height = original.br().y - original.tl().y;
double newHeight = height * factor;
double newTop = original.tl().y - ((newHeight - height) / 2);
double width = original.br().x - original.tl().x;
return new Rect((int) original.tl().x, (int) newTop, (int) width, (int) newHeight);
}
示例3: horizontalScale
import org.opencv.core.Rect; //导入方法依赖的package包/类
public static Rect horizontalScale(Rect original, double factor) {
double width = original.br().x - original.tl().x;
double newWidth = width * factor;
double newLeft = original.tl().x - ((newWidth - width) / 2);
double height = original.br().y - original.tl().y;
return new Rect((int) newLeft, (int) original.tl().y, (int) newWidth, (int) height);
}
示例4: setRect
import org.opencv.core.Rect; //导入方法依赖的package包/类
private void setRect(Rect rect) {
this.rect = new RotatedRect(new Point(rect.tl().x + rect.size().width / 2,
rect.tl().y + rect.size().height / 2), rect.size(), 0.0);
}