PXR Family

Datasheet (PDF)

Manual & Guide

Application Notes

Driver Updates

Example Source Code

Compatible Image Processing Software

Product FAQ

All Frame Grabbers

Home Page


Feedback at:
CSinfo@cyberoptics.com or
1-800-366-9131

PXR_ROI - Region Of Interest Sample

Win32 Systems (Win98, Me, NT, 2000 and XP)

This sample shows you how to use the Region Of Interest (ROI) controls in the PXR800. Setting the ROI in an image is the same as cropping the image. The PXR800 gives you the ability to specify not only the size of the image but also the upper left hand corner. It lets you define the rectangular portion of the image you are interested in and then only DMA that much data to your buffer.

The ROI functions are:

GetROI()
SetROI()

You may have already noticed that SetROI() is used in all of the samples in the function ResetPXR() to set the initial Region Of Interest as follows:

// set the region of interest, ROI, to a default value
dwROILeft = 0;
dwROITop = 0;
dwROIWidth = dwImageX;
dwROIHeight = dwImageY;
PXR.SetROI(hFG,
    dwROILeft,
    dwROITop,
    dwROIWidth,
    dwROIHeight,
    IW_WAIT);

The values for dwROILeft and dwROIWidth must be divisible by 4.
The values for dwROITop and dwROIHeight must be divisible by 2.

In this sample you will learn how to do the following:

1. Create a simple control window.
2. Create a video display window.
3. Initialize the PXR frame grabber.
4. Grab frames and display them in realtime in the video display window.
5. Set the Region Of Interest (ROI) for the displayed frame.

In the PXR frame grabber samples, we have decided to use two windows (one for control and one for video display). We do this throughout the samples. We feel that two windows gives you more flexibility in designing controls although it does add some complexity.

This program uses one external modules that will be common to all of our samples for the PXR Series frame grabbers.
1. PXR_DISPLAY.C -- video display common code