Reputation: 21
Hi and thanks in advance !
I am writing a desktop application that uses industrial line-scan cameras to scan strips of photographic film. The total dimensions of the images captured is about 4,000x250,000px at 16-bits per pixel. The capture is saved by the camera as ~4,000x256px tiff chunks while scanning, as it empties out its buffers. I am also saving 1D statistical data that is used to find where the frames (individual physical images on the film) are located.
My question is what would be the most efficient way of preparing these files as the software needs to display individual extracted frames and perform image correction on these, potentially with Libvips :
Keep the images as chunks :
Extract frames to individual files :
Create a single huge image of the entire strip :
I am mostly leaning towards extracting frames to their own file, and probably leverage Libvips' speed to do so, but I am very interested in hearing what people more experienced with Vips think about this topic !
Thanks a lot for reading and your time.
This is mostly an exploratory question.
Upvotes: 0
Views: 104
Reputation: 11179
libvips author here. My first thought would be to keep each 4,096 x 256 pixel chunk in a separate file and composite them for the display. You could have 1,000 open images for the 1,000 chunks then use eg. arrayjoin
to very quickly make a single huge image from them. libvips will cache and map everything on demand for you, so performance ought to be good (as long as you can have 1,000 files open at once).
But like any design like this, the best approach is to try to pick a specification for the target platform (os, memory, expected performance), a required level of performance (screen repaint speed, capture time, latency, memory use), make a tiny but representative prototype (python is good for sketching ideas), and spend some time experimenting to discover a technical solution that can meet your goals.
I'd also have a quick look at vipsdisp:
https://github.com/jcupitt/vipsdisp
It has quite a fancy threaded, async, GPU based screen repainting system you might be able to borrow ideas from. If you're targeting gtk you could perhaps even reuse some widgets.
Upvotes: 1