Image acquisition-skipping frames
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, I am working on a program that starts capturing frames whenever it receives a signal from a remote computer and stores it as a TIFF stack. It stops recording whenever it receives the appropriate signal from the remote computer.
For shorter durations (~15s-30s), all the frames are stored. However, for longer durations (~5 min), it is losing frames. I have tried increasing the frame memory but it does not seem to be helping. I have reliably determined that it is receiving the correct signal, and that the stop function (stop(vi)) is being called.
The images are of size 512*512.
Thank you
Mathew
1 Commento
Geoff
il 29 Mag 2012
Hi Matthew, I'll be quite interested to hear how you get on with this issue. It is possible to stream a multi-page TIFF to disk without doing any seeks, if you have access to the code that does the encoding. Basically, you keep the most recent frame in a buffer and only write it when another frame arrives or the file is closed off. That way you can predict all the file offsets etc that need to be written, without having to double back. I would recommend this only if you REALLY want to write TIFFs on the fly as opposed to compiling them afterwards. Who knows - someone may have already written a support routine for this... =)
Risposte (2)
Walter Roberson
il 28 Mag 2012
If you are storing the images to disk as you go, you are going to end up with frames dropped (unless perhaps you are using a solid state disk.) Disks are much slower than main memory.
Geoff
il 29 Mag 2012
Those images are 512 * 512 * 1 ? That's 256kB. These are small. What is your frame rate? I'll assume 50 fps. That's 12.5 MB per second. Peanuts for a single hard drive to cope with. A drive would still manage that at around 300 fps.
You say TIFF stack. I'm not up with the terminology here.. Is that a single file containing all frames? How often do you write this file? Once at the end, I'd hope? If not, then do that and see if you still have a problem.
Otherwise, I would be storing one image per file and see how you go with that. If there's a bottleneck encoding the file, then write out the binary data raw and process it later.
If you're pushing disk limits you need to be extremely efficient in how you write data. If you're not pushing limits, and still having trouble, then you're probably being very inefficient somewhere.
4 Commenti
Geoff
il 29 Mag 2012
Regarding the last paragraph in my comment above.... Refer to Figure 1 on Page 14: http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!