Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Place texture using a given UV Buffer

Hi to every one, this is my first try on OpenCV and seems to be awesome, but now I'm facing to the first problem I cannot solve looking at the help manual or the forums.

I wanna change a texture by reprojecting it like in this image: http://www.andvfx.com/wp-content/uploads/2012/12/3-objectes.jpg

That's trivial on OpenGL shaders since they compute by their own the derivatives etc, so you can just read the pixel value of the uv buffer and read the pixel placed at that x,y coordinates, since OpenGL takes care of selecting the mipmap, make a good mixing for shallow angles etc.

Meanwhile I only manage to read the pixel on OpenCV or at most I can blend it with the contiguous one.

click to hide/show revision 2
No.2 Revision

updated 2015-02-04 05:22:08 -0600

berak gravatar image

Place texture using a given UV Buffer

Hi to every one, this is my first try on OpenCV and seems to be awesome, but now I'm facing to the first problem I cannot solve looking at the help manual or the forums.

I wanna change a texture by reprojecting it like in this image: http://www.andvfx.com/wp-content/uploads/2012/12/3-objectes.jpg![http://www.andvfx.com/wp-content/uploads/2012/12/3-objectes.jpg] (http://www.andvfx.com/wp-content/uploads/2012/12/3-objectes.jpg)

That's trivial on OpenGL shaders since they compute by their own the derivatives etc, so you can just read the pixel value of the uv buffer and read the pixel placed at that x,y coordinates, since OpenGL takes care of selecting the mipmap, make a good mixing for shallow angles etc.

Meanwhile I only manage to read the pixel on OpenCV or at most I can blend it with the contiguous one.

click to hide/show revision 3
No.3 Revision

updated 2015-02-04 05:23:13 -0600

berak gravatar image

Place texture using a given UV Buffer

Hi to every one, this is my first try on OpenCV and seems to be awesome, but now I'm facing to the first problem I cannot solve looking at the help manual or the forums.

I wanna change a texture by reprojecting it like in this image: ![http://www.andvfx.com/wp-content/uploads/2012/12/3-objectes.jpg] (http://www.andvfx.com/wp-content/uploads/2012/12/3-objectes.jpg)image:

image description

That's trivial on OpenGL shaders since they compute by their own the derivatives etc, so you can just read the pixel value of the uv buffer and read the pixel placed at that x,y coordinates, since OpenGL takes care of selecting the mipmap, make a good mixing for shallow angles etc.

Meanwhile I only manage to read the pixel on OpenCV or at most I can blend it with the contiguous one.

Place texture using a given UV Buffer

Hi to every one, this is my first try on OpenCV and seems to be awesome, but now I'm facing to the first problem I cannot solve looking at the help manual or the forums.

I wanna change a texture by reprojecting it like in this image:

image description

That's trivial on OpenGL shaders since they compute by their own the derivatives etc, so you can just read the pixel value of the uv buffer and read the pixel placed at that x,y coordinates, since OpenGL takes care of selecting the mipmap, make a good mixing for shallow angles etc.

Meanwhile I only manage to read the pixel on OpenCV or at most I can blend it with the contiguous one.

EDIT maybe my question was too ambiguous, I was asking about how to make this on OpenCV without OpenGL calls.

Using OpenGL I should draw a simple rectangle and use as fragmented shader this pseudo-code:

float2 newUV=texture(UVgbufferTex,gl_TexCoord[0]).xy; float3 finalcolor=texture(DIFFgbufferTex,newUV);

return float4(finalcolor,0);

OpenGL takes care about selecting the mipmap level, the anisotropic filtering etc, meanwhile if I make this on OpenCV I get a single pixel for finalcolor so my result is crisp.

Regards, and thank you in advance.