08-12-2009 05:25 PM
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.
Solved! Go to Solution.
08-13-2009 01:38 PM
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.
08-13-2009 02:06 PM
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
08-13-2009 02:14 PM - edited 08-13-2009 02:14 PM
08-13-2009 02:19 PM
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.
08-13-2009 05:39 PM
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!!!
08-17-2009 04:11 PM - edited 08-17-2009 04:16 PM
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.
08-17-2009 04:41 PM
Does this image bear any resemblance to what you would expect to see?
08-17-2009 04:51 PM
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 file. Just 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.
08-17-2009 06:12 PM