Simd::Motion is C++ framework for motion detection. More...
Namespaces | |
| namespace | Simd::Motion |
| Contains a C++ framework for motion detection. | |
Data Structures | |
| struct | Position |
| Position of a detected object at one timestamp. More... | |
| struct | Object |
| A classified moving object on the current frame. More... | |
| struct | Event |
| An event generated by Simd::Motion::Detector on the current frame. More... | |
| struct | Metadata |
| Result of Detector::NextFrame for the current frame. More... | |
| struct | Model |
| Scene model used to calibrate Simd::Motion::Detector. More... | |
| struct | Options |
| Options used by Simd::Motion::Detector. More... | |
| class | Detector |
| Motion detector. More... | |
Functions | |
| SIMD_INLINE double | ScreenToOnvifX (ptrdiff_t x, ptrdiff_t screenWidth) |
| Converts a screen X-coordinate to an ONVIF X-coordinate. More... | |
| SIMD_INLINE double | ScreenToOnvifY (ptrdiff_t y, ptrdiff_t screenHeight) |
| Converts a screen Y-coordinate to an ONVIF Y-coordinate. More... | |
| SIMD_INLINE FPoint | ScreenToOnvif (const Point &point, const Point &screenSize) |
| Converts screen 2D-coordinates to ONVIF 2D-coordinates. More... | |
| SIMD_INLINE FSize | ScreenToOnvifSize (const Size &size, const Point &screenSize) |
| Converts a screen 2D-size to an ONVIF 2D-size. More... | |
| SIMD_INLINE ptrdiff_t | OnvifToScreenX (double x, ptrdiff_t screenWidth) |
| Converts an ONVIF X-coordinate to a screen X-coordinate. More... | |
| SIMD_INLINE ptrdiff_t | OnvifToScreenY (double y, ptrdiff_t screenHeight) |
| Converts an ONVIF Y-coordinate to a screen Y-coordinate. More... | |
| SIMD_INLINE Point | OnvifToScreen (const FPoint &point, const Point &screenSize) |
| Converts ONVIF 2D-coordinates to screen 2D-coordinates. More... | |
| SIMD_INLINE Size | OnvifToScreenSize (const FSize &size, const Point &screenSize) |
| Converts an ONVIF 2D-size to a screen 2D-size. More... | |
| SIMD_INLINE String | ToString (Id id) |
| Converts an object ID to a string. More... | |
Detailed Description
Simd::Motion is C++ framework for motion detection.
Function Documentation
◆ ScreenToOnvifX()
| SIMD_INLINE double ScreenToOnvifX | ( | ptrdiff_t | x, |
| ptrdiff_t | screenWidth | ||
| ) |
Converts a screen X-coordinate to an ONVIF X-coordinate.
Maps pixel x in [0, screenWidth] to [-1, 1]. Left edge is -1, right edge is 1. Typical usage is ScreenToOnvif() when filling Model::roi from pixel points.
- Parameters
-
[in] x - a screen X-coordinate in pixels. [in] screenWidth - a screen width in pixels.
- Returns
- ONVIF X-coordinate in range [-1, 1].
◆ ScreenToOnvifY()
| SIMD_INLINE double ScreenToOnvifY | ( | ptrdiff_t | y, |
| ptrdiff_t | screenHeight | ||
| ) |
Converts a screen Y-coordinate to an ONVIF Y-coordinate.
Maps pixel y in [0, screenHeight] to [1, -1]. Top edge is 1, bottom edge is -1 (ONVIF Y grows up). Typical usage is ScreenToOnvif() when filling Model::roi.
- Parameters
-
[in] y - a screen Y-coordinate in pixels. [in] screenHeight - a screen height in pixels.
- Returns
- ONVIF Y-coordinate in range [-1, 1].
◆ ScreenToOnvif()
Converts screen 2D-coordinates to ONVIF 2D-coordinates.
Combines ScreenToOnvifX and ScreenToOnvifY. Typical usage converts a pixel polygon to Model::roi. Detector uses the inverse OnvifToScreen when it applies the model.
- Parameters
-
[in] point - a screen point in pixels. [in] screenSize - a screen size in pixels (width and height).
- Returns
- ONVIF point in range [-1, 1].
◆ ScreenToOnvifSize()
Converts a screen 2D-size to an ONVIF 2D-size.
Full screen maps to (2, 2). Typical usage converts a pixel object size to Model::size. Detector uses the inverse OnvifToScreenSize for Model::size.
- Parameters
-
[in] size - a screen size in pixels (width and height). [in] screenSize - a screen size in pixels (width and height).
- Returns
- ONVIF size in range [0, 2].
◆ OnvifToScreenX()
| SIMD_INLINE ptrdiff_t OnvifToScreenX | ( | double | x, |
| ptrdiff_t | screenWidth | ||
| ) |
Converts an ONVIF X-coordinate to a screen X-coordinate.
Maps x in [-1, 1] to pixels and clamps the result to [0, screenWidth - 1]. Detector uses this through OnvifToScreen when it applies Model::roi.
- Parameters
-
[in] x - an ONVIF X-coordinate in range [-1, 1]. [in] screenWidth - a screen width in pixels.
- Returns
- screen X-coordinate in pixels.
◆ OnvifToScreenY()
| SIMD_INLINE ptrdiff_t OnvifToScreenY | ( | double | y, |
| ptrdiff_t | screenHeight | ||
| ) |
Converts an ONVIF Y-coordinate to a screen Y-coordinate.
Maps y in [-1, 1] to pixels (ONVIF +Y is up) and clamps the result to [0, screenHeight - 1]. Detector uses this through OnvifToScreen when it applies Model::roi.
- Parameters
-
[in] y - an ONVIF Y-coordinate in range [-1, 1]. [in] screenHeight - a screen height in pixels.
- Returns
- screen Y-coordinate in pixels.
◆ OnvifToScreen()
Converts ONVIF 2D-coordinates to screen 2D-coordinates.
Combines OnvifToScreenX and OnvifToScreenY. Detector uses this to convert Model::roi vertices to pixels.
- Parameters
-
[in] point - an ONVIF point in range [-1, 1]. [in] screenSize - a screen size in pixels (width and height).
- Returns
- screen point in pixels.
◆ OnvifToScreenSize()
Converts an ONVIF 2D-size to a screen 2D-size.
Detector uses this to convert Model::size to a pixel object size that sets the minimum motion-region area. Debug annotation of the model draws that minimum rectangle.
- Parameters
-
[in] size - an ONVIF size in range [0, 2]. [in] screenSize - a screen size in pixels (width and height).
- Returns
- screen size in pixels.
◆ ToString()
Converts an object ID to a string.
Typical usage draws ToString(object.id) above Object::rect with Simd::Font.
- Parameters
-
[in] id - an object ID (Object::id or Event::objectId).
- Returns
- decimal string representation of the ID.