Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python Image Registration and Cropping?

171 views
Skip to first unread message

mikejoh...@gmail.com

unread,
May 3, 2014, 5:47:42 PM5/3/14
to
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!

Mark Lawrence

unread,
May 3, 2014, 6:04:14 PM5/3/14
to pytho...@python.org
Sorry I can't help directly but I do know that PIL has been forked into
Pillow see https://pypi.python.org/pypi/Pillow/

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


Dave Angel

unread,
May 4, 2014, 9:24:55 AM5/4/14
to pytho...@python.org
mikejoh...@gmail.com Wrote in message:
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.

--
DaveA

Ian Kelly

unread,
May 4, 2014, 11:51:00 AM5/4/14
to Python
On Sun, May 4, 2014 at 7:24 AM, Dave Angel <da...@davea.name> wrote:
> mikejoh...@gmail.com Wrote in message:
> 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.

mikejoh...@gmail.com

unread,
May 4, 2014, 8:56:11 PM5/4/14
to
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.
Message has been deleted
0 new messages