11-26-2013 02:39 PM
Hello everyone,
I've made a VI where I load a BMP-file of 1024x1024. The BMP is generated by another VI who's getting a frame of a videostream of my webcam. The frame image then gets grayscaled for further processing. My final goal is to make a facerecognition in LV.
So when I load the grayscaled image I get nothing but if I use the 512x512 version then I am able to scale without any problem.
I think it a kind of an overflow problem but I am unable to solve it..
Thanks in advance
Solved! Go to Solution.
11-26-2013 03:14 PM
The 512x512 image has a color depth of 8 bits but the 1024x1024 image has a color depth of 24 bits. You only get 8 bit data from Unflatten Pixmap.vi, which will have no data for a 24 bit image. You should look at the image depth then use the appropriate output from the VI.
11-26-2013 04:48 PM
Thanks for the quick reply.
I have no idea how I missed that but unfortunately when I try to scale I get a scaled window but with just a filled blue color?
Of course I could convert it to 8bit and everything would be fine but I just want to know why it didn't solve my problem?
11-26-2013 05:51 PM
24 bit picture data is an ara of U32. If you change the input to the Initialize Array function to be a U32 instead of a U8 it will work as long as you detect the image depth and use the correct input to Flatten Pixmap.vi.
I've attached a version that seems to work.
11-27-2013 08:52 AM
Thank you very much for the help!
It's those little details in LV that I still have to grasp.
Sincerely yours
11-27-2013 10:00 AM
If you look at the way the image data is written you'll understand why you got a blue square. Even though the array data type is 4 bytes (32 bits, U32) the data is actually 3 bytes (24 bits) for each pixel. The MSB is the red value, next is the green value, and the LSB is the blue value. Since you were using an array of U8 LabVIEW coerced all data to U8 which made most, if not all, pixels 255. Any pixel that had a red or green component ended up solid blue.