Hi list,
this is very basic, in fact so basic no one ever asked it seems :)
I need to correct the trapezoidal/keystone deformation of a video. The beamer I use can't correct enough, so I need to do that with GEM. I heard of a keystone library but could not find it.
I tried various rotate/scale/translate without getting good enough results.
So I thought I could have a polygon with a texture mapped on it, and the stretch the corners. The problem I have is that my patch is as follows:
[pix_image test.png] | [pix_texture] | [circle 4]
(The circle is used to make a mask so the video boundaries are round.)
Adding a polygon after the circle does not seem to work.
Any advice welcome.
hello Charles,
you can render anything on a framebuffer, then using it as a texture to the polygon.
look at gem example: Gem/examples/12.multi_screen_projection/02.nfp-help.pd it's a bit more complex than what you want to do, but you'll may find it interesting.
cheers Cyrille
Le 27/03/2012 21:50, Charles Goyard a écrit :
Hi list,
this is very basic, in fact so basic no one ever asked it seems :)
I need to correct the trapezoidal/keystone deformation of a video. The beamer I use can't correct enough, so I need to do that with GEM. I heard of a keystone library but could not find it.
I tried various rotate/scale/translate without getting good enough results.
So I thought I could have a polygon with a texture mapped on it, and the stretch the corners. The problem I have is that my patch is as follows:
[pix_image test.png] | [pix_texture] | [circle 4]
(The circle is used to make a mask so the video boundaries are round.)
Adding a polygon after the circle does not seem to work.
Any advice welcome.
Hi Cyrille,
Cyrille Henry wrote:
you can render anything on a framebuffer, then using it as a texture to the polygon. look at gem example: Gem/examples/12.multi_screen_projection/02.nfp-help.pd it's a bit more complex than what you want to do, but you'll may find it interesting.
Thanks, that's very helpful. Now I have a texture with an in-circle pix, and that texture is mapped into a polygon.
However, the result is a bit weird. It looks like the point of view is rotated by 90 degrees and with a bit angled Z-axis. I don't understand the camera object. How can I get back to something more frontal ?
Cheers,
Evtoolkit?
Patrick Pagano B.S.,M.F.A Digital Media Engineer UF Digital Worlds Institute (352)294-2020
On Mar 27, 2012, at 6:18 PM, "Charles Goyard" cg@fsck.fr wrote:
Hi Cyrille,
Cyrille Henry wrote:
you can render anything on a framebuffer, then using it as a texture to the polygon. look at gem example: Gem/examples/12.multi_screen_projection/02.nfp-help.pd it's a bit more complex than what you want to do, but you'll may find it interesting.
Thanks, that's very helpful. Now I have a texture with an in-circle pix, and that texture is mapped into a polygon.
However, the result is a bit weird. It looks like the point of view is rotated by 90 degrees and with a bit angled Z-axis. I don't understand the camera object. How can I get back to something more frontal ?
Cheers,
-- Charlot
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Tue, Mar 27, 2012 at 5:23 PM, Charles Goyard cg@fsck.fr wrote:
However, the result is a bit weird. It looks like the point of view is rotated by 90 degrees and with a bit angled Z-axis. I don't understand the camera object. How can I get back to something more frontal ?
I have done some extreme "keystoning" in the past using raw OpenGL in GEM (i.e. you build your polyon out of vertices) and using the combination of rotation and moving each vertex individually around. I had a quick look on my computer but cannot find the code right now but I hope that this can at least give some leads.
./MiS
hello,
you have to manually adjust the position of the 4 vertices defining the corned of the primitive in order to spacially adjust them. then, you have to adjust the position of the teture in this point (it's an option that you don't really need). here it is adjusted in a neutral position.
cheers Cyrille
Le 27/03/2012 23:23, Charles Goyard a écrit :
Hi Cyrille,
Cyrille Henry wrote:
you can render anything on a framebuffer, then using it as a texture to the polygon. look at gem example: Gem/examples/12.multi_screen_projection/02.nfp-help.pd it's a bit more complex than what you want to do, but you'll may find it interesting.
Thanks, that's very helpful. Now I have a texture with an in-circle pix, and that texture is mapped into a polygon.
However, the result is a bit weird. It looks like the point of view is rotated by 90 degrees and with a bit angled Z-axis. I don't understand the camera object. How can I get back to something more frontal ?
Cheers,
Hi,
news@petervenus.de wrote:
you could also have a look into a toolkit we developed(with extensive help by cyrille henry), that deals exactly with this kind of problems. you can download it via http://puredata.info/Members/Weitsicht open 01_ev_module_list and look for the ev_easymap22 module,
Brilliant ! This seems to do the trick.
However I really would love to understand why what I did is weird.
To Patrick P.: looking up "Evtoolkit" in some search engines returned nothing useful. But now things will change with the archives of pd-list :).
Cheers,
Le 27/03/2012 16:34, Charles Goyard a écrit :
Hi,
news@petervenus.de wrote:
you could also have a look into a toolkit we developed(with extensive help by cyrille henry), that deals exactly with this kind of problems. you can download it via http://puredata.info/Members/Weitsicht open 01_ev_module_list and look for the ev_easymap22 module,
Brilliant ! This seems to do the trick.
However I really would love to understand why what I did is weird.
it's the way openGL interpolate the texture that is the most optimized one. there is a flag somwhere to get what you want, but i always forget it.
c
To Patrick P.: looking up "Evtoolkit" in some search engines returned nothing useful. But now things will change with the archives of pd-list :).
Cheers,
http://puredata.info/Members/Weitsicht/extended-view-toolkit/
EVtoolkit rules
pp
-----Original Message----- From: pd-list-bounces@iem.at [mailto:pd-list-bounces@iem.at] On Behalf Of Charles Goyard Sent: Tuesday, March 27, 2012 10:34 AM To: pd-list@iem.at Subject: Re: [PD] Keystone correction
Hi,
news@petervenus.de wrote:
you could also have a look into a toolkit we developed(with extensive help by cyrille henry), that deals exactly with this kind of problems. you can download it via http://puredata.info/Members/Weitsicht open 01_ev_module_list and look for the ev_easymap22 module,
Brilliant ! This seems to do the trick.
However I really would love to understand why what I did is weird.
To Patrick P.: looking up "Evtoolkit" in some search engines returned nothing useful. But now things will change with the archives of pd-list :).
Cheers,
-- Charlot
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Cyrille,
Cyrille Henry wrote:
you have to manually adjust the position of the 4 vertices defining the corned of the primitive in order to spacially adjust them. then, you have to adjust the position of the teture in this point (it's an option that you don't really need). here it is adjusted in a neutral position.
Now, I have something almost working. The only thing is that my texture gets folded along a diagonal when I move the polygon vertices. Drawing the polygon as line shows the right trapeze.
Also I don't understand why I need to rotate my texture along the Z axis to get it right.
Attached is my patch, a sample texture and what I get on my screen. Please tell me what I did wrong.
I use gem 0.93.3.
Thanks,
BTW we might meet tonight at Clement's :)
don't use a polygon, but a mesh_square or a curve3d. c
Le 27/03/2012 11:21, Charles Goyard a écrit :
Hi Cyrille,
Cyrille Henry wrote:
you have to manually adjust the position of the 4 vertices defining the corned of the primitive in order to spacially adjust them. then, you have to adjust the position of the teture in this point (it's an option that you don't really need). here it is adjusted in a neutral position.
Now, I have something almost working. The only thing is that my texture gets folded along a diagonal when I move the polygon vertices. Drawing the polygon as line shows the right trapeze.
Also I don't understand why I need to rotate my texture along the Z axis to get it right.
Attached is my patch, a sample texture and what I get on my screen. Please tell me what I did wrong.
I use gem 0.93.3.
Thanks,
BTW we might meet tonight at Clement's :)
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
I don't understand how I can move the points of a mesh_square to make a trapezoid.
Cyrille Henry wrote:
don't use a polygon, but a mesh_square or a curve3d.
Le 27/03/2012 11:21, Charles Goyard a écrit :
Hi Cyrille,
Cyrille Henry wrote:
you have to manually adjust the position of the 4 vertices defining the corned of the primitive in order to spacially adjust them. then, you have to adjust the position of the teture in this point (it's an option that you don't really need). here it is adjusted in a neutral position.
Now, I have something almost working. The only thing is that my texture gets folded along a diagonal when I move the polygon vertices. Drawing the polygon as line shows the right trapeze.
Also I don't understand why I need to rotate my texture along the Z axis to get it right.
Le 05/04/2012 20:37, Charles Goyard a écrit :
Hi,
I don't understand how I can move the points of a mesh_square to make a trapezoid.
Cyrille Henry wrote:
don't use a polygon, but a mesh_square or a curve3d.
Le 27/03/2012 11:21, Charles Goyard a écrit :
Hi Cyrille,
Cyrille Henry wrote:
you have to manually adjust the position of the 4 vertices defining the corned of the primitive in order to spacially adjust them. then, you have to adjust the position of the teture in this point (it's an option that you don't really need). here it is adjusted in a neutral position.
Now, I have something almost working. The only thing is that my texture gets folded along a diagonal when I move the polygon vertices. Drawing the polygon as line shows the right trapeze.
Also I don't understand why I need to rotate my texture along the Z axis to get it right.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hello Charles,
You can do that with a vertex shader. ++
Jack
Le 06/04/2012 01:37, Jack a écrit :
Le 05/04/2012 20:37, Charles Goyard a écrit :
Hi,
I don't understand how I can move the points of a mesh_square to make a trapezoid.
Cyrille Henry wrote:
don't use a polygon, but a mesh_square or a curve3d.
Le 27/03/2012 11:21, Charles Goyard a écrit :
Hi Cyrille,
Cyrille Henry wrote:
you have to manually adjust the position of the 4 vertices defining the corned of the primitive in order to spacially adjust them. then, you have to adjust the position of the teture in this point (it's an option that you don't really need). here it is adjusted in a neutral position.
Now, I have something almost working. The only thing is that my texture gets folded along a diagonal when I move the polygon vertices. Drawing the polygon as line shows the right trapeze.
Also I don't understand why I need to rotate my texture along the Z axis to get it right.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-listHello Charles,
You can do that with a vertex shader. ++
Jack
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
OK, here a small exemple. ++
Jack
I don't understand how I can move the points of a mesh_square to make a trapezoid.
You can do that with a vertex shader. here a small exemple.
Ok I get the idea. At the moment I'll see how I can adapt that, but I never used shaders before. In case of failure I'll stick with extendedview :).
Thanks all,
you can use curve3d if you prefer moving vertices with pd message. see attachment. Iohannes solution using trapezoid is also a very good solution, if you only have to change keystone.
++ c
Le 05/04/2012 20:37, Charles Goyard a écrit :
Hi,
I don't understand how I can move the points of a mesh_square to make a trapezoid.
Cyrille Henry wrote:
don't use a polygon, but a mesh_square or a curve3d.
Le 27/03/2012 11:21, Charles Goyard a écrit :
Hi Cyrille,
Cyrille Henry wrote:
you have to manually adjust the position of the 4 vertices defining the corned of the primitive in order to spacially adjust them. then, you have to adjust the position of the teture in this point (it's an option that you don't really need). here it is adjusted in a neutral position.
Now, I have something almost working. The only thing is that my texture gets folded along a diagonal when I move the polygon vertices. Drawing the polygon as line shows the right trapeze.
Also I don't understand why I need to rotate my texture along the Z axis to get it right.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
Cyrille Henry wrote:
you can use curve3d if you prefer moving vertices with pd message. see attachment.
Thanks, that look real good.
Iohannes solution using trapezoid is also a very good solution, if you only have to change keystone.
Now I feel like a hacker using that undocumented object. Fair enough, I made the documentation, that can be included in the next Gem release :).
Thanks all!