0
我有一個形象的標記像素和我選擇,我希望把一個標記上他們10個像素狀況做了一個形象
rasterpoints = xlsread('coordinates_sat3.xlsx'); %# 10 pair of coordinates of pixels on my image
diff_win_spr %# 10x1 vector with positive and negative values
現在我想不同的一種標誌物在我的形象插入根據在diff_win_spr的cellvalue是正或負
marker1 = 'o';
marker2 = '+';
for ii=1:10
if diff_win_spr(ii)<0;
for ii=1:10;
rastermarkers=insertMarker(a,rasterpoints(ii,:),marker1,'size', 10);%%% if diff_win_spr is negative I want marker1 in the rasterpoint position on the image a
end
else diff_win_spr(ii)>0;
for ii=1:10;
rastermarkers=insertMarker(a,rasterpoints(ii,:),marker2,'size', 10);%%% if diff_win_spr is positive I want marker2 in the rasterpoint position on the image a
end
end
end
我的輸出圖像只顯示我的第10個標記(用正確的符號bytheway)
c=imshow(rastermarkers)
%imwrite(b,'sat_mark.tif','WriteMode','append');
感謝...這是一個此症,但現在我的輸出圖像是10 MARKER1 10 MARKER2 overwrited。你懷疑爲什麼? 它看起來像條件不起作用。 – rochinha44
@ rochinha44:我看到第一個錯誤,並沒有完成讀取你的代碼,假設只有一個。你有兩個嵌套循環,都使用相同的迭代器'ii'。這是不對的。我會更新我的答案。 – Daniel