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


Groups > comp.lang.python > #44453

Re: Shear image (numpy.ndarray)

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.069
X-Spam-Evidence '*H*': 0.86; '*S*': 0.00; 'scipy': 0.05; 'get.': 0.09; 'pil': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'array.': 0.16; 'kern': 0.16; 'numpy': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:image': 0.16; 'underlying': 0.16; 'wrote:': 0.18; 'work,': 0.20; 'header:User- Agent:1': 0.23; 'interpret': 0.24; '(or': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'robert': 0.30; 'work.': 0.31; 'lists': 0.32; 'could': 0.34; 'subject: (': 0.35; 'skip:s 30': 0.35; 'anybody': 0.35; 'google': 0.35; 'hi,': 0.36; 'url:org': 0.36; 'should': 0.36; 'expected': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'received:org': 0.40; 'how': 0.40; 'hope': 0.61; 'here:': 0.62; 'show': 0.63; 'such': 0.63; 'skip:n 10': 0.64; 'our': 0.64; 'provide': 0.64; 'different': 0.65; 'world': 0.66; 'believe': 0.68; 'results': 0.69; 'hand': 0.80; 'eco': 0.84; 'subject:skip:n 10': 0.84; 'terrible': 0.84; 'trick.': 0.84; 'url:reference': 0.84; 'received:86': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Robert Kern <robert.kern@gmail.com>
Subject Re: Shear image (numpy.ndarray)
Date Sat, 27 Apr 2013 16:40:16 +0100
References <CAGvr90C9RnE0Qskfb8HbCKMmkAj5MFvpV0YyyE9rHPNwdnL4iQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host cpc2-cmbg17-2-0-cust347.5-4.cable.virginmedia.com
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5
In-Reply-To <CAGvr90C9RnE0Qskfb8HbCKMmkAj5MFvpV0YyyE9rHPNwdnL4iQ@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1129.1367077226.3114.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367077226 news.xs4all.nl 15960 [2001:888:2000:d::a6]:53941
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44453

Show key headers only | View raw


On 2013-04-27 12:46, Radek Machulka wrote:
> Hi,
>
> I am looking for some function that would shear my 2D numpy.ndarray array. Since
> the numpy (probably) does not provide such a functionality (numpy.roll does not
> do what I need), I hope the PIL might do the trick.
>
> Google give me page that says: 'This function (im.transform) can be used to
> scale, translate, rotate, and shear the original image.', however I was not able
> to get it work.
>
> So could anybody give me a hand how to use it (or how to shear the image in
> different way)?

You should be able to use scipy.ndimage.affine_transform() to do the job:

http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.interpolation.affine_transform.html#scipy.ndimage.interpolation.affine_transform

If you cannot get it to work, please show us what you tried, the results you 
got, and what you expected to get. You can find the scipy mailing lists here:

http://www.scipy.org/Mailing_Lists

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Shear image (numpy.ndarray) Robert Kern <robert.kern@gmail.com> - 2013-04-27 16:40 +0100

csiph-web