LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i make IMAQ JPEG decoder work?

I'm working on an Image transcoding project. I have resized an image and now i'm trying to compress it by using IMAQ JPEG Decode.VI and IMAQ JPEG ENCODE.VI but these vi do not work due to connection problems.Please help me figure out how to make them work.
0 Kudos
Message 1 of 9
(4,918 Views)
Dear Ena,

I replace the 'Image' clusters with the IMAQ image data type, and made some changes to the connector pane of one or two of the VIs. I downloaded the VIs from here:

Can't find the IMAQ JPEG ENCODE VI
http://forums.ni.com/ni/board/message?board.id=200&message.id=1873&requireLogin=False

Please see the attached .zip file. I was able to successfully run the code. Please let me know if you have any problems.

Best Regards,

~Nate
0 Kudos
Message 2 of 9
(4,879 Views)
Thanks for making it work. I still haved a problem. I don't know how to incorporate it into the jpeg to 24-bit pixmap.vi that i attached in the first post. When i use the decoding vi  as a sub vi it does not allow me to connect it.
0 Kudos
Message 3 of 9
(4,865 Views)
Dear Ena,

See the attached VI. I was able to provide the proper input to the DECODE VI by using the IMAQ ArraytoImage. I am not sure that this is how you wanted to include the functionality, but it should give you a good starting point.

Please let me know how things go!

Best Regards,

~Nate

0 Kudos
Message 4 of 9
(4,842 Views)
Thanks for making the top VI work. The group ran it and it did just what we wanted it to do. Now i have another question is it possible to get the a color image instead of a black and white image at the end.
0 Kudos
Message 5 of 9
(4,771 Views)
Dear ena,

I've made some changes that allow you to encode and decode color images. Note that the file type for the opened image must always be RGB with this implementation.

Best Regards,

~Nate
0 Kudos
Message 6 of 9
(4,749 Views)
Opps, here is the VI.

~Nate
0 Kudos
Message 7 of 9
(4,748 Views)
I have attached a VI that is similar to the previous VIs, except that this VI does not have the re-sizing part. We wanted to know if there was an efficient way in which the image can be re-sized and compressed at the same time. We wanted, for example, a way where the person can input the dimension size of the image they want, wether it is for cell phone size or web. Can this be done?The way we had started to do it was not efficient because it did not allowdus to specify the dimention size of the compressed image. 
0 Kudos
Message 8 of 9
(4,711 Views)

There's discussion about a memory leak with this code at:

http://forums.lavag.org/Reading-the-JPEG-string-in-C-t6693.html&p=37645#entry37645

 

Apparently (according to the discussion in this link) the memory leak is associated with color jpg images being sent, not grayscale.

 

Also see http://forums.lavag.org/Jpeg-decoding-t11871.html&p=51529#entry51529

and http://sine.ni.com/devzone/cda/epd/p/id/3314

 

for similar info related to this topic.

 

Bruce

 

0 Kudos
Message 9 of 9
(4,512 Views)