Results 1 to 5 of 5

Thread: Displaying a portion of an image

  1. #1
    Join Date
    Feb 2007
    Posts
    4

    Default Displaying a portion of an image

    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/Fea..._monthlies.php and I have handled the smaller 2 sizes it is the big 2GB image I am working on now

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Displaying a portion of an image

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

  3. #3
    Join Date
    Jun 2008
    Posts
    35
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Displaying a portion of an image

    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

  4. #4
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Displaying a portion of an image

    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.

  5. #5
    Join Date
    Feb 2007
    Posts
    4

    Default Re: Displaying a portion of an image

    Quote Originally Posted by caduel View Post
    Have a look at QImageReader::setClipRect(), and please tell us if that helped.
    Quote Originally Posted by caduel View Post
    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

    Qt Code:
    1. QImageReader testing("mapping/worldmed.tif","tiff");
    2. testing.setClipRect (QRect(2700,2700,2700,1350));
    3. QImage testimage=testing.read();
    4. mainImage=new QGraphicsPixmapItem(QPixmap::fromImage(testimage));
    To copy to clipboard, switch view to plain text mode 

    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

    Quote Originally Posted by nicolas1 View Post
    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.

    Quote Originally Posted by patrik08 View Post
    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.

Similar Threads

  1. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 15:36
  2. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  3. Replies: 3
    Last Post: 25th August 2007, 16:53
  4. Replies: 7
    Last Post: 27th June 2007, 09:34
  5. displaying png image for a given area..
    By sar_van81 in forum Qt Programming
    Replies: 1
    Last Post: 17th January 2007, 13:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.