Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 在极坐标MATLAB中改变变换/映射中心_Image_Matlab_Transformation_Coordinate - Fatal编程技术网

Image 在极坐标MATLAB中改变变换/映射中心

Image 在极坐标MATLAB中改变变换/映射中心,image,matlab,transformation,coordinate,Image,Matlab,Transformation,Coordinate,应用以下代码后,我得到了从中心顶点开始的输出映射图像。如何将起点放在左下角?因此,输出图像应该从左下角点开始拉伸(而不是像现在这样从顶部中心拉伸) im = imread ('peppers.png'); im = rgb2gray(im); [nZ,nX] = size(im); theta = ((0:(nX-1))-nX/2)*(0.1*(pi/180)) - pi/2; rr = (0:(nZ-1))*0.1e-3; %% Plot image in rectangular coor

应用以下代码后,我得到了从中心顶点开始的输出映射图像。如何将起点放在左下角?因此,输出图像应该从左下角点开始拉伸(而不是像现在这样从顶部中心拉伸)

im = imread ('peppers.png');
im = rgb2gray(im);
[nZ,nX] = size(im); 
theta = ((0:(nX-1))-nX/2)*(0.1*(pi/180)) - pi/2;
rr = (0:(nZ-1))*0.1e-3;

%% Plot image in rectangular coordinates
figure
imagesc(theta*(180/pi), rr*1e3, im)
xlabel('theta [deg]')
ylabel('r [mm]')

%% Create grids and convert polar coordinates to rectangular
[THETA,RR] = meshgrid(theta,rr);
[XX,YY] = pol2cart(THETA,RR);

%% Plot as surface, viewed from above
figure
surf(XX*1e3,YY*1e3,im,'edgecolor','none')
view(0,90)
xlabel('x [mm]')
ylabel('y [mm]')