Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision Assistants inadvertently convert images?

Hi guys,

 

there are some strange problems with my VIs using the vision assistants (vision and vision acquisition) I cannot wrap my head around:

 

1) I feed an 8-bit image (white blobs on black background) from a file into the Vision Assistant and do no processing at all, but just display it.

The result is this noise:

screenshot.PNG

 

2) I snap an image with the camera directly in Vision Acquisition Assistant and output it.

 

Although I explicitly select U8 as output, the output image I get is always 32-bit RGB . I don't know why that is?

I have attached the VI in question (Front Panel - Livebild_test.vi).

 

If you need anything else, just ask. Thank you!

 

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

I do know the acquisition routines automatically use the image format that comes from the camera.  If you are using a color camera, you will get a color image.  During acquisition, LabVIEW will automatically convert whatever image you give it to the format the camera outputs.

 

On some cameras, you can set the type of image it will output.  If you set the camera to output U8, then you will get a U8 image during acquisition.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 8
(4,495 Views)

Hi Bruce,

 

the camera in question is a monochrome camera, IDS UI 5490 RE M-GL.

 

The weird thing is:

When I input an 8-bit image from a file I get the noise as shown.

When I input a 24 or 32-bit image from a file, I get a 32-bit image.

 

Why? I have an IMAQ create VI before the Vision Assistant and the "image type" terminal where I can select U8/U16/RGB etc. has no effect at all.

0 Kudos
Message 3 of 8
(4,481 Views)

What does MAX think the camera is?  Does it show it as a U8 camera, or color camera?  Does everything work fine in MAX?

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 8
(4,477 Views)

Hi,

 

On the image display control you can rigt click>>Palette. There you can change the display type. This coud also be the reason for wierd images.

 

Kind regards

Heinz

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

@joptimus wrote:

Hi Bruce,

 

the camera in question is a monochrome camera, IDS UI 5490 RE M-GL.

 

The weird thing is:

When I input an 8-bit image from a file I get the noise as shown.

When I input a 24 or 32-bit image from a file, I get a 32-bit image.

 

Why? I have an IMAQ create VI before the Vision Assistant and the "image type" terminal where I can select U8/U16/RGB etc. has no effect at all.


That camera uses a proprietary GigE interface rather than the standard GigE Vision interface that IMAQdx supports. As a result, you are likely using IDS's drivers that provide a DirectShow interface.

 

DirectShow interfaces typically always sends a color image, even if the source material is monochrome. IMAQdx does support getting a monochrome image from a DirectShow camera if the interface exposes a pixel format of MEDIASUBTYPE_RGB1, MEDIASUBTYPE_RGB4, or MEDIASUBTYPE_RGB8, but I don't think the IDS cameras implement these formats.

0 Kudos
Message 6 of 8
(4,465 Views)

Thanks for the tip with the palette, that was the problem.

 

The 32-bit issue remains. In NI MAX I can select

  • video mode
  • pixel format
  • output image type

When I select mismatching video modes and output image type (e.g. 32-bit video and 8-bit output image), I get a decoder error.

But selecting 8-bit for both, gives me 8-bit images. It just doesn't work in LabView when running the VI.

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

I can't see the code you posted at the moment, but are you using settings from he camera file or setting these attributes in your code?

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