You have 2 connected blobs. The one on the left is 8 pixels big (area of 8 pixels). The blob on the right is 3 pixels. When you called bwareaopen, it got rid of blobs less than 4 pixels. Since the blob with an area of 3 is less than 4, it was removed. Does that explain it? It has nothing to do with connectivity here because all your blobs are 4-connected. Now if you had an extra pixel diagonally connected to the blob on the left, like this: A = 0 1 0 0 1 0 0 1 1 0 1 1 0 1 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1 0 0 0 0 Now there are 8 eight connected blobs, but 3 blobs if you consider them as 4 connected. The pixel at row 4 column 4 is 8-connected to the blob on the left, but not 4 connected. It would be removed with bwareaopen(A, 4, 4) but not with bwareaopen(A, 4, 8) because in the second case it's connected while in the first case it's not connected. Answer from Image Analyst on mathworks.com
🌐
MathWorks
mathworks.com › image processing toolbox › image segmentation and analysis › region and image properties
bwareafilt - Extract objects from binary image by size - MATLAB
BW2 = bwareafilt(BW,range) extracts all connected components (objects) from the binary image BW, where the area of the objects is in the specified range, producing another binary image BW2.
🌐
Northwestern University
ece.northwestern.edu › local-apps › matlabhelp › toolbox › images › bwareaopen.html
bwareaopen (Image Processing Toolbox)
BW2 = bwareaopen(BW,P) removes from a binary image all connected components (objects) that have fewer than P pixels, producing another binary image BW2.
🌐
MathWorks
mathworks.com › image processing toolbox › image segmentation and analysis › region and image properties
bwareaopen - Remove small objects from binary image - MATLAB
BW2 = bwareaopen(BW,P) removes all connected components (objects) that have fewer than P pixels from the binary image BW, producing another binary image, BW2.
🌐
MathWorks
mathworks.com › matlabcentral › answers › 40312-sum-or-bwarea
SUM or BWAREA? - MATLAB Answers - MATLAB Central
June 5, 2012 - total = bwarea(BW) estimates the area of the objects in binary image BW.
Find elsewhere
🌐
Mit
lost-contact.mit.edu › afs › inf.ed.ac.uk › group › teaching › matlab-help › R2016b › images › ref › bwareaopen.html
bwareaopen
BW2 = bwareaopen(BW,P) removes all connected components (objects) that have fewer than P pixels from the binary image BW, producing another binary image, BW2. The default connectivity is 8 for two dimensions, 26 for three dimensions, and conndef(ndims(BW), 'maximal') for higher dimensions.
🌐
Stack Overflow
stackoverflow.com › questions › 41499984 › coding-the-bwarea-matlab-function
image processing - Coding the Bwarea matlab function - Stack Overflow
January 6, 2017 - I've been trying to create a bwarea function in MATLAB, I need to write it in Swift but first I need to recreate it in MATLAB. I've read up on the algorithm but it's still confusing and I can't get...
🌐
Stack Overflow
stackoverflow.com › questions › 61555450 › python-equivalent-of-bwarea-from-matlab
Python equivalent of "bwarea" from MATLAB - Stack Overflow
May 2, 2020 - Copydef patternScore(neighborhood): m_sum = 0 m_sum = neighborhood[0,0] + neighborhood[0,1] + neighborhood[1,0] + neighborhood[1,1] if(m_sum == 3): return float(7.0/8.0) elif(m_sum == 0): return 0 elif(m_sum == 1): return float(1.0/4.0) elif(m_sum == 4): return 1 else: if(neighborhood[0][1] == neighborhood[0][0]): return .5 elif(neighborhood[1][0] == neighborhood[0][0]): return .5 else: return .75 def neighbors(im, i, j, d=1): im = np.array(im).astype(int) top_left = im[i-d:i+d, j-d:j+d] top_right = im[i-d:i+d, j:j+d+1] bottom_left = im[i:i+d+1, j-d:j+d] bottom_right = im[i:i+d+1, j:j+d+1] pattern = (patternScore(top_left) + patternScore(top_right) + patternScore(bottom_left) + patternScore(bottom_right)) return pattern def bwarea(img): d = 1 area = 0 for i in range(1,img.shape[0]-1): for j in range(1,img.shape[1]-1): area += neighbors(img,i,j) return area
🌐
Google Groups
groups.google.com › g › comp.soft-sys.matlab › c › yOEqN-SQASQ
bwarea
bwarea_count = bwarea(image); real_area = bw_area_count * .0025;
🌐
MathWorks
blogs.mathworks.com › steve › 2016 › 08 › 22 › binary-image-area-filtering
Binary image area filtering » Steve on Image Processing with MATLAB - MATLAB & Simulink
August 22, 2016 - Well, that discussion had an impact. A few release cycles later, in R2014b, the toolbox development team added a new function: bwareafilt. This function "keeps" a subset of objects in the binary image based on size. There are several ways to define the subset.