[Image-SIG] Using MESH method of Image.transform

Nadav Horesh nadavh at visionsense.com
Wed Oct 20 15:12:44 CEST 2004


Atteched here a function that generates a quadratic distortion mesh for an image. Its doc string docuiments how to use it.

The Image.trasform->MESH method uses repetitive  calls to Image.transform->QUAD method. Thus, as documented,  MESH data, is just a list of QUAD data. You should pay attention to to following:
 1. There is a spedific order of the rectangle and the quadrilateral vertices.
 2. Two adjacent quadrilaterals in the mesh have a common edge. You should provide this edge twice --- once for each quadrilateral.

I hope that the attached function would help to clarify.

  Nadav.

-----Original Message-----
From:	Kent Tenney [mailto:kent at springfed.com]
Sent:	Wed 20-Oct-04 03:36
To:	Nadav Horesh
Cc:	
Subject:	Re: [Image-SIG] Using MESH method of Image.transform
Nadav,

I would be very interested in seeing a bit
of your code.

Thanks,
Kent

Nadav Horesh wrote:
> Eventually I figured it by my self. It looks OK mostly on photo images, but I am not absolutely sure that whatI did is 100% correct.
> The other possibility is to use numarray.nd_image.map_coordinates method. However there is a basic differnece between the two approches (of numarray's and Image packages), you can find somae basic tutorial on mesh-grids in IBM's opendx library.
> 
> If you are willing to take the risk, I can provide you with an explanation of what I did.
> 
>   Nadav.
> 
> -----Original Message-----
> From:	Kent Tenney [mailto:kent at springfed.com]
> Sent:	Tue 19-Oct-04 11:47
> To:	Nadav Horesh
> Cc:	
> Subject:	Re: [Image-SIG] Using MESH method of Image.transform
> Nadav,
> 
> Did you ever get any help on this?
> I am also interested in the answer
> to your question.
> 
> Thanks,
> Kent
> 
> Nadav Horesh wrote:
> 
>>Does someone can give me an example of using Image.transform to deform an image via the MESH method?
>>
>> Tanks,
>>   Nadav.
>>_______________________________________________
>>Image-SIG maillist  -  Image-SIG at python.org
>>http://mail.python.org/mailman/listinfo/image-sig
>>
>>
> 
> 
> 
> 
> 
> 




-------------- next part --------------
A non-text attachment was scrubbed...
Name: barrel.py
Type: application/octet-stream
Size: 1688 bytes
Desc: barrel.py
Url : http://mail.python.org/pipermail/image-sig/attachments/20041020/98107db6/barrel.obj


More information about the Image-SIG mailing list