Itseez/opencv — pull request #2926 by marvins (2014-07-01 23:41:17+00:00)
Title: Adding support for GDAL raster images.

This is a fix for Pull Request 2806. I made some changes, merged with upstream opencv, then made more. I then tried to squash the commits on my side and ended up deleting a bunch of history. I am a little rough on the more complex parts of git, so I apologize for the delay.

This is everything that I did on Pull Request 2806, except that the revision history is one commit. It has everything there based on this morning's OpenCV master branch.

Last thing mentioned was designing some perf tests. I will take a look and see what I can come up with. Let me know if there is anything that you would like to see as well.

Thanks,
Marvin

/** Pull Request 2806 Notes **/

This pull request is in conjunction with issue 3725. I have added an ImageDecoder to support loading GDAL raster images, integrated the CMake configuration flags, and wrote a tutorial on how to use it. In the process, I started adding comments inside the highgui module in hopes that I can also add a tutorial on how to create custom ImageEncoder and Decoder drivers for OpenCV. This is not implemented yet, but I am working on it.

To install GDAL on Ubuntu, install the "libgdal-dev" package. On Fedora, install the "gdal-devel" package. I am a little naive with building OpenCV on Windows, so I am not sure if it would work. I have tested the driver with the following formats...

Digital Elevation Models

DTED
SRTM

Rasters

NITF (2.0/2.1)
GeoTiff
JPEG
Tiff
J2K

If there is interest in supporting GDAL, I would be more than happy to dig into the ImageEncoder driver. In addition, GDAL can load the image Metadata as well as do coordinate conversions. I can add that capability if desired. Also, if there are any bugs, improvements, or fixes in my code that you would like me to make, just let me know. Finally, I find git rebase a little scary, so I have not squashed the commits down yet. I would prefer a little advice from an expert before revising the history.

Thanks,
Marvin