Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

reversed image

Hello,

 

Please I m using this code to acquire image. the problem is that I get sometimes the image reversed (180°).

 

Can you examine the code CVI and tell me where is the problem:

 

 

error_IMAQ = IMAQdxOpenCamera (CamName, IMAQdxCameraControlModeController, &IMAQdx_Session);

error_IMAQ = IMAQdxSetAttribute (IMAQdx_Session, IMAQdxAttributeVideoMode, IMAQdxValueTypeU32, 4);

pl_Image = imaqCreateImage (IMAQ_IMAGE_RGB, 0);

error_IMAQ = IMAQdxConfigureAcquisition (IMAQdx_Session, FALSE, 1);
error_IMAQ = IMAQdxStartAcquisition (IMAQdx_Session);
error_IMAQ = IMAQdxGetImage (IMAQdx_Session, pl_Image, IMAQdxBufferNumberModeBufferNumber, 0, &bufferNumber);

 

 

Thank you

 

0 Kudos
Message 1 of 8
(4,088 Views)

It seems ther's no error in your code.

What kind of camera are you using?

Maybe there's a rotation parameter in your camera attributes you should check.

Regards

NTA_LabView_certified_Developper.jpg
0 Kudos
Message 2 of 8
(4,085 Views)
camera IDS UI-1245NE-C-HQ
0 Kudos
Message 3 of 8
(4,076 Views)

Hi Sadok,

 

Do you mean the image is rotated 180 degrees, or reversed? Do you have any of the camera interface software from IDS installed on your computer? Sometimes the drivers and software from the manufacturer will interfere with IMAQdx.

 

Regards,

Daniel H. 

Daniel Hays | Test Software Business Manager
0 Kudos
Message 4 of 8
(4,055 Views)

Hi,

thank you for your reply

 

I mean the image is rotated 180 degrees

Sure I have the IDS driver of the camera installed.

How to solve this problem.

0 Kudos
Message 5 of 8
(4,049 Views)

Hi Sadok,

 

We'll need to try to narrow down exactly what is causing your problem, and then once we know that we can find a good solution for you.

 

I'm having a hard time finding information about the camera you listed. I've been on the IDS website, and this camera seems to have a similar part number. For this camera it looks like IDS has two install packages: a "driver-only" install and a larger "software package." Do you have the drivers and the other software installed, or just the drivers?

 

If you have the other software installed (or any other software that you can use to acquire images from the camera) can you please see if you get the same image-rotation problem in that software? And how often do you get the rotated images with your CVI code?

 

Regards,


Daniel H.

Daniel Hays | Test Software Business Manager
0 Kudos
Message 6 of 8
(4,043 Views)

Do the rotations happen randomly mid-stream, or is it the whole stream that is randomly rotated?

0 Kudos
Message 7 of 8
(4,038 Views)

That camera is using DirectShow to interface with IMAQdx. DirectShow normally follows the legacy Windows scheme where bitmap images are returned bottom-up, rather than top-down. I assume this camera is returning the image top-down as an optimization (since that is the way most image processing applications, including IMAQdx, natively want to process the image as). However, this causes problems when applications are expecting it in the standard layout. You could either find the option in their driver to change it to match the DirectShow formatting, or you could use the "VerticalMirror" attribute inside IMAQdx to tell our driver that the image is flipped. If you go into MAX you can change this setting and save it as the defaults in the camera file.

 

Eric

0 Kudos
Message 8 of 8
(4,028 Views)