Create a DirectShow Filter Graph
using the MontiVision Workbench
The quickest way to create a filter graph is to use the filter
graph wizard function from the MontiVision Workbench.
Create a filter graph from the scratch
The MontiVision Workbench starts with
an empty project. The first step for creating a filter graph is to
select a video source filter and insert it into the
graph.
You can now insert a transform
filter from the "Transform Filter" category. You will find the
MontiVision Imaging Filter in the "Image Processing" subcategory.
.
The next step is to connect the
filters. You must connect all of the filters from the
source filter to the renderer filter, the source filter sets the
media type and parameters for the connection. You must delete all
connections if you ever change the the source filter or the
parameters and then reconnect the filters. To show the result of
the imaging process you can insert a video renderer from the
"Renderer" category or you can use the Render Pin command. The
Render Pin command automatically connects the filter graph to a
renderer filter. Now you can start the graph. The application opens
a new window which displays the result of the image processing.
Sometimes it is necessary to display the raw image as
well. To do this, you have to duplicate the video stream after the
source filter. The MV Image File Source filter in the example
always adds makes a new output pin available if the last free pin
was connected. All pins of this filter have the same
output. Other source filters do not expose this ability, in which
case you will have to insert a tee filter.
To do this, stop the filter graph and insert the
Infinite Pin Tee filter. You can find the Infinite Pin Tee filter
in the General filter bar in the transform category, subcategory
Tee Filter. Remove the connection between the source filter and the
first transform filter. Connect the source filter with the input
pin from the tee filter. Connect the output pin from the tee filter
with the input pin from the transform filter. The last step is to
render the new output pin from the tee filter. Start the graph
again and a new video window with the original image appears.
If your graph is now complete, you can
configure the filter. To do this, select the properties of the filter.
After setting the filter properties, save
the filter graph with the Save command. The next step is
to create additional filters to further extend the imaging
system.
|