Size of data points in random scatter image
2 views (last 30 days)
I have produced a graph/image which is a random plot containing thousands of dark and light patches. My next task is to evaluate the size of these patches.
I am wandering if anyone is aware of a method for determining the average size of a dark/light patch in the image?
Early on in the process so not had too much break through.
Any suggestions would be hugely welcome.
Matt Kindig on 12 Jun 2013
This is actually a relatively straightforward process. Steps:
1. Threshold image to convert to black and white. im2bw() function
2. Calculate area of each light (now white) patch: regionprops() function.
3. Extract area and find average size (in number of pixels): mean() function.
For the dark patches, do the same steps, but thresholding for dark rather than light patches.
More Answers (1)
Image Analyst on 12 Jun 2013
Might be as easy as Matt says, or might be tougher, depending on what your image looks like and how you define light and dark. Are there just 3 gray levels: one for light, one for background, and one for dark? Or are there lots of gray levels, up to 256 or even more? Can you post an image. The simplest would be to just label the image (to count the patches) and calculate the area and divide by the number of patches:
binaryImage = grayImage > 100; % or whatever.
[labeledImage, numberOfBlobs] = bwlabel(binaryImage);
meanArea = sum(double(binaryImage))/numberOfBlobs;