Python Image Registration and Cropping?

M

mikejohnryan08

Hello,

Is there a Python tool or function that can register two images together (line them up visually), and then crop them to the common overlap area? I'm assuming this can probably be done with Python Imaging Library but I'm not very familiar with it yet.

Any help or advice is appreciated!

Thanks!
 
M

Mark Lawrence

Hello,

Is there a Python tool or function that can register two images together (line them up visually), and then crop them to the common overlap area? I'm assuming this can probably be done with Python Imaging Library but I'm not very familiar with it yet.

Any help or advice is appreciated!

Thanks!

Sorry I can't help directly but I do know that PIL has been forked into
Pillow see https://pypi.python.org/pypi/Pillow/
 
D

Dave Angel

Hello,

Is there a Python tool or function that can register two images together (line them up visually), and then crop them to the common overlap area? I'm assuming this can probably be done with Python Imaging Library but I'm not very familiar with it yet.

Any help or advice is appreciated!

Thanks!

Without some context I'd call the problem intractable. I've done
such things using Photoshop to insert elements of one image into
another. But even describing an algorithm is difficult, never
mind trying to code it.

If I had such a challenge, I'd probably use Pillow, but not till
I knew what subset I was solving.

1) you had an image, saved in lossless tiff, and it was copied
twice, each was edited and cropped, and the original lost.
Analyze the two remaining tiff, and try to reconstruct the
largest common subset.

2) You have two faxes from filled in versions of the same original
form, and you're trying to extract just the handwriting portions
of each. Very tricky, because not only exposure differences,
but registration will vary over the surface, because of moisture
and irregular feed from multiple rollers.

3) You have two jpegs, created from same master, but one has been
scaled, rotated, cropped, and color corrected. Even without
color correction, one was saved at a different quality setting,
or prepared with a different raw converter.

4) You have two images taken with the same camera, on a tripod,
within a minute of each other, with no visible difference of
cloud cover, with camera set on full manual, without auto
focus. The were converted with the same raw converter,
...

etc.
 
I

Ian Kelly

Without some context I'd call the problem intractable. I've done
such things using Photoshop to insert elements of one image into
another. But even describing an algorithm is difficult, never
mind trying to code it.

Well, fortunately there are known algorithms already:
http://en.wikipedia.org/wiki/Image_registration
If I had such a challenge, I'd probably use Pillow, but not till
I knew what subset I was solving.

I don't think Pillow has any support for registration. I'd probably
start by looking for Python bindings of a library that does handle it,
like ITK. Searching for "itk python" turns up a number of results.
 
M

mikejohnryan08

Well, fortunately there are known algorithms already:

http://en.wikipedia.org/wiki/Image_registration







I don't think Pillow has any support for registration. I'd probably

start by looking for Python bindings of a library that does handle it,

like ITK. Searching for "itk python" turns up a number of results.

Thanks for the responses. More specifically, my scenario is that I have many aerial image stereo-pairs, and need to register each pair together and crop them to their overlapping area. The output should produce two images with the same field-of-view; and the only difference will be the perspective.. Still searching for a suitable module that can easily do this sort of thing.
 
D

Dennis Lee Bieber

Thanks for the responses. More specifically, my scenario is that I have many aerial image stereo-pairs, and need to register each pair together and crop them to their overlapping area. The output should produce two images with the same field-of-view; and the only difference will be the perspective. Still searching for a suitable module that can easily do this sort of thing.

You've basically picked the most difficult situation...

Essentially there is no "overlap" area (there may be a visual overlap
/producing the 3D visual/) but in terms of registering pairs, there is
likely only one pixel in each image that can be considered "the same".

Any module you find for registering images (for example, code to create
combine mosaics, or splice strips) assume that some part of the image will
be nearly /identical/ between the two shots... That implies shot from the
same location with maybe some distortion for lens (it is easier to stitch a
panorama when using many telephoto shots than to use fewer wide-angle
shots, due to perspective distortion).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top