PDA

View Full Version : Displaying a portion of an image



tas
27th November 2008, 03:00
I am working with some very large images of the earth for a mapping class I am working on for a few projects I have in mind. Since the images are as large as they are it is impractical to load the whole thing into memory. For my medium sized image (21600X10800px) I chopped it up into smaller tiles and loaded those. This took all the computing power I possess to chop it up with imagemagick. So the image I have now at 4x the size is too big to handle.

The solution I am thinking of is to somehow grab a portion of the larger image if I know the coordinates. Only problem is I think I would need to load the image into memory to do this which is something I dont want to do. I am working with Qt 4.4 currently. I am also open to any and all ideas for large image handling

The images I am working with are from here: http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php and I have handled the smaller 2 sizes it is the big 2GB image I am working on now

caduel
27th November 2008, 10:19
Have a look at QImageReader::setClipRect(), and please tell us if that helped.

nicolas1
27th November 2008, 12:31
implement custom graphicsitem, which open image and take part of image using ImageMagick api.
but imagemagick is not really efficient on large images. try to use gdal with custom graphicsitem

patrik08
27th November 2008, 15:07
This Month i writteln ready a QFuture Tifflib an this code can read tiff over 2GB on linux and Max 2GB on window.

QImage having limit size of 32000 pixel
My experience say 9000-12000.

If you like to write selft this piece of code read source from
http://mcmcweb.er.usgs.gov/drc/dlgv32pro/ and search TIFFOverlay and port to QT4.
Otherwise if you like to save 10 day work send me a message.

tas
28th November 2008, 04:09
Have a look at QImageReader::setClipRect(), and please tell us if that helped.


Have a look at QImageReader::setClipRect(), and please tell us if that helped.

I think this is on the right track, I tried a quick test case




QImageReader testing("mapping/worldmed.tif","tiff");
testing.setClipRect (QRect(2700,2700,2700,1350));
QImage testimage=testing.read();
mainImage=new QGraphicsPixmapItem(QPixmap::fromImage(testimage)) ;


When I ran it my 2 gigs of ram was quickly eaten up and then the correct part of the image was displayed and the ram was released. The operation took approximately 15 seconds. This was on my medium sized image, I ended up killing the operation on the larger one.

I do think this shows promise however.

Thank you.

quote


implement custom graphicsitem, which open image and take part of image using ImageMagick api.
but imagemagick is not really efficient on large images. try to use gdal with custom graphicsitem

I havent heard of gdal and I will be reading up on it. GDal look interesting for more then just using it for image handling.


This Month i writteln ready a QFuture Tifflib an this code can read tiff over 2GB on linux and Max 2GB on window.

QImage having limit size of 32000 pixel
My experience say 9000-12000.

If you like to write selft this piece of code read source from
http://mcmcweb.er.usgs.gov/drc/dlgv32pro/ and search TIFFOverlay and port to QT4.
Otherwise if you like to save 10 day work send me a message.

thank you before I bug you for that I have to decide if it is practical what I am trying to do just do to the amount of data I am dealing with. I am also looking into marble as something to use.