Loren on the Art of MATLAB

End of Year Suggestion: Steve on Counting

Posted by Loren Shure,

I just read the latest post on Steve Eddins image processing blog. I recommend you read it too. It discusses how to count objects in an image without introducing bias. It would be easy to count all the blobs you see, including partial ones cut by the border. But that would be an overestimate. So how do we get a better estimate?

Contents

Counting Via Each "Lower Right Corner"

The first technique Steve discusses is one I am familiar with already. The basic idea is to count all objects that don't touch any edges of the image, and only count objects if they touch two adjacent edges, say the north and west ones, equivalent to counting objects via the "lower right corner". That will, statistically speaking, give you an unbiased estimate of the count.

Weighted Count of Interior Objects

The second method instead does a weighted count of only the objects that touch no edges. The weighting accounts for the relative likelihood for an object of that size to encounter an edge from a particular view. See Steve's code and explanation to learn more of the details.


Get the MATLAB code

Published with MATLAB® R2012b

Comments are closed.

These postings are the author's and don't necessarily represent the opinions of MathWorks.