typedef struct Camera_Rect {...} Camera_Rect Defines a camera rectangle. This method is used to draw rectangles for various detection objects.
The coordinate system for detection points is based on the landscape device orientation, with the charging port on the right.
The origin of the coordinate system is (0, 0) at the upper left corner, and the coordinates at the lower right corner are the resolution of the camera preview stream.
All parameters are integer pixel values. topLeftX and topLeftY indicate the coordinates of the upper left corner of the rectangle, and width and height indicate the width and height of the rectangle.
Since: 11
Related module: OH_Camera
Header file: camera.h
| Name | Description |
|---|---|
| int32_t topLeftX | X-axis coordinate of the upper left corner of the rectangle. The value range is [0, preview stream width]. For example, for a 1920 × 1440 preview stream, the value range is [0, 1920]. |
| int32_t topLeftY | Y-axis coordinate of the upper left corner of the rectangle. The value range is [0, preview stream height]. For example, for a 1920 × 1440 preview stream, the value range is [0, 1440]. |
| int32_t width | Rectangle width. The value cannot exceed the upper limit of the X axis of the coordinate system, that is, the maximum value of topLeftX. |
| int32_t height | Rectangle height. The value cannot exceed the upper limit of the Y axis of the coordinate system, that is, the maximum value of topLeftY. |