1.To use image recognition first follow installation steps to make sure that all of the components are installed.
2.Choose the camera/optical system to be used. Make sure the camera can take clear and focused images of the system under test. Make sure that camera and system under test are rigidly attached to the test bench or relative to each other.
3.Create an MxVDev project and set up TestCases and Scenarios. Test that they put the system in the desired visual state.
4.At this point, default image directories should be set up.
5.Set up and configure the camera and add the camera transform that controls the camera to the Harness in MxTransIt. See Camera Transforms.
6.Set up a scenario in MxVDev to capture a full image. Anytime the camera is moved, a new full image is required.
7.Configure Image Recognition in MxTransIt to test desired visual state. Now a new signal can be added to the test.
8.Repeat steps 6 and 7 to configure all desired Image Recognition signals.
Currently MxVision is compatible with USB webcam style cameras (DirectShow compatible) and GigE Vision cameras. The choice of the camera depends on the system under test, and performance requirements. Webcams are affordable but usually offer slow acquisition rate and limited configurable image parameters. GigE Vision cameras offer gigabit Ethernet connectivity for fast acquisition of large amount of data. The image of the system under test should be clear, focused, and well defined. Small features should be magnified by placing camera closer to the object or through use of lenses.
The Project directory includes folders and files used by MxVDev. To ensure that relative paths are stored correctly, everything associated with the project should be located in the project directory. (In the example below, "MxVDev Test" is the project directory.) Images for Image Recognition should be placed under the RecoImages sub-directory. This is the folder where images taken by the camera are saved by default.
Inside RecoImages, create a folder for every signal that image recognition is to be used for. This will be the signal Base Directory. Other images and sub-directories associated with this signal are placed here. Each signal needs at least one full-scale image (un-cropped image that is taken by the camera), and it should be placed under "FULL_IMAGE" directory.
When Image recognition signal is configured, additional directories are created and placed under the Base Directory. The SAMPLES directory holds 'Sample' images; these are 'full' images that have been cropped to the size of the Region of Interest for the specific signal. The PATTERNS directory holds 'pattern' images; actual templates that are used for pattern matching and color recognition.
A full image is the entire image captured by the camera before the ROI is specified.
1.Select a Scenario/Test case that puts the system in the state that needs to be tested.
2.Add the SaveImage signal to the TestCase. This signal commands the camera to save an image to a file when a transition occurs during the execution of the test.
3.Pick the time in the TestCase when the image needs to be saved, double-click to create a transition and enter the file name for the image. Currently all images are saved as bitmaps (*.bmp) and are saved relative to 'RecoImages' folder.
Transition Editor for SaveImage Signal
4.Run the scenario once, and an image or images are saved under the RecoImages folder. Now these images can be put into the FULL_IMAGE directory to set up image recognition Signal.
5.After the images are captured the SaveImage Signal can be removed from the TestCase.
Alternately, the first full image can be captured using the camera utility if the system is put in the desired state. Remember to save the image as a bitmap (*.bmp). This may be desirable if you need to change the camera's parameters in order to create an acceptable full image.