The MontiVision Advanced Optical Flow filter is used to detect and visualise optical flow withhin a video stream. The filter uses an advanced feature tracking algorithm instead of the simple block matching algorithm used in the MV Optical Flow filter. The Motion I/O output pin signals if one or more of the feature points in the image move a pixel distance that is higher than the threshold. For example you can control the MV Recording filter to record a video stream only if there is motion within a scene. The Direction I/O output pin outputs the global direction of the motion vectors in degrees (0 to 360). The Magnification I/O output pin outputs the global magnification of the motion vectors. These pins are useful to determine direction and speed of a single moving object.
You can access the X and Y positions of the feature points directly through the IMVAdvanceOpticalFlow2 interface.
| File: | AdvancedOpticalFlow.ax |
| CLSID: | CLSID_MVAdvancedOpticalFlow |
Supported Interfaces
Supported COM Events
The filter supports following events through the IMVFilterEvents interface. Look at the filter events page for more information.
| Event |
Value |
Description |
| MV_ALGORITHM_START_EVENT |
0 |
A filter starts processing a video frame or sample. |
| MV_ALGORITHM_END_EVENT |
1 |
A filter finishes processing a video frame or sample. |
Supported I/O Pins
| I/O Pin | Corresponding method | Discription |
|
Motion Out |
IMVAdvancedOpticalFlow::GetMotion | Returns the currently state of the motion detection flag. The flag is TRUE, if one or more motion vectors are higher than the defined threshold. |
|
Direction |
IMVAdvancedOpticalFlow::GetMotionDirection | Returns the global direction of the motion vectors in degrees. |
|
Magnification[Double, Int16] |
IMVAdvancedOpticalFlow::GetMotionMagnitude | Returns the global magnification of the motion vectors. |
| X Position [Int16] |
IMVAdvancedOpticalFlow::GetMotionXPosition | Returns the average horizontal position of the motion. |
| Y Position [Int16] |
IMVAdvancedOpticalFlow::GetMotionYPosition | Returns the average vertical position of the motion. |
MV Advanced Optical Flow Property Page
Uses the IMVAdvanceOpticalFlow interface to setup the filter.
| Draw optical flow onto video. | Draws motion vectors onto the video stream. The start point of the vector is the position of the feature point in the former image and the end of the vector is the position of the feature point in the current image. |
| Automatically select new feature points after X frames. |
If this mode is enabled, new feature points used for tracking
are automatically selected after a defined number of processed
frames. |
| Minimum distance between two feature points. | Minum distance between two feature points in pixel to avoid a large number of feature points selected within a small neighbourhood. |
| Feature point quality. |
0.01 - A lot of feature points with poor quality are
accepted |
| Motion Threshold | Threshold used for motion detection. If one feature point moved more than this threshold in pixel, the motion detection flag is set to TRUE, otherwise FALSE. |