LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary data into bitmap image

Solved!
Go to solution

I am using a Keyence camera for parts inspection.  After the inspection passes or fails, I want to display the image to the user.  The image data is a binary string in 8-bit grayscale bitmap format.  Is there a way to format the binary string into an actual image?

 

Thank you for your help.

Ron Deavers, CLD
0 Kudos
Message 1 of 19
(8,476 Views)

Hi programmindragon,

 

Where is the image data stored?  a file? a buffer?  I assume you are using LabVIEW, correct? NI Vision Development Module is for image processing, which will allow you to load an image from a file or from a camera (with the help of Vision Acquisition drivers) and display it on the front panel of a VI.  Actually you can display an image with only Vision Acquisition software. The Iamge Display is available on the front panel under Vision. I hope this helps!

 

Kristen H.

0 Kudos
Message 2 of 19
(8,434 Views)

Perhaps your camera has an SDK that have .dll's to output as jpeg?  Conceivably you could call the .dll from LabVIEW, then display the jpeg?

 

Bill

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 19
(8,424 Views)

Hi programmin...,

 

to throw in my 2cents:

 

If it's plain 8bit grayscale data you can display it with an intensity chart after conversion to a 2d u8 array...

Message Edited by GerdW on 08-13-2009 09:14 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 19
(8,422 Views)

If you already have a binary string you need to type cast it to an array of unsigned 8bit integers (U8). Next you need to know how many pixels per row and how many rows your image has got. Now reshape your 1 D array of U8 to 2D with the number of pixels per row and number of rows. Then you can wire the 2D array straight to an Intensity Graph which needs a black to white gray scale reaching from 0 to 255.

 

Alternatively you could use the Draw Flattened Pixmap VI and display the image with an picture indicator.

Message 5 of 19
(8,417 Views)

Jörn wrote:

If you already have a binary string you need to type cast it to an array of unsigned 8bit integers (U8). Next you need to know how many pixels per row and how many rows your image has got. Now reshape your 1 D array of U8 to 2D with the number of pixels per row and number of rows. Then you can wire the 2D array straight to an Intensity Graph which needs a black to white gray scale reaching from 0 to 255.

 

Alternatively you could use the Draw Flattened Pixmap VI and display the image with an picture indicator.


Nice!!!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 19
(8,404 Views)

I appreciate the help but I am still having issues.  I send the command to retrieve the image data from the camera.  I, then, get a response of the camera number, the status of good or bad, the image number, data length of the image data, then the image data.  I have attached a file of the image data only.

 

A few more tidbits of information.  I am using LabVIEW but do not have the Vision Module.  I am collecting this data over ethernet from the camera to my pc.

Message Edited by programmindragon on 08-17-2009 02:16 PM
Ron Deavers, CLD
0 Kudos
Message 7 of 19
(8,360 Views)

Does this image bear any resemblance to what you would expect to see?

 

ImageTest.png

Message 8 of 19
(8,347 Views)
Solution
Accepted by programmindragon

 Kristen H. wrote:

Actually you can display an image with only Vision Acquisition software. The Iamge Display is available on the front panel under Vision. I hope this helps!

 


Note quite true with Full Development System some picture functions are installed. But not for live pictures. I guess that is that you meant.

Anyway programmindragon. The file you sent is a bmp fileJust rename it. So you do have a picture you can show in labview. The function you are looking for is Read BMP File VI. Owning Palette: Graphics Formats VIs. I am sure you will find some info in help. Search for picture.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 9 of 19
(8,341 Views)
Thank you for your help.  It didn't cross my mind to just rename the file.
Ron Deavers, CLD
0 Kudos
Message 10 of 19
(8,321 Views)