Dear List,
I am using a camera with a fisheye lens for motion detection. The distortion had to be corrected with a shader (method from Matlab) but now I need to rotate the image and crop it with pix_crop plus analyze the frames with pix_movement. How can I get back the image to Gem? In my patch gemframebuffer send the image to the shader but not a clue how I could ise the pix_ objects again.
[image: Screenshot 2021-02-14 at 17.27.12.png]
This is the corrected image from the camera after shader [image: Grid corrected.jpeg]
Let me know please where I miss something.
Best,
Popesz
hello, have a look at pix_snap (be aware that this is a relatively slow process)
cheers C
Le 14/02/2021 à 17:29, Csaba Láng a écrit :
Dear List,
I am using a camera with a fisheye lens for motion detection. The distortion had to be corrected with a shader (method from Matlab) but now I need to rotate the image and crop it with pix_crop plus analyze the frames with pix_movement. How can I get back the image to Gem? In my patch gemframebuffer send the image to the shader but not a clue how I could ise the pix_ objects again.
Screenshot 2021-02-14 at 17.27.12.png
This is the corrected image from the camera after shader Grid corrected.jpeg
Let me know please where I miss something.
Best,
Popesz
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I used pix_snap before for correction but it was a hand made correction, while with the shader I can make it automatic and more accurate.Can it be this too (shader and Gem) somehow connected?
On Sun, Feb 14, 2021 at 5:46 PM cyrille henry ch@chnry.net wrote:
hello, have a look at pix_snap (be aware that this is a relatively slow process)
cheers C
Le 14/02/2021 à 17:29, Csaba Láng a écrit :
Dear List,
I am using a camera with a fisheye lens for motion detection. The distortion had to be corrected with a shader (method from Matlab)
but now I need to rotate the image and crop it with pix_crop plus analyze the frames with pix_movement.
How can I get back the image to Gem? In my patch gemframebuffer send the image to the shader but not a clue
how I could ise the pix_ objects again.
Screenshot 2021-02-14 at 17.27.12.png
This is the corrected image from the camera after shader Grid corrected.jpeg
Let me know please where I miss something.
Best,
Popesz
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 2/14/21 5:49 PM, Csaba Láng wrote:
I used pix_snap before for correction but it was a hand made correction, while with the shader I can make it automatic and more accurate.Can it be this too (shader and Gem) somehow connected?
[glsl_program] + ([glsl_fragment], [glsl_vertex], ...)?
fgmasr IOhannes
What do you mean?
Too much?
On Sun, 14 Feb 2021 at 19:14, IOhannes m zmölnig zmoelnig@iem.at wrote:
On 2/14/21 5:49 PM, Csaba Láng wrote:
I used pix_snap before for correction but it was a hand made correction, while with the shader I can make it automatic and more accurate.Can it be this too (shader and Gem) somehow connected?
[glsl_program] + ([glsl_fragment], [glsl_vertex], ...)?
fgmasr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 2/14/21 8:17 PM, Csaba Láng wrote:
What do you mean?
Too much?
i think you have lost me.
you wrote:
Can it be this too (shader and Gem) somehow connected?
which i translated to:
Can I somehow run shaders in Gem?
to which i replied (in a rather brusque way) by mentioning the Gem-objects that allow you to load and execute shaders within Gem.
i don't know what "Too much?" would refer to. i'm not even sure whether my translation of your question about shaders and Gem is correct (actually, i'm pretty sure it is plain wrong)
actually, i'm quite confused about your entire reply on cyrille's [pix_snap] suggestion. relating [pix_snap] to manual correction and shaders to automatic correction just doesn't make sense to me.
so you probably should re-phrase that part (or just ignore my answer completely).
fgmds IOhannes
anyhow: i still agree with cyrille that the answer to your question "how to read back an image from a shader in Gem?" is: [pix_snap]. but that answer (just as my snarky answer) assumes that you run the shader *within* Gem.
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do this...
cheers Miller
On Sun, Feb 14, 2021 at 08:57:19PM +0100, IOhannes m zm??lnig wrote:
On 2/14/21 8:17 PM, Csaba L??ng wrote:
What do you mean?
Too much?
i think you have lost me.
you wrote:
Can it be this too (shader and Gem) somehow connected?
which i translated to:
Can I somehow run shaders in Gem?
to which i replied (in a rather brusque way) by mentioning the Gem-objects that allow you to load and execute shaders within Gem.
i don't know what "Too much?" would refer to. i'm not even sure whether my translation of your question about shaders and Gem is correct (actually, i'm pretty sure it is plain wrong)
actually, i'm quite confused about your entire reply on cyrille's [pix_snap] suggestion. relating [pix_snap] to manual correction and shaders to automatic correction just doesn't make sense to me.
so you probably should re-phrase that part (or just ignore my answer completely).
fgmds IOhannes
anyhow: i still agree with cyrille that the answer to your question "how to read back an image from a shader in Gem?" is: [pix_snap]. but that answer (just as my snarky answer) assumes that you run the shader *within* Gem.
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Thanks Miller, indeed this is exactly what I am looking for. Fighting with pix_snap no images coming to the texture. Is anybody interested in the shader? Should I share the folder?
Popesz
On Mon, 15 Feb 2021 at 00:30, Miller Puckette via Pd-list < pd-list@lists.iem.at> wrote:
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do this...
cheers Miller
On Sun, Feb 14, 2021 at 08:57:19PM +0100, IOhannes m zm??lnig wrote:
On 2/14/21 8:17 PM, Csaba L??ng wrote:
What do you mean?
Too much?
i think you have lost me.
you wrote:
Can it be this too (shader and Gem) somehow connected?
which i translated to:
Can I somehow run shaders in Gem?
to which i replied (in a rather brusque way) by mentioning the
Gem-objects
that allow you to load and execute shaders within Gem.
i don't know what "Too much?" would refer to. i'm not even sure whether my translation of your question about shaders
and
Gem is correct (actually, i'm pretty sure it is plain wrong)
actually, i'm quite confused about your entire reply on cyrille's
[pix_snap]
suggestion. relating [pix_snap] to manual correction and shaders to automatic
correction
just doesn't make sense to me.
so you probably should re-phrase that part (or just ignore my answer completely).
fgmds IOhannes
anyhow: i still agree with cyrille that the answer to your question "how
to
read back an image from a shader in Gem?" is: [pix_snap]. but that answer (just as my snarky answer) assumes that you run the
shader
*within* Gem.
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 2/14/21 9:52 PM, Miller Puckette via Pd-list wrote:
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do this...
[pix_snap2tex] or, preferably [gemframebuffer].
gfamsdr IOhannes
What I understand from the original question was how to feed an image generated with a shader to pix_movement. So one need an image, not a texture. I'm afraid pix_snap is the only solution.
Cheers c
Le 15/02/2021 à 08:39, IOhannes m zmoelnig a écrit :
On 2/14/21 9:52 PM, Miller Puckette via Pd-list wrote:
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do this...
[pix_snap2tex] or, preferably [gemframebuffer].
gfamsdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I am totally lost, I attach my shader and the patch which I made the screenshot of at the beginning of this thread. Could someone show me how to achieve the texture on a rectangle 16 9 so I can rotate and crop it and not only as a mask, as it is now in the patch.
Probably totally easy just cannot figure out how to add the pix_snap or pix_snap2tex
On Mon, Feb 15, 2021 at 10:04 AM cyrille henry ch@chnry.net wrote:
What I understand from the original question was how to feed an image generated with a shader to pix_movement. So one need an image, not a texture. I'm afraid pix_snap is the only solution.
Cheers c
Le 15/02/2021 à 08:39, IOhannes m zmoelnig a écrit :
On 2/14/21 9:52 PM, Miller Puckette via Pd-list wrote:
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do
this...
[pix_snap2tex] or, preferably [gemframebuffer].
gfamsdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
you can replace [pix_draw] with [pix_texture] and [rectangle 16 9] But I don't think I understand the question.
cheers c
Le 15/02/2021 à 10:44, Csaba Láng a écrit :
I am totally lost, I attach my shader and the patch which I made the screenshot of at the beginning of this thread. Could someone show me how to achieve the texture on a rectangle 16 9 so I can rotate and crop it and not only as a mask, as it is now in the patch.
Probably totally easy just cannot figure out how to add the pix_snap or pix_snap2tex
On Mon, Feb 15, 2021 at 10:04 AM cyrille henry <ch@chnry.net mailto:ch@chnry.net> wrote:
What I understand from the original question was how to feed an image generated with a shader to pix_movement. So one need an image, not a texture. I'm afraid pix_snap is the only solution. Cheers c Le 15/02/2021 à 08:39, IOhannes m zmoelnig a écrit : > On 2/14/21 9:52 PM, Miller Puckette via Pd-list wrote: >> I think the question is - within a shader, can you 'snap' an image to >> a texture so that it doesn't have to go back and forth between the >> GPU and CPU? I'm curious too... I guess there must be a way to do this... > > > [pix_snap2tex] > or, preferably [gemframebuffer]. > > gfamsdr > IOhannes > > > _______________________________________________ > Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list > UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list _______________________________________________ Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
cyrille henry wrote:
What I understand from the original question was how to feed an image generated with a shader to pix_movement. So one need an image, not a texture. I'm afraid pix_snap is the only solution.
on a more general note:
it would be great to have something like a public [GEM-shader] archive, probably something like pdpatchrepo.info
should we open a new category there ? or maybe that already exists and i missed it ? anybody else on this list that has some GEM shaders to share ?
i have the feeling that a lot of people using GEM "roll their own" shaders (i, for one, did) and it would be a great thing to join forces, so one doesn't have to reinvent the wheel when looking for a simple "brightness/contrast" shader ...
my own technical knowledge about shader scripting is close to non-existant, but i succeeded in adapting stuff found on the net, so that it loads as a shader in GEM. basic stuff only, mixers etc ...
since csaba's original post talks about cropping/rotating a texture created from a MATLAB shader (would be also great to share !), one possibility could be to feed this texture into another shader.
i tried my clumsy hands on a quick and dirty adaption of MAX's [rota] shader, and even though it loads succesfully, it's obviously wrong as the resulting texture seems to be 1x1 dimension. i'm sure the error is somewhere in the .vert part.
as i said, i got no deep insight into shader scripting, but maybe this can help somebody who has
best
oliver
Cheers c
Le 15/02/2021 à 08:39, IOhannes m zmoelnig a écrit :
On 2/14/21 9:52 PM, Miller Puckette via Pd-list wrote:
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do this...
[pix_snap2tex] or, preferably [gemframebuffer].
gfamsdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Le 15/02/2021 à 10:46, oliver a écrit :
cyrille henry wrote:
What I understand from the original question was how to feed an image generated with a shader to pix_movement. So one need an image, not a texture. I'm afraid pix_snap is the only solution.
on a more general note:
it would be great to have something like a public [GEM-shader] archive, probably something like pdpatchrepo.info
should we open a new category there ? or maybe that already exists and i missed it ? anybody else on this list that has some GEM shaders to share ?
lot's have already been send on this list!
i have the feeling that a lot of people using GEM "roll their own" shaders (i, for one, did) and it would be a great thing to join forces, so one doesn't have to reinvent the wheel when looking for a simple "brightness/contrast" shader ...
funny, this one can be found in pd/help/browser/Gem/exemples/10.glsl/01.simple_texture.pd
my own technical knowledge about shader scripting is close to non-existant, but i succeeded in adapting stuff found on the net, so that it loads as a shader in GEM. basic stuff only, mixers etc ...
it's quite easy to use shader from shadertoy, at least when it's a single pass rendering.
since csaba's original post talks about cropping/rotating a texture created from a MATLAB shader (would be also great to share !), one possibility could be to feed this texture into another shader.
or modify the curent shader!
i tried my clumsy hands on a quick and dirty adaption of MAX's [rota] shader, and even though it loads succesfully, it's obviously wrong as the resulting texture seems to be 1x1 dimension. i'm sure the error is somewhere in the .vert part.
or texturing mode (rectangular or not)
cheers c
as i said, i got no deep insight into shader scripting, but maybe this can help somebody who has
best
oliver
Cheers c
Le 15/02/2021 à 08:39, IOhannes m zmoelnig a écrit :
On 2/14/21 9:52 PM, Miller Puckette via Pd-list wrote:
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do this...
[pix_snap2tex] or, preferably [gemframebuffer].
gfamsdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
should we open a new category there ? or maybe that already exists and i missed it ? anybody else on this list that has some GEM shaders to share ?
lot's have already been send on this list!
i will recheck the archives. still, i think a central spot on the web containing GEM-ready shaders would be great, instead of having to dig through mailing lists.
if i have the time and do some more research i guess i'll start one on github
i have the feeling that a lot of people using GEM "roll their own" shaders (i, for one, did) and it would be a great thing to join forces, so one doesn't have to reinvent the wheel when looking for a simple "brightness/contrast" shader ...
funny, this one can be found in pd/help/browser/Gem/exemples/10.glsl/01.simple_texture.pd
haha, right. bad example ;-) so make that "looking for a simple [threshold] shader" ...
it's quite easy to use shader from shadertoy, at least when it's a single pass rendering.
thanks, i will do some research
the resulting texture seems to be 1x1 dimension. i'm sure the error is somewhere in the .vert part.
or texturing mode (rectangular or not)
tried that already, but it must be something else. anyway, thanks for all hints !
best
oliver
Snap a render scene as a texture, [gemframebuffer] is the way to go (for me). You render your scene as usual, just replace the [gemhead] with :
[gemhead] | [gemframebuffer] | [translateXYZ 0 0 -4] | ...
hop, you can grap the scene below [translateXYZ 0 0 -4] as a texture with the right outlet of [gemframebuffer]. ++
Jack
Le 15/02/2021 à 08:39, IOhannes m zmoelnig a écrit :
On 2/14/21 9:52 PM, Miller Puckette via Pd-list wrote:
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do this...
[pix_snap2tex] or, preferably [gemframebuffer].
gfamsdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 2/14/21 21:52, Miller Puckette via Pd-list wrote:
I think the question is - within a shader, can you 'snap' an image to a texture so that it doesn't have to go back and forth between the GPU and CPU? I'm curious too... I guess there must be a way to do this...
of course that' s possible.ther e's a couple of examples in Gem /examples/10.gl sl/, notably fr om 08.multi_pas s_rendering.pd through to 10.G PGPU_Physical_m odel.pd
however, this is rea lly only a pretext f or what i actually w ant to say:
happy birthday. happy patching.
cheers, nmgfest IOhannes