本文整理匯總了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);
}