2011-08-10 72 views
1

是否有任何代碼(特別是Java或C++)或我們導入任何圖像的軟件,並以點的形式給出了該圖像的輪廓,我們可以再次使用JOGL或OPenGL中的這些點來繪製圖像輪廓。圖像輪廓點生成器?

+0

這是爲什麼標籤MATLAB? – Amro

+0

@amro如果我可以在MATLAB中獲得代碼,它也將有所幫助:-) – Riz

+0

請參閱下面的示例 – Amro

回答

0

這裏是一個MATLAB代碼示例:

%# read image 
I = imread('coins.png'); 

%# Convert to a binary image 
BW = im2bw(I, graythresh(I)); 

%# get object boundaries 
BW = imfill(BW,'holes'); 
B = bwboundaries(BW,'noholes'); 

%# plot boundaries overlayed on top of image 
imshow(I), hold on 
for i=1:numel(B) 
    plot(B{i}(:,2), B{i}(:,1), 'Color','g', 'LineWidth',2) 
end 
hold off 

enter image description here