1

I have a set of aerial images which I am trying to clip by their overlapping areas, for use in a more involved program I am writing.

Is there a command line based tool out there with an easy method for extracting the overlapping areas from a pair of images? The images themselves do not have georeferencing, but they DO come with a shapefile containing bounding boxes of the image collects, as well as IMU data from image collection.

I know this may be difficult since the images will have slight perspective differences, but I was hoping it would still be possible--especially since I am trying to maintain and utilize these perspective differences for something else.

  • 1
    Could you clip 1 bounding box with the other - this result will give you the overlapping area - then do a raster clip using this new overlapping bounding box shape? What software are you using/have available to you? – dklassen Jul 30 '14 at 22:10
  • I was thinking that might work, except the images don't have georeferencing information so the bounding boxes wouldn't know where to clip. I'd have to figure out a way to spatially align the images with the bounding boxes and THEN clip. I only have open source software available to me but trying to automate this with a script, preferably using Python tools. – mryan13 Jul 30 '14 at 22:16
2

Assuming the boxes are in cells. If not you can make new boxes but the must be in cell coordinates. Use GDALinfo to get the coordinates:

Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  220.0)
Upper Right (  220.0,    0.0)
Lower Right (  220.0,  220.0)
Center      (  110.0,  110.0)

This is part of the GDALinfo on an ungeoreferenced image (220 pix by 220 pix). Have a look at How do I create point features with exact coordinates? to create a box with those exact coordinates.

Georeference the images using the georeferencer and then recycle the control points to transform the box. see How to georeference a vector layer with control points?.

You may need to do some work in notepad or similar to convert the control points from the image georeference format to vector georeference format.

After the images and boxes have been georeferenced you can extract the common area between the shapefiles using OGR2OGR with -clipsrclayer option or if you don't like command line look at this How to crop Shapefiles in QGIS? to crop one bounding box with anothers' bounding box.

Extract the common areas from each georeferenced image as seen in this post Clipping raster with vector boundaries using QGIS?

That should get you within a pixel or two of the true overlapping area. The result images will be georeferenced; if you translate to a worlded format (.bmp, .jpg) you can then delete the world file and they will be no longer georeferenced.

Disclaimer: I have only done this in ArcMap and I am assuming that QGIS will behave in the same manner based on the same inputs. It worked in ArcMap.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.