- #1
Amirps
- 2
- 0
Hi ,
I came across a problem ,I've search a lot but couldn't exactly find the solution.
here is my problem:
suppose there is an image ( I call it IMG_A),place IMG_A in the X-Y plane , put a mirror cylinder at the center of IMG_A. what we see in the cylinder mirror is a deform image (I call it IMG_B) . what I try to achieve by this program is IMG_B.
I've already write a piece of code in Matlab using this equation
for i=1:IMG_A_Width
for j=1:IMG_A_Height
cy(i,j,1)=cyradius*cos(i*(2*pi/IMG_A_Width)) ;%cylinder X
cy(i,j,2)=cyradius*(sin(i*(2*pi/IMG_A_Width)));%cylinder Y
cy(i,j,3)=j*(cyHeight/IMG_A_Height) ;%cylinder Z
cy(i,j,4)=IMG_A(i,j);%cylinder image
end
end
but this is not exactly what I want ,this program just wrap the IMG_A around the cylinder. in other words the warping is in the horizontal direction.would you please be kind enough helping me to understand the equation I need to write this program?
I came across a problem ,I've search a lot but couldn't exactly find the solution.
here is my problem:
suppose there is an image ( I call it IMG_A),place IMG_A in the X-Y plane , put a mirror cylinder at the center of IMG_A. what we see in the cylinder mirror is a deform image (I call it IMG_B) . what I try to achieve by this program is IMG_B.
I've already write a piece of code in Matlab using this equation
for i=1:IMG_A_Width
for j=1:IMG_A_Height
cy(i,j,1)=cyradius*cos(i*(2*pi/IMG_A_Width)) ;%cylinder X
cy(i,j,2)=cyradius*(sin(i*(2*pi/IMG_A_Width)));%cylinder Y
cy(i,j,3)=j*(cyHeight/IMG_A_Height) ;%cylinder Z
cy(i,j,4)=IMG_A(i,j);%cylinder image
end
end
but this is not exactly what I want ,this program just wrap the IMG_A around the cylinder. in other words the warping is in the horizontal direction.would you please be kind enough helping me to understand the equation I need to write this program?