0

I am implementing a simple computer vision system in java. It extracts shapes from an image. Which are generally circular or oval in shape. I have it working to the point where it can create a binary image consisting of only the features I want to analyse. I can find the area of a single feature easily enough by counting the number of white pixels in the image. However if there are multiple features it would find the area of all the features combined.

I was wondering if someone would know how to implement a method to extract/detect multiple features, then I could find the area etc on each easily enough.

I have found information on how to do this with openCV, however I cant find information on how to actually implement a method for myself, or even the theory behind how to achieve it.. It doesnt need to be terribly advanced, even a simple example would be fine.

Any advice would be greatly appreciated!

user808359
  • 31
  • 1
  • 4

1 Answers1

5

I'm assuming that all of your 'features' are properly connected (4- or 8-connected). If that's the case, the algorithm you're looking for would fall under the umbrella of connected component labelling. You can implement the two-pass algorithm described in pseudocode there as a solid beginning.

aardvarkk
  • 14,955
  • 7
  • 67
  • 96