LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving bmp grey scale img from intensity graph issue: only brightest pixels saved

Hi,

I'm trying to save a grey scale image from an intensity graph, but I'm having issues. The pixels in the saved image are just the brightest ones and I don't understand where the mistake is.

 

Nidhogg_0-1648731549017.png

 

Nidhogg_1-1648731561266.png

 

 

Any tip would be very appreciated!

0 Kudos
Message 1 of 10
(2,234 Views)


Hi,

you can use the invoke node "get image" and "get image subset.vi" to capture a screenshot.

but this approach is limited to the resolution of the intensity plot as displayed on the frontpanel.

 

 

My Write BMP to file looks like this

Which version of LabView are you using?

 

Could you attach a .vi with some typical intensity plot data saved as default?

0 Kudos
Message 2 of 10
(2,215 Views)

Your scaling is incorrect. Add Min then Divide by Max-Min to normalize the array.  Multiply by 255 for an 8 bit depth.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 10
(2,212 Views)

Hi, this is the VI example. I had to use wetransfer as it's too big for the forum.
I don't want a screenshot, I need to save the full-res image.

I'm using LabView 2021.

https://wetransfer.com/downloads/6a5d0dfa9fa03e407b2d915697870a3820220331135809/d0515c4bb29bb8d0ca8d...

0 Kudos
Message 4 of 10
(2,209 Views)

Hi,

I tried the scaling as suggested, but the image is still dark 😕

 

Nidhogg_0-1648741262196.png

 

 

 

0 Kudos
Message 5 of 10
(2,191 Views)

OK, I see, the gradient is actually RBG not Grey scale and you are using the color bmp.

 

That means you need to take your scaled U8 array and use 3 join numbers to build a U32 array of 0, R G, B since all grey values have the same RGB elements.  (Black is 0,0,0. or 0x00000000 as a U32 and White is 255, 255, 255 or 0x00FFFFFF as U32)

 

The mnemonic is;

Roses are 00FF0000

Violets are 0000FF00

Grass is 000000FF

And that's your hue.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 10
(2,176 Views)

jay is right, you need to change your scaling ... the following appears to work..

alexderjuengere_0-1648749201980.png

Message 7 of 10
(2,170 Views)

Thank you very much guys! Now it saves them!

There is still a little issue: the tonality of the saved image is not the same of the image in the graph. It's much brighter. Is there a way to fit the pixel values in the graph min-max (z) scale values?

Now I put the block inside my main program, where the intensity graph is generated after a scansion started in another event case.

Nidhogg_1-1648751066006.png

 

Nidhogg_2-1648751080532.png

 

Saved image:

 

Nidhogg_3-1648751133535.png

 

I also need to understand why the bit depth of the image is so low. I wish there were more grey values in it, but it seems the grey levels are a few and very compressed in the histogram.

 

 

0 Kudos
Message 8 of 10
(2,162 Views)

@Nidhogg wrote:


There is still a little issue: the tonality of the saved image is not the same of the image in the graph. It's much brighter.

 


For your example attached, i can't confirm your claim. both the 2d array and the colortables are identical.

 

alexderjuengere_0-1648810664446.png

 

alexderjuengere_1-1648810810364.png

 

the Minimum and Maximum might change from image to image.

Therefore you should set a global maximum and minimum, estimated from various images

 

 

Message 9 of 10
(2,120 Views)

Hi!

Thanks everyone for the help.

I finally fixed it, by introducing a compensation for min and max values 🙂

Now it works  good!

0 Kudos
Message 10 of 10
(2,108 Views)