Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Could not find Image_struct definition

Hi,

I want to use an "Image_struct" definition in C++ but could not find the definition of Image_struct.

I want to use internal data members of this struct for some processing.

Where i can find the definition of this struct?

Or how to use "Image_struct" in C/C++?

 

Regards,

Bhausaheb

0 Kudos
Message 1 of 4
(2,523 Views)

By design, it is an opaque type. The internals often change and do not necessarily retain any binary compatibility. For that reason, the internal structure is not defined.

 

Eric

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

I found that the "ImageInfo_struct " defined in vision.h and the "Image_struct" uses the name of the image(string) and  "ImageInfo_struct ".

Using this the  "Image_struct" would be as below.

 

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;

 

typedef struct
{
char *name;
ImageInfo *imageinfo; //ImageInfo_struct 
} Image_struct;

 

I used this in C++ code and i could read the image parameters and pixels correctly.

 

 

0 Kudos
Message 3 of 4
(2,470 Views)

@bhau04 wrote:

I found that the "ImageInfo_struct " defined in vision.h and the "Image_struct" uses the name of the image(string) and  "ImageInfo_struct ".

 

.... 

I used this in C++ code and i could read the image parameters and pixels correctly.


The internals of Image_struct are subject to change and this code is highly likely to break in the future. If what you want is the information in the ImageInfo structure, simply call imaqGetImageInfo() to retrieve it in a safe manner.

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