02-09-2009 12:30 PM
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!
Solved! Go to Solution.
02-09-2009 12:45 PM
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.
02-09-2009 02:10 PM
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?
02-09-2009 03:45 PM
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 !
02-10-2009 01:43 AM - edited 02-10-2009 01:44 AM
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.
02-10-2009 09:06 PM
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.
02-11-2009 03:10 AM
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
02-11-2009 10:59 AM
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.
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
02-11-2009 12:40 PM
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
02-11-2009 12:49 PM