Hi I would appreciate if you answer my questions. I have attached the image. I have found the boundary of it. However, I just wanna find the boundary of last 30 percent of it. ( more or less) just wanna know how I can adjust the boundary and process the image from the part where exactly I am interested. When I find the last 30 percent of the boundary, I have a couple of images, I would like the see how the pixel density is changing at the end of the object ( 30 percent is just hypothetically). I hope my question is clear and appropriate to answer.
clear all;clc;B = imread('08.png'); bwImage = imbinarize(B,0.5);bigMask = bwImage;[ a, b ]=size(bigMask);for i=1:a for j=1:b c = bigMask(i,j); if c == 1 bigMask(i,j)=0; end if c == 0 bigMask(i,j)=1; end endend[B, L ,N] = bwboundaries(bigMask);boundaries = bwboundaries(bigMask);boundary1=cell2mat(boundaries(1));x = boundary1(:,1);y = boundary1(:,2);figure;imshow ('08.png');hold onplot(y,x,'r','LineWidth',1)axis on
Best Answer