LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bitmap image

Hi everybody,

Could you please show me how to read in a colored bitmap image
then convert it to 8-bit gray scale bitmap image in LV?


Thank you.

Lee
0 Kudos
Message 1 of 6
(3,779 Views)
> Could you please show me how to read in a colored bitmap image
> then convert it to 8-bit gray scale bitmap image in LV?
>

You don't mention what version of LV you are using, but for years
now there have been icons available that will read BMPs and a few
other file formats. Once you have the data in, you can display it
in either an intensity graph or in a picture control. Displaying
a color image as gray scale requires a little bit of computation.

If the image is indexed, has a color table, then only the color
table needs to be changed. If its a true color image, then each
pixel value needs to be changed. What you want to do is take each
color, and compute a gray scale value for it. The simplest is to
average the Red, Green, and Blue values in the color
so that they
map to a gray value between 0 for black to 255 for white. Because
the human eye is more influenced by green, it tends to look better
if you don't average them evenly, but rather scale it so that green
is 40%, red is 35%, and blue is 25%.

Averaging the color usually means taking an int32 and splitting it
into four bytes using either the Split functions that are located
in advanced I think, or using some division or shifting and Int/
Remainder division.

This really isn't that complicated once you get into it. Another
option is to look on the info-labview archives to see if someone
has already submitted a VI to do this. Also, the IMAQ vision
add-on most likely has VIs for this and much much more.

Greg McKaskle
Message 2 of 6
(3,778 Views)
Hello Experts.. Would U spent some time for me..  I got a Problem

First of all Sorry to directly writing my problem in another thread....

I have a spreadsheet data which has 286*516 Pixels data. Data is 16bit (from which only 12bit is usefull). Each data is a Level of a Pixel. I want to Display Grayscale Image.

I have used 3D Graph to display it and projection XY selected . I am getting My image as grayscale Image but somewhat slow display if I continously run it.

Second Method I tried is Directly "some 2D Graph" ( Sorry I forgot the Name.. I will get it next time) which directly display that 16 bit spreadsheet file. But it has only 255 levels so it didn't utilized my data and resolution is poor.

My doubts are..

1. Is 3D graph method I am using is Actually displaying my 16 bit image.
2. In 3D graph method : Because of that 12 bit format of my data and I had to convert it in 16 bit I am loosing any levels or       
    Resolution ?
3. Is there any way of increasing 255 level to 16bit level 2D Graph method.
4. Is there any method that can display my 16bit information as a image utilizing all my levels.

Please Do me a favor .. thank you
0 Kudos
Message 3 of 6
(3,457 Views)


CYBORG wrote:
Hello Experts.. Would U spent some time for me..  I got a Problem
My doubts are..

1. Is 3D graph method I am using is Actually displaying my 16 bit image.

Actually, MS Windows only support 8 bit gray scale.  No matter what programming language you use.


2. In 3D graph method : Because of that 12 bit format of my data and I had to convert it in 16 bit I am loosing any levels or       
    Resolution ?

No.


3. Is there any way of increasing 255 level to 16bit level 2D Graph method.
4. Is there any method that can display my 16bit information as a image utilizing all my levels.

There are 2 ways:

1. Convert to 8 bit gray scale (256 gray levels).  Loose the least significant 4 bits.

2. Display only part of the gray scale each time, e.g. the top 256 gray levels.


George Zou

http://gtoolbox.yeah.net


 

George Zou
Message 4 of 6
(3,442 Views)
Thanks Zou,

I got It clear... Thanks again.

THen also I will confirm again....

I have 12 bit data in the 16 bit format (Coz there is no other way to have it in 12bit). And I can not display it using all 12 bit level in window platform because it only spports 255 levels (8 bits).

Is there so ?

If yes then I got a problem... I have a satellite image raw data and I want to have it displayed with all the details I can..

There is no other way ?
0 Kudos
Message 5 of 6
(3,402 Views)


CYBORG wrote:
Thanks Zou,

I got It clear... Thanks again.

THen also I will confirm again....

I have 12 bit data in the 16 bit format (Coz there is no other way to have it in 12bit). And I can not display it using all 12 bit level in window platform because it only spports 255 levels (8 bits).

Is there so ?

That's right.  You can not display 12 bit level on Windows platform.

If yes then I got a problem... I have a satellite image raw data and I want to have it displayed with all the details I can..

There is no other way ?

No.

 

8 bit is enough for human eye.

Even if you can display 12 bit, your eye can't tell the difference.

So no one will make the hardware or software to display 12/16 gray scale images.

 

George Zou

http://gtoolbox.yeah.net

Message Edited by zou on 08-16-2007 01:00 PM

George Zou
Message 6 of 6
(3,371 Views)