04-08-2014 07:31 AM
Hi there! I'm having some issues with Labview IMAQ VI's. I'm using my webcam to get a 32-bit image, convert his into a U16-bit image, convert this into an array. The values of this array are being divided by the constant of a numeric control, so I can control the brightness. I then convert the image back to an array and display the image itself. However, that array is displaying 8-bit data! It has max values of around 253, not the several thousands you expect from a 16-bit image. The strange thing is, the display of the image says its input is, as a matter of fact Unsigned 16 bit data.
After discussing this with my peers we thought it might be because of the division function.
I use the division function to decrease the brightness. I deleted the division function but that didn't work either. Why does my array display 8-bit data when the image input is 16-bit?
I have attached my VI to this message so you can see for yourself. It contains an 'upper part' and a 'lower part'. The 'upper part' is what we are interested in. The 'lower part' is what I am currently developing and is not of interest for this particular problem (though, depending on what is going on here, it might have some consequences.
04-08-2014 08:15 AM
check the represntation of your output array (right click array indicator and go in representation option), it seems it is set on U8 or I8, i.e 8 bit.
04-08-2014 08:47 AM
It wasn't, so I changed it. But it still displays it the wrong way 😞
You can see it is on U16. When I want to display it however:
However, as you can see in my output array of the unfinished part, it manages to display values of the right order of magnitude. The numbers are wrong and I need to look into it, but at least they display the right order. I also tried setting it to 'adapt to source' but that just gives me the decimals of the numbers (changes it to 'double'), it doesn't give me the 16 bit numbers 😞
04-08-2014 09:16 AM
have you used the flatten image options vi , one more thing there seems a little conflict between U16 to double , try to make every calculation in U16 . you can use number conversion frm programming --> numbers , where you get decimal to double etc.
04-09-2014 04:01 AM
I tried the conversion to U16 but that didn't work out:
I tried putting a converter in front of the numeric control, but that didn't work either. I tried using a converter at the numeric control and after the division unit, but that didn't work too.
It is still displaying values at around 250, instead of the tens of thousands you might expect. I tried using the flatten image VI, but I don't know how that works.
The manual said 'Sets or gets the image compression options for flattening an image to string' about that VI. But how is that useful to me? I tried hooking it up to my data but I couldn't get it to work