LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Encrypting an image

Solved!
Go to solution

in Matlab i used an alogrithm to produce a key stream of bytes which i used to encrypt images, matlab opened images as an array of bytes for greyscaled and in case of color as 3 arrays of bytes , one for red , others for green and blue .
How can i get those 3 arrays in Labview ? any example ? Thanks

0 Kudos
Message 1 of 6
(2,723 Views)

Ignoring IMAQ and the vision toolkit, which are an entirely different story, LV has several formats for representing images, and I think the one you will find relevant is the flattened pixmap. This is a cluster which, for 24 bit images, has a 1D U8 array which holds all the values. I don't remember the exact order, but I think it's R,G,B,R,G,B,R,G,B...

 

The easiest way to separate it would be to take that cluster, unbundle the image array from it and wire it into a Decimate 1D Array function, resized to 3 outputs, which will output every third element in each terminal.

 

There are also other ways to get the data from the various formats LV lets you convert images to, but you should probably start with one.

 

I would suggest you open the example finder (Help>>Find Examples) and look at all the examples for the picture control VIs. They should show how to work with pictures and images.


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(2,686 Views)

But i have IMAQ and vision module , would that make job easier ?

0 Kudos
Message 3 of 6
(2,648 Views)
Solution
Accepted by topic author TheTrice

Found what i am looking for in Image to array example.

0 Kudos
Message 4 of 6
(2,645 Views)

the problem with image toarray example that it only converts greyscaled pictures to 2dmap , is there another function that will accept a rgb image and produce 3 2d arrays(each for red,green and blue) ?

0 Kudos
Message 5 of 6
(2,634 Views)

I'm sure that the vision module has some VIs for that, although I have no idea what they are. You can look through the palettes.

 

If you're asking about the picture control VIs, then you can use the Draw Unflattened Pixmap VI to get the picture as a 2D U32 array, then use Split Number three times to get four 2D U8 arrays (one of which you ignore, so you only have three).


___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(2,625 Views)