Per = bwperim(img);
[r,c]=size(Per); p=1; z = nnz(Per); cord = zeros(z,2); for i=1:r for j=1:c if (Per(r,c)) == 1 cord(p,1)=i; cord(p,2)=j; p=p+1; p=p+1; end end end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!