LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

image byte order

Solved!
Go to solution

Hi, All,

 

I am acquiring images from Lumenera USB 2.0 camera (16-bit format). When I use the IMAQ "image to array" transformation I am getting all negative pixel values. I think the problem is related to the wrong byte order (big vs small Endian). Any idea how to fix this?

 

Thanks!

0 Kudos
Message 1 of 12
(3,859 Views)

Hi,

 

The negative pixels values are OK (thanks to NI for signed I16 type).

Read this KB article, probably its your case: 16-bit images in NI Vision

 

Andrey.

0 Kudos
Message 2 of 12
(3,854 Views)

Thanks for the reply, Andrey,

 

I am getting an I16 image, so there is no need to do U16 to I16 conversion as in the example you showed. BTW, in this example (bottom one) type cast is wired to an exclusive or - this won't work, right due to the mismatch?

0 Kudos
Message 3 of 12
(3,839 Views)
Solution
Accepted by topic author femtovahan

Andrey,

 

I went throuhg this again, you were right, this seems to be the problem. However, in thus processed image, the image histogram looks "digitized" like a collection of delta functions, instead of being a continuous function. Any ideas why would this happen?

 

Thanks !

0 Kudos
Message 4 of 12
(3,829 Views)

Hi,

 

It might be image (for example, your camera deliver intensities with gaps) or might be required number or classes (taps) too big.

Feel differences:

 

 

Also you can post your image here and we will try to calculate histogram together.

 

regards,

Andrey.

Message Edited by Andrey Dmitriev on 02-10-2009 08:44 AM
Download All
0 Kudos
Message 5 of 12
(3,809 Views)

I use histogram in 2 ways (histogram 1 and 2 on the pic). Numer of classes is 256 by default for 8-bit images. Images out of my camera are 16 bit. Now, it's a 16-bit camera with only 12 useful bits, so the number of classes should be 4096. I need to see the hist values all the way to 4096 to observe whether the camera is saturated or not - putting a smaller value for number of classses won't allow that. Do you agree? When I put large numbers for number of classes such as 4096, i do get the pattern with the gaps like in your right pic. 

0 Kudos
Message 6 of 12
(3,771 Views)

femtovahan wrote:

I use histogram in 2 ways (histogram 1 and 2 on the pic). Numer of classes is 256 by default for 8-bit images. Images out of my camera are 16 bit. Now, it's a 16-bit camera with only 12 useful bits, so the number of classes should be 4096. I need to see the hist values all the way to 4096 to observe whether the camera is saturated or not - putting a smaller value for number of classses won't allow that. Do you agree? When I put large numbers for number of classes such as 4096, i do get the pattern with the gaps like in your right pic. 


Are you sure you have an uniformly random noise image? Any real world image will not have a constant histogram over the whole range.

 

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 12
(3,761 Views)

rolfk wrote:

femtovahan wrote:

I use histogram in 2 ways (histogram 1 and 2 on the pic). Numer of classes is 256 by default for 8-bit images. Images out of my camera are 16 bit. Now, it's a 16-bit camera with only 12 useful bits, so the number of classes should be 4096. I need to see the hist values all the way to 4096 to observe whether the camera is saturated or not - putting a smaller value for number of classses won't allow that. Do you agree? When I put large numbers for number of classes such as 4096, i do get the pattern with the gaps like in your right pic. 


Are you sure you have an uniformly random noise image? Any real world image will not have a constant histogram over the whole range.

 

Rolf Kalbermatter


Rolf, do you mean the white noise? Why wouldn't the image have white noise? The histogram I am getting is not constant over the whole range, it rather has gaps, in other words, the histogram looks like a collection of delta functions.
0 Kudos
Message 8 of 12
(3,748 Views)

femtovahan wrote:
Rolf, do you mean the white noise? Why wouldn't the image have white noise? The histogram I am getting is not constant over the whole range, it rather has gaps, in other words, the histogram looks like a collection of delta functions.

Well why would it be white noise if it comes from your camera???

 

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 9 of 12
(3,732 Views)
OK, let me explain the problem I am having in a different way. In the absense of any signal (laser beam imaged onto the camera) I shall be simply acquiring the background (call it noise) from the camera. The histogram of this background should be peaked at zero. Instead, I am getting a "gapped" signal like a collection of delta functions.
0 Kudos
Message 10 of 12
(3,727 Views)