Polar plot matlab r2013a6/18/2023 ![]() %# Z-coordinates: I'm using Z=0 for all points, but could be anything %# deformed 2D points (we dont need to know f, just load U/V here) = imresize(img.X, img.map, size(X), 'bicubic') %# initial grid (here 1/5-th the size, but could be anything) Img = load('clown') %# indexed color image Here is an example of texture mapping using the surface function: %# image and 2D grid of points of the same size as the image % sample the texture on the deformed grid % define original grid based on image size Using normalized coordinates makes it easier. ![]() ![]() Here's some example code showing how to do this with real data. On the other hand, if you want to map the "deformed" texture back to a regularly spaced grid, use griddata: = meshgrid(1:N2,1:M2) To interpolate the original texture at, use: z2 = interp2(x,y,z,u,v) Let's say that the texture samples are in z and you want new samples z2. I think you are asking to get samples of the original texture at.
0 Comments
Leave a Reply. |