Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I conduct image processing using 'LLGrabDlg.cpp' ?

Hello,

I want to do image processing with LLGrabDlg.cpp in the following folder.
(c:\Users\Public\Documents\National Instruments\NI-IMAQdx\Examples\MSVC\Low-Level Grab\LLGrabDlg.cpp).

Without labview, I succeeeded to conduct image processing using 'hlgrab.c' several years ago.

For example, threshold algorithm can be expressed as follows:

for (j=0:j<rows;j++){
for (i=0:i<cols;i++){
if (ImaqBuffer[j*640+i] >= threshold){
ImaqBuffer[j*640+i]=255;
if (ImaqBuffer[j*640+i] < threshold){
ImaqBuffer[j*640+i]=0;
}
}

Recently I grabbed the images using Digital type 8233 framegrabber and GigE camera.

And I found the following sentences in niimaqdx.h.
==> typedef struct Image_struct Image;

And I also found the following sentences in LLGrabDlg.h.
Image* image;

However, it is very hard to find out the exact type of image_struct, so I cannot conduct image processing with 8233 framegrabber.

How can I convert image pointer to conduct image processing?

Is there anyone to help me? It is very important for me.
0 Kudos
Message 1 of 2
(4,286 Views)

The Image struct is intentionally left opaque in the Vision library since its implementation is subject to change. If you look at "nivision.h" you'll see the following useful function:

 

typedef struct ImageInfo_struct {
    CalibrationUnit imageUnit; //If you set calibration information with imaqSetSimpleCalibrationInfo(), imageUnit is the calibration unit.
    float stepX; //If you set calibration information with imaqSetCalibrationInfo(), stepX is the distance in the calibration unit between two pixels in the x direction.
    float stepY; //If you set calibration information with imaqSetCalibrationInfo(), stepY is the distance in the calibration unit between two pixels in the y direction.
    ImageType imageType; //The type of the image.
    int xRes; //The number of columns in the image.
    int yRes; //The number of rows in the image.
    int xOffset; //If you set mask offset information with imaqSetMaskOffset(), xOffset is the offset of the     mask origin in the x direction.
    int yOffset; //If you set mask offset information with imaqSetMaskOffset(), yOffset is the offset of the     mask origin in the y direction.
    int border; //The number of border pixels around the image.
    int pixelsPerLine; //The number of pixels stored for each line of the image.
    void* reserved0; //This element is reserved.
    void* reserved1; //This element is reserved.
    void* imageStart; //A pointer to pixel (0,0).
} ImageInfo;

 

IMAQ_FUNC int    IMAQ_STDCALL imaqGetImageInfo(const Image* image, ImageInfo* info);

 

 

0 Kudos
Message 2 of 2
(4,271 Views)