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


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

Re: Shear image (numpy.ndarray)

Started byRobert Kern <robert.kern@gmail.com>
First post2013-04-27 16:40 +0100
Last post2013-04-27 16:40 +0100
Articles 1 — 1 participant

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

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#44453 — Re: Shear image (numpy.ndarray)

FromRobert Kern <robert.kern@gmail.com>
Date2013-04-27 16:40 +0100
SubjectRe: Shear image (numpy.ndarray)
Message-ID<mailman.1129.1367077226.3114.python-list@python.org>
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

[toc] | [standalone]


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


csiph-web