Note that there are some explanatory texts on larger screens.

plurals
  1. POAre there standard patterns for implementing a class to dynamically load images?
    primarykey
    data
    text
    <p>I've been tasked with creating an application that works with thousands of images, far too many to load into RAM all at once. I guess it's somewhat analogous to a photo viewer like Picassa, in that at any given moment the application needs the pixel data from only a handful of the total cataloged images. The application must also handle extremely large images, where only some small subset of the pixel data would actually be required at any given time for image analysis or display, which, I suppose, is somewhat analogous to Google Earth. In short, the application must dynamically load only the portion of the pixel data that is actually required at any given time.</p> <p>Having dealt only with static image loading typical of image libraries like OpenCV, CImg, or Magick++, I'm at a bit of a loss how I might best approach the problem. So my question is: are there any standard design patterns for this requirement, or approaches to solving this (or a similar) problem?</p> <p>BTW, for small images, I realize that I could simply delay loading of the image until it is needed, but there are two key problems that spring to mind with that approach. (1) This doesn't solve the large image problem. (2) Since unloading the image immediately after it is used could be inefficient, I would need some type of memory management handler in the application that only unloads images when new images are loaded and some memory threshold has been passed. Clearly a similar memory management issue remains for portions of a larger image loaded into memory. I will plainly admit that such a tool is beyond my knowledge and experience, so if that is the prevailing answer to this question, then I have a supplemental question. Could anyone recommended some basic tutorials on memory management?</p> <p>Thank you for the help!</p> <p>UPDATE: For those who are curious, I thought I'd share the approach I took. The image class I created lazy loads the image data. To solve the problem with loading thousands of images, I created a class that would keep track of the file handles (Windows has a limit - see _getmaxstdio), and the amount of image memory that was loaded, unloading as necessary. To handle very large images, I used the VXL image library as a back-end, which is able to load a subsection of a large image. Granted this isn't so efficient for some images (compressed images especially), but since I'm mostly working with tiled TIFF images, it works very well.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload