本文共 382 字,大约阅读时间需要 1 分钟。
hImage = plot3(vertex1(:,1),vertex1(:,2),zeros(size(vertex1,1),1),'.');direction = [0 0 1];rotate(hImage,direction,90)axis off;view(2);f=getframe;%imshow(f.cdata);new=f.cdata;imwrite(new,'new.jpg','JPEG')RGB = imread('new.jpg');I = rgb2gray(RGB);imshow(I);BW = imbinarize(I);BWC = imcomplement(BW)BWC2= imfill(BWC,'holes');BW2 = imcomplement(BWC2);figureimshowpair(BW,BW2,'montage')