Skip to content

adamsteer/python-opencv-image-projection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python code for classifying and warping images
-----------------------------------------------
Adam Steer, August 2015

Made with a lot of help from Dr Mark Reid (http://mark.reid.name)

...and support from:
- The University of Tasmania School of Land and Food, discipline of Spatial Science
- The Antarctic Climate and Ecosystems Cooperative Research Centre (http://www.acecrc.org.au)
- The Australian Antarctic Division (http://www.antarctica.gov.au).

The code here is some experimental work on projecting aerial photographs
of sea ice onto a plane, and doing a basic classification.

Requires:
---------
Python3
openCV3
scikit-image
pyshape


Contents by folder:
#-------------------------------------------------------------------------------------------------
rectify
-------
Input data are a set of camera orientations in an arbitrary cartesian coordinate system (E, N, Up),
and a set of images.

Output is a set of images rotated and projected onto a plane, with world files.

This code does not work for scenarios where there is actual terrain - it is designed for
sea ice imagery, so imagery is projected onto a flat plane (x,y) = 0. If you have terrain, feel free
to fork the code and build methods for dealing with it.

It also has no method for rigourous image matching (ie SiFT -> RANSAC). It relies on very good
knowledge of aircraft position, aircraft attitude, and camera boresight misalignment.

If you're after a way to stitch images together to make an orthomosaic or terrain model, check 
out the VisualSfM toolkit:

http://ccwu.me/vsfm/

..or any number of excellent commercial software packages which do these jobs and might save you a lot
of developer time, e.g. AgiSoft Photoscan, Pix4D, .....

The code here was built because these packages don't serve a specific need - which was to project images
onto a plane using only aircraft orientation in an arbitrary coordinate system.

scripts:

undistort.py: In here is code to apply a lens distortion correction to a directory of images

warp_im_list.py: This code snippet takes a list of camera orientations (text file) and a directory
                 corresponding images as input. It does the reprojection and world file production
                 
warp_MR.py: A single-shot version of warp_im_list.py

#-------------------------------------------------------------------------------------------------
classify
--------
Input data is a single image, output at present is a classified image.

Mostly experiments with unsupervised classification in here, using SLIC superpixel segmentation and graph cuts for region merging.

Files are self-describing, more here when it iterates toward tidiness!

Much help has been obtained from blog posts here:

http://vcansimplify.wordpress.com/




About

Python and openCV code to project images onto a plane using camera orientation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages