如何获取x,y坐标以挤出图像

时间:2018-03-09 16:45:28

标签: matlab image-processing 3d 2d coordinates

我正在尝试检测图像的边缘(2D图像)并挤出图像的边缘(3D图像)。我可以使用

简单地挤出一个随机的x,y坐标
x = randi(100,1,5);
y = randi(100,1,5);
x = x([1:end 1]);
y = y([1:end 1]);
bw = poly2mask(x,y,100,100);
figure;
subplot(121);
plot(x,y)
[xg,yg] = meshgrid(1:100);
zg = bw * 2;
subplot(122);
surfl(xg,yg,zg)

我还可以使用以下坐标

从像素图像中获取坐标的x,y值
A=double(imread('F:\01.jpg'));
imshow(A)
[height, width] = size(A)
[x, y] = meshgrid(1:width, 1:height);

但我无法将此x,y值用作挤出的输入x,y值。请帮我。提前致谢。

0 个答案:

没有答案