LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read compressed image in labview

Dear Members,

 

I'am implementing image transmission using USRP interfaced with Labview. in the transmitter I compress the image and I transmit the content of the binary file which result from the image compression. In the receiver, I received the content of the binary file. my question is how to read and display the compressed image again in the receiver?  

0 Kudos
Message 1 of 9
(2,655 Views)

You decompress it and convert it back to an image ...

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 9
(2,633 Views)

this is my problem, how I will decompress it. in the transmitter I compressed it using imwrite command. but I dont know how I will decompress it in the receiver

0 Kudos
Message 3 of 9
(2,605 Views)

Well _how_ do you compress it? A normal zip? Some custom code? Since we know nothing about how you compress it only you can answer how to uncompress it. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 9
(2,600 Views)

What is "an image"? A jpg or png file? They are already compressed.

 

Do you want to display them on screen or save them to file?

 

To transfer them using an USRP you probably also need to encode them in some way, after optional compressing, and decode them before decompressing.

 

How to encode is really up to you. There are tons of ways to do that...

0 Kudos
Message 5 of 9
(2,586 Views)

It might be easiest to write the contents of that compressed binary stream to disk with the appropriate name and then use the appropriate function in LabVIEW (eg Read JPEG File) to read and display it in a Picture control. LabVIEW does not have built-in functions for decompressing the image in-memory.

0 Kudos
Message 6 of 9
(2,552 Views)

thank you for your answer..

Actually I tried it but still not working with me ..my received array is uint8 4101x1..how to save it as binary file then read it.when I tried to write this file, it keeps give me loop because the usrp always receiving.. I think its not practical for every image transmission..

Do you have any idea?  

0 Kudos
Message 7 of 9
(2,545 Views)

thank you for your answer

actually my code is here 

I = imread('cameraman.png');

imwrite(I,'cameraman1.bin','jpeg','Quality',20)
fileID = fopen('cameraman1.bin');
A = fread(fileID);

 

I read the image first, then i rewrite it as a compressed binary file, then I open it and read it,the I took A and I did some modification on it then I transmitted it..

 

In the receiver I received the stream of bits then I modified it to reach A format but I couldnt know how to decode it so I can be able to get the image..

 

can you please help me in way to do that or propose for me other simple coding and decoding technique.

 

Thank you again 

0 Kudos
Message 8 of 9
(2,541 Views)

@pauldavey wrote:

LabVIEW does not have built-in functions for decompressing the image in-memory.


Yes, LabVIEW has those.

 

They're just hidden.

 

See 

NI_WebServices.lvlib:LV Image to PNG Data.vi
NI_WebServices.lvlib:PNG Data to LV Image.vi

 

Note that the export functions used for PNGs are also available for JPGs, but there are no VIs for it.

Message 9 of 9
(2,516 Views)