Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Using CVI and IMAQ, I use imaqDisplayImage and the image is out of sync, it displays the second half of the image as the front half and visa versa

Below is a striped version of my code. The card is the 1409 and I am using a Hitachi RS-170 camera

imaqSetupWindow (IMAGE_WINDOW_0_CONST, IMAQ_WIND_TITLEBAR + IMAQ_WIND_TOPMOST);
imaqSetWindowSize (IMAGE_WINDOW_0_CONST, IMAGE_WINDOW_X_SIZE_CONST, IMAGE_WINDOW_Y_SIZE_CONST);
imaqSetWindowPalette (IMAGE_WINDOW_0_CONST, control_val, NULL, 0);
imaqShowWindow (IMAGE_WINDOW_0_CONST, TRUE_CONST);
Position.x = IMAGE_WINDOW_X_POS_CONST;
Position.y = IMAGE_WINDOW_Y_POS_CONST;
imaqMoveWindow (IMAGE_WINDOW_0_CONST, Position);

// Open a session
err = imgInterfaceOpen ("img0",&Interface_ID);
err = imgSessionOpen (Interface_ID,
&Session_ID);

imaqSetupGrab(Session_ID, IMAQ_NO_RECT);
newimage = imaqCreateImage(IMAQ_IMAGE_I16, 0);

LOOP
imaqGrab(Session_ID, imagein, FALSE_CONST);
ret_val = imaqDuplicate (imageout, imagein);
imaqDisplayImage(imageout, IMAGE_WINDOW_0_CONST, FALSE_CONST);
ENDLOOP
0 Kudos
Message 1 of 2
(3,566 Views)
Hello Tzaj,

Make sure that you can grab the image in MAX correctly before you try grapping images in CVI. Then, see the example program on our Developer Zone (link below):

http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/e6f87111578c409786256878007333ee?OpenDocument

Hope this helps.

Regards,

Morten Jensen
National Instruments
0 Kudos
Message 2 of 2
(3,566 Views)