LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading pictures array

Hello,
I am new in programing and I would be glad somebody could help me.

I made a VI that can read pictures of many types (jpg,png,avi,special binary file) and I need to make these pictures all time accessible.  But reading  one by one, only picture that i need, is very slow, so I decided to put all the pictures into the array and saved it to global varriable. Byt when there is more then 60MB od the pictures and I call other function using this global varriable array, it slows down very much (I read it makes duplicate of the array). Is there any other way to load the pictures to make them easily accessable and fast using?

Thank you very much for your help

Tomas
0 Kudos
Message 1 of 16
(2,868 Views)
Using Labview 8.2 and Vision 8.2

Tomas
0 Kudos
Message 2 of 16
(2,867 Views)
Is this 60mb compressed or uncompressed?

If you have 60MB compressed files which are loaded into essentially bitmaps, then your memory requirement will be a lot higher than 60MB.

Have you tried running the profiler?

Can you post some code?

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 16
(2,863 Views)
How fast do you need it to be?

I just put together a slide show VI which reads pictures from a list of files. The file reads are much faster than the piture rendering. The only array is the list of filenames and no global or locals were used.

I have run this with hundreds of MB (total) of .jpg files.

Lynn

Message Edited by johnsold on 02-21-2007 09:06 AM

Message 4 of 16
(2,858 Views)
Hello,
here is my code that read pictures. One Case read data from my own binary file and I need to meke the output universal.


Thank you very much for your help

Tomas
Download All
0 Kudos
Message 5 of 16
(2,846 Views)
Johnsold's method sounds like a good alternative.  Reading the files instead of rendering will result in faster exectution. Have you considered this as a solution?
0 Kudos
Message 6 of 16
(2,820 Views)
Hello,

yes, I did try it before to load only actual picture, but openining and closing files each time take too much time. I thought, somehow to load  pictures  (it wold take some time and  memory,  but only  ones)  and than just go through them.

Tomas
0 Kudos
Message 7 of 16
(2,804 Views)
Hello Tomas.
Reading from hard disk is a fast procedure when dealing with reading images from files.
My computer is capable in reading and displaying 1000 different files in an IMAQ Window in about 3000 milliseconds (which is even much faster than my eyes can follow - and than my monitor can do). All images were 1024 x 1024 in size, type RGB U32 = 3MB BMPs on the hard disk.
Especially when I run my VI loading the 1000 images for a second time there seems to be no disc activity as Windows (like other OS) keeps recently used files in the cache.
Therefore I really like johnsold's proposal.
Regards, Guenter
0 Kudos
Message 8 of 16
(2,792 Views)
Guenter,

1000 3MB files in 3 seconds?  A transfer rate of 1GB/sec?  What kind of hard drive do you have?????

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 9 of 16
(2,780 Views)
Hello Shane.
You are absolutely right. I fell into the OS cache trap (of course) as all my bitmaps were already cached by the Windows operating system.
I notice from the Performance Monitor that my hard disk reads with a rate of up to 60MB/sec.
So having all the images in the cache is a good solution.
Thanks for your comment, Guenter
0 Kudos
Message 10 of 16
(2,771 Views)