Scene model used to calibrate Simd::Motion::Detector. More...
#include <SimdMotion.hpp>
Public Member Functions | |
| Model (const Model &model) | |
| Model (const FSize &size_=FSize(0.1, 0.1), const FPoints &roi_=FPoints()) | |
| Model (const FSize &size_, const View &mask_) | |
| Model & | operator= (const Model &model) |
Data Fields | |
| FSize | size |
| Minimum object size in ONVIF units [0, 2]. Default (0.1, 0.1). Shooting-star example uses (0.01, 0.01). | |
| FPoints | roi |
| ROI polygon in ONVIF coordinates [-1, 1]. Used when mask is not Gray8. Empty (fewer than 3 points) means the full screen. | |
| View | mask |
| ROI mask. If format is View::Gray8, Detector uses it instead of roi (non-zero pixels are inside). | |
Static Public Attributes | |
| static const uint8_t | EMPTY = 0 |
| Mask value outside ROI. Detector fills the polygon mask with this value. | |
| static const uint8_t | ROI = 255 |
| Mask value inside ROI. Typical usage writes ROI (or any non-zero) into Model::mask. | |
Detailed Description
Scene model used to calibrate Simd::Motion::Detector.
Typical usage constructs Model (or uses the default), optionally sets size / roi / mask, and passes it to Detector::SetModel before NextFrame.
size is the minimum object size in ONVIF units. Default (0.1, 0.1) is about 0.25% of the screen area. The shooting-star example uses (0.01, 0.01).
ROI is either a polygon (roi, at least 3 ONVIF vertices) or a Gray8 mask. If mask.format is View::Gray8, Detector resizes it to the frame and treats non-zero pixels as inside ROI (EMPTY = 0, ROI = 255). Otherwise the polygon is used; fewer than 3 vertices mean the full screen.
Constructor & Destructor Documentation
◆ Model() [1/3]
Copy constructor of Model.
Copies size, roi and, if it is Gray8, a deep copy of mask.
- Parameters
-
[in] model - other model.
◆ Model() [2/3]
Constructs Model from a minimum object size and an ROI polygon.
If roi_ has fewer than 3 points, roi is set to the full-screen rectangle (-1, 1), (1, 1), (1, -1), (-1, -1). mask is left empty, so Detector uses the polygon.
- Parameters
-
[in] size_ - a minimum object size in ONVIF units. Default is (0.1, 0.1) ~ 0.25% of screen area. [in] roi_ - a ROI polygon in ONVIF coordinates. Empty by default (full screen).
◆ Model() [3/3]
Constructs Model from a minimum object size and an ROI mask.
If mask_ is Gray8, it is deep-copied to mask. Otherwise roi is set to the full screen. Typical usage creates a small Gray8 mask (for example 20x20, left half filled with Model::ROI) and calls SetModel.
- Parameters
-
[in] size_ - a minimum object size in ONVIF units. [in] mask_ - a ROI mask. It must be 8-bit gray image (View::Gray8).