LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pixel array to image

Hello,

I'm producing a pixel array with a detector and I'd like to convert it in an image. I don't have 'vision development' .. Any help or example would be very useful!

 

Thanks!

 

ps- the image is in a gray scale.

0 Kudos
Message 1 of 7
(7,300 Views)

Look at the picture functions in the Graphics & Sound palette.

0 Kudos
Message 2 of 7
(7,297 Views)

I did this (see attachment) .. Not sure if the matrix that I'm producing is right for it.Going to check in a bit. Any improvement at first glance?

0 Kudos
Message 3 of 7
(7,293 Views)

It looks pretty good to start with.  You'll have to try it out to see how well it works.  I'm not 100% sure about the Flatten to Pixmap VI.  You have an array of doubles going to the 24-bit input.  The 24-bit input takes a U32 (4 bytes).  Three of the bytes represent the red, green, and blue values of the pixel color.  Your double may not map correctly to that U32.  You may need to do some math on your value.  Scale it from 0 to 255, then put that into the RGB to color function to feed to the Flatten Pixmap.  Or just drop all of that and build your colors up into a cluster that represents the image data going to the next function.  (Bundle the array, set the other elements in the cluster appropriately.)

0 Kudos
Message 4 of 7
(7,285 Views)

Greyscale is easy, use the color array like RF suggested:

 

DBLArrayToGreyscaleFP.png

 

 

DBLArrayToGreyscale.png

 

And for a color image I am usually lazy and let the intensity graph do the work (Property nodes ensure that the color table is up to date).

 

DBLArrayToPictureFP.png

 

DBLArrayToPicture.png

 

Message 5 of 7
(7,275 Views)

Hey Darin,

 

nice post/example, thank very you much.

 

One question: where do i get the greyscale color array from? Do i have to it myself or is there somewhere a default greyscale color array? (the 1D array you titled Greyscale)

 

 

0 Kudos
Message 6 of 7
(6,037 Views)

He posted the code that contains the array.  Just use the snippet and you'll have the code including the greyscale array.  He probably programatically made it.

0 Kudos
Message 7 of 7
(6,027 Views)