Info

此问题已关闭。 请重新打开它进行编辑或回答。

how can i compare the colors and then perform action OR is there any other way to do the comparison and then perform desired action

1 次查看(过去 30 天)
ia=imread('redline.tif');
image=im2bw(ia);
%imshow(j);
[row,column]=size(image);
grid = zeros(rows,column);
for i=1:rows
for j=1:column
if(image(i,j)==1)
grid(i,j)=1;
end
end
end
display(grid);
  3 个评论
Walter Roberson
Walter Roberson 2015-12-18
Please do not use "image" as a variable name, as that interferes with using image() as a basic MATLAB function, and confuses other people who read the code.

回答(1 个)

Walter Roberson
Walter Roberson 2015-12-18
grid = double(image==1);

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by