MATLAB: Segmentation of PCB iamge line and pad segmentspcb imagesegmentation Hello! Please help me. I want to segment the PCB image "3(template).jpg" into line and pad segments. How do we segment this image. Best Answer Hi Check this code,clcclear all;close all;%% rgb=imread('im.jpeg');gray=rgb2gray(rgb);bw=im2bw(~gray,0.2);clrb=imdilate(bw,strel('disk',2,4));I=rgb(:,:,1);BW=clrb;[nbwl,cnt]=bwlabel(BW);msk=zeros(2020,2020);for i=1:cnt fhls=find(nbwl==i); msk(fhls)=i; seg=label2rgb(msk); st=i; imwrite(seg,sprintf('%d.jpg',i)) imshow(seg) pause(0.8); drawnow()end Results: Related SolutionsMATLAB: How to increase or decrese graythresh value store graythresh(Igray) in a variable and increase/ descrease as u want! MATLAB: Overlay binary image on RGB image Is this?RGB_image=imread('image_test.jpg');subplot(311);imshow(RGB_image);bw_image=im2bw(rgb2gray(RGB_image));subplot(312);imshow(bw_image);result=imfuse(RGB_image,bw_image);subplot(313);imshow(result);Detail documentation here Related QuestionGetting Spots in bananaHow to recover to original image after i changed to gray levelHow to handle montage imageHow to store pixels of MxN bitmap image into MxN arrayPlotting Pixels of an Image and Finding Minimum Value
Best Answer