小编use*_*472的帖子

如何在matlab中将图像的像素坐标x和y转换为图像?

我有一组向量x和y,它包含图像的像素坐标.我需要使用Matlab将这些值转换为图像.我该如何使用这些值?哪个功能最适合它?我使用的代码是:

I = imread('D:\majorproject\image\characters\ee.jpg');

imshow(I)

BW =im2bw(I);

BW=imcomplement(BW);

imshow(BW)

dim = size(BW);

col = round(dim(2)/2)-90;

row = find(BW(:,col), 1 );

boundary = bwtraceboundary(BW,[row, col],'N');

imshow(I)

hold on;

plot(boundary(:,2),boundary(:,1),'0','LineWidth',3);

BW_filled = imfill(BW,'holes');

boundaries = bwboundaries(BW_filled);

for k=1:10

   b = boundaries{k};

   plot(b(:,2),b(:,1),'g','LineWidth',3);
end
Run Code Online (Sandbox Code Playgroud)

从中我得到了坐标值.谢谢.

matlab pixel image-processing coordinates

0
推荐指数
1
解决办法
6487
查看次数

标签 统计

coordinates ×1

image-processing ×1

matlab ×1

pixel ×1