clear
filename = '1.jpg';
lena = imread(filename); % 读入一幅彩色图像
I=imresize(lena,0.125,'bicubic');
height= size(I, 1);
width = size(I, 2);
M_PI = 3.14159265358979323846;
M_PI_2 = 1.57079632679489661923;
for i=1:height
for j=1:width
x_pos = j / width * (2 * M_PI) - M_PI;
y_pos = i / height * (M_PI)-M_PI_2;
Nx = cos(y_pos) * cos(x_pos);
Ny = cos(y_pos) * sin(x_pos);
Nz = sin(y_pos);
angle_x = 0 * M_PI / 180.0;
angle_y = 0 * M_PI / 180.0;
x = Nx;
y = Ny;
z = Nz;
x_ = x;
y_ = y * cos(angle_x) - z * sin(angle_x);
z_ = y * sin(angle_x) + z * cos(angle_x);
Nx = z_ * sin(angle_y) + x_ * c
从平面坐标转球面坐标加旋转
最新推荐文章于 2024-06-29 11:41:21 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)