Matlab Code to Plot BLOB in a Binary Image

clc; clear; close all; %Read Input Image BW = imread(‘TestImage.jpg’); %Convert Image to Binary BW=im2bw(BW); % Trace region boundaries in a binary image. [B,L,N,A] = bwboundaries(BW); %Display Images imshow(BW); hold on; for k=1:length(B), if(~sum(A(k,:))) boundary = B{k}; plot(boundary(:,2), boundary(:,1), ‘r’,’LineWidth’,2); … Continue reading

Posted in Matlab Tips and Tracks | Tagged |

Join the World's Largest Technical Community