convert RGB image with hole into binary image with hole filled

来源:互联网 发布:sql中is not null 编辑:程序博客网 时间:2024/06/05 04:19

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')



0 0
原创粉丝点击