The MontiVision Image Grabber filter is used to take snapshots of the video stream that is processed. It supports the output of the following file formats: Bitmap (*.bmp), JPEG (*.jpg), TIFF (*.tif), TARGA (*.tga) and PNG (*.png). The snapshot functionality is implemented using the IMVTrigger interface. A video frame is saved as single image file on every trigger event. The names of the output files can be defined using filename templates (see below how to use templates). It is possible to capture a region of the video frame instead of capturing the whole frame. Also, the output image may be resized before it is written to disc.
| File: | grabber.ax |
| CLSID: | CLSID_MVGrabber |
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. |
| MV_IMAGE_CAPTURE_START_EVENT |
2 |
Image capture started. |
| MV_IMAGE_CAPTURE_END_EVENT |
3 |
Image capture to disc or memory finished. |
Supported I/O Pins
| I/O Pin | Corresponding method | Discription |
|
Filename [String] |
IMVImageCapture::put_FixedFileName | Sets the file name for the next image to be captured, if the filter doesn't use templates to create the file names. |
| Trigger [Boolean] |
IMVTrigger::Trigger | Starts the capture of a snapshot, depending
on the trigger mode. Example: If the trigger mode is MV_TRIGGER_RISING_EDGE, a snapshot is taken after the the Control I/O pin changes its state from FALSE to TRUE. |
Attention:
I/O Pins are dominat, what means that they have a higher
priority than the corresponding method of the filters
interface!
MV Image Grabber Property Pages

MV Image Grabber property page
This property page displays the image data and the filename of the last captured image. The trigger button activates the grabber to capture the next processed frame. It uses the IMVTrigger and the IMVImageInfo interface.

MV Image Grabber output file property page
This property page is used to specify name, path and format of the images to be captured. It uses the IMVImageCapture interface.
| Use filename | If this radio button is selected, the files are named using the text of the edit box on the right of the button. The name is extended by a counter that is incremented for every captured image. |
| Auto Counter | Adds an automatic counter to the file name so the previously captured image isn't overwritten. |
| Use templates | If this radio button is selected, the files are named using the template file that is specified by the edit box on the right of the button. See below how templates are used to create filenames. |
| Output folder | Used to specify the filters output folder. The captured image files are written here. |
| File format | Used to specify the file format that is used to write the captured images to the output folder. |

MV Image Grabber capture region property page
This property page provides region of interest functionality. It is possible to capture a region of the video frame and resize it to a desired output size before it is written to disc. It uses the IMVImageCapture2 interface.
| Origin | Used to specify the horizontal and vertical offset to the ractangle that is to be captured. |
| Dimension | Used to specify the width and the height of the rectangle that is to be captured. |
| Output image dimension | The captured image may be resized before it is written to disc. Those settings specify the dimension of the resized image. |
| Interpolation | Interpolation used for resizing. |
Template files
The filter uses template files to create the output files names. The template file is a simple text file using the following syntax:
| Text | Output as it is. |
| Variable | %Variable Name% |
| % | %% |
Template variables
The following table shows all fixed variables for template files.
| YEAR | 4 digit year, e.g. 2003. |
| SHORT_YEAR | 2 digit year, e.g. 03 |
| MONTH | 2 digit month, e.g 01 |
| MONTH_NAME | Name of the month, e.g. January. |
| DAY | 2 ditit day, e.g 29. |
| DAY_NAME | Weekname of the day, e.g. Monday. |
| WEEK | 2 digt week number, e.g. 45. |
| HOUR | 2 digit hour, e.g. 17. |
| MINUTE | 2 digit minute, e.g. 54. |
| SECOND | 2 digit second, e.g. 32. |
| FILE_COUNT | Counter for the files created by the filter. |
Examples:
1. Using templates to create output filenames
The output folder "C:\Images\" is specified, the JPEG format is selected and the specified template file "C:\Templates\output_filename.txt" contains the following text:
%YEAR%-%MONTH%-%DAY%_File_%FILE_COUNT%
The captured image files are saved as:
c:\images\2003-02-15_File_000001.jpg
c:\images\2003-02-15_File_000002.jpg
c:\images\2003-02-15_File_000003.jpg
...
2. Taking snapshots of a rotated image: