help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave function for matlab's bwareopen?


From: uwfydp
Subject: Re: octave function for matlab's bwareopen?
Date: Fri, 16 Mar 2012 22:49:19 -0700 (PDT)

so i have given it a shot, but not getting the reuslts i wanted. can someone
take a look at it? also i know it is not the most efficient way. but i just
wanted somehting that works

bw_im = imread('threshold_image.png');
objects = bwconncomp(binary_im);
numObjects = objects.NumObjects;
pixelList = objects.PixelIdxList;
minPixels = 10;
for j=1:numObjects
        pixels = size(pixelList{j,1});
        if  pixels < minPixels
                for l=1:pixels
                        Y = mod(pixelList{j,1}(l,1),640);
                        X = floor(pixelList{j,1}(l,1)/640);
                        binary_im(X+1,Y+1) = 0;
                end
        end
end

*Binary Image*
http://octave.1599824.n4.nabble.com/file/n4480118/binary_image.png 

*Opened image*
http://octave.1599824.n4.nabble.com/file/n4480118/opened_image.png 

--
View this message in context: 
http://octave.1599824.n4.nabble.com/octave-function-for-matlab-s-bwareopen-tp4465078p4480118.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]