Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70902 > unrolled thread

Python Image Registration and Cropping?

Started bymikejohnryan08@gmail.com
First post2014-05-03 14:47 -0700
Last post2014-05-06 20:09 -0400
Articles 6 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Python Image Registration and Cropping? mikejohnryan08@gmail.com - 2014-05-03 14:47 -0700
    Re: Python Image Registration and Cropping? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-03 23:04 +0100
    Re:Python Image Registration and Cropping? Dave Angel <davea@davea.name> - 2014-05-04 09:24 -0400
    Re: Python Image Registration and Cropping? Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-04 09:51 -0600
      Re: Python Image Registration and Cropping? mikejohnryan08@gmail.com - 2014-05-04 17:56 -0700
        Re: Python Image Registration and Cropping? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-05-06 20:09 -0400

#70902 — Python Image Registration and Cropping?

Frommikejohnryan08@gmail.com
Date2014-05-03 14:47 -0700
SubjectPython Image Registration and Cropping?
Message-ID<e12705fa-8f47-4046-8382-a52a9c17281b@googlegroups.com>
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!

[toc] | [next] | [standalone]


#70903

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-05-03 23:04 +0100
Message-ID<mailman.9670.1399154678.18130.python-list@python.org>
In reply to#70902
On 03/05/2014 22:47, mikejohnryan08@gmail.com wrote:
> 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/

-- 
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

[toc] | [prev] | [next] | [standalone]


#70910

FromDave Angel <davea@davea.name>
Date2014-05-04 09:24 -0400
Message-ID<mailman.9673.1399209520.18130.python-list@python.org>
In reply to#70902
mikejohnryan08@gmail.com Wrote in message:
> 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.

-- 
DaveA

[toc] | [prev] | [next] | [standalone]


#70912

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-05-04 09:51 -0600
Message-ID<mailman.9674.1399218711.18130.python-list@python.org>
In reply to#70902
On Sun, May 4, 2014 at 7:24 AM, Dave Angel <davea@davea.name> wrote:
> mikejohnryan08@gmail.com Wrote in message:
>> 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.

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.

[toc] | [prev] | [next] | [standalone]


#70917

Frommikejohnryan08@gmail.com
Date2014-05-04 17:56 -0700
Message-ID<9886ebf9-ba2c-48dc-aed0-81437c68faf2@googlegroups.com>
In reply to#70912
On Sunday, May 4, 2014 11:51:00 AM UTC-4, Ian wrote:
> On Sun, May 4, 2014 at 7:24 AM, Dave Angel <davea@davea.name> wrote:
> 
> > mikejohnryan08@gmail.com Wrote in message:
> 
> >> 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.
> 
> 
> 
> 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.

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.

[toc] | [prev] | [next] | [standalone]


#70995

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2014-05-06 20:09 -0400
Message-ID<mailman.9718.1399421372.18130.python-list@python.org>
In reply to#70917
On Sun, 4 May 2014 17:56:11 -0700 (PDT), mikejohnryan08@gmail.com declaimed
the following:
>
>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).
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web