This topic contains the following sections.
Successfully configuring a line scan application can be extremely challenging. This topic provides an overview of the steps that you should follow to get line scan acquisition working in VisionPro, and it provides links to additional documentation and other resources that you can use.
Setting up a line scan application comprises three steps:
- Select the appropriate hardware.
- Select a video format for the camera connected to the frame grabber.
- Create an acquisition FIFO using the video format and frame grabber information.
- Start the acquisition by invoking the frame grabber object's Acquire or StartAcquire method.
- Complete the acquisition, if necessary, and get a CogImage8Grey object that represents the acquired image.
Most of the steps you use to set up a line scan acquisition are the same as those for setting up an acquisition from an area scan camera as described in Acquiring Images with a CCD Camera and Frame Grabber. This example also uses semi-automatic triggers. Your application may have different trigger requirements.
The Cognex MVS-8600 frame grabbers support line scan cameras.
To acquire line scan images using VisionPro, you must perform the following steps:
- Create an object reference to a frame grabber on your system.
- Select a video format for the camera connected to the frame grabber.
- Create an acquisition FIFO using the video format and frame grabber information.
- Start the acquisition by invoking the frame grabber object's Acquire or StartAcquire method.
- Complete the acquisition, if necessary, and get a CogImage8Grey object that represents the acquired image.
Before your application can acquire an image, you must specify what kind of frame grabber your system uses to digitize images. VisionPro defines a collection class, CogFrameGrabbers, that represents the frame grabbers installed on your system. The following statements create a collection of frame grabbers. It then declares an object variable that is set to the default frame grabber.
private CogFrameGrabbers myFrameGrabbers; myFrameGrabbers = new CogFrameGrabbers(); private ICogFrameGrabber myFrameGrabber; myFrameGrabber = myFrameGrabbers[0];
Use this frame grabber object in conjunction with a video format to create an acquisition FIFO.
Next you must select a video format, which describes the camera connected to your frame grabber and the size of the image to acquire. The video format is specified as a string, and must be one of those returned by the FrameGrabber object's AvailableVideoFormats method. This example code declares a video format:
const string VIDEO_FORMAT = "Basler L103 2048x2048";
To create a new acquisition FIFO using VisionPro, you use the FrameGrabber object's CreateAcqFifo method, passing in the video format you have selected and an CogAcqFifoPixelFormatConstants. The following code creates an acquisition FIFO suitable for acquiring grey-scale line scan images that are 2048 pixels wide by 2048 pixels high with a Basler L103 camera.
private ICogAcqFifo myAcqFifo; myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, Cognex.VisionPro.CogAcqFifoPixelFormatConstants.Format8Grey, 0, false);
Once you have created an acquisition FIFO, you can modify its properties (such as brightness and contrast). You can change acquisition FIFO properties at any time.
To create a new acquisition FIFO tool using VisionPro, you create an AcqFifoTool object and associate it with an AcqFifo edit control. You then set up the trigger and steps per line for the tool.
private CogAcqFifoTool myAcqFifoTool();
if (myAcqTool == null)
throw new CogAcqCannotCreateFifoException("Unable to create Acquisition Fifo");
myAcqFifoTool.Operator = myAcqFifo;Acquire an image and display it using a Cognex Display control:
AcqFifo.StartAcquire Set CogDisplay1.image = AcqFifo.CompleteAcquire(-1)
The VisionPro Samples directory contains a sample LineScan application.