Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image features extraction

I have a visual marker like this one and a blob detection algorithm in Java .. How can I extract the regions of the image so that I can run the blob detection algorithm on each one separately so that it can detect 1, 1, 3 blobs respectively.

Thanks a lot in advance !

like image 735
CVirus Avatar asked Mar 21 '26 07:03

CVirus


1 Answers

That's a fun detection game. You will need a few morphological tools so as to solve it.

Since your goal is to detect valid d-touch pictures, you may want to organize your analysis differently. For example, with Mathematica:

enter image description here

Detecting whether a black region encloses at least 3 white regions by filling the holes of the image and counting the number of connected components:

Max@MorphologicalComponents[
        FillingTransform[DeleteBorderComponents@img]] >= 3

enter image description here

Detecting whether half of these white regions contain one or more black regions can be done by counting holes inside each white region:

comp = ComponentMeasurements[DeleteBorderComponents@img, "Holes"]; 
2*Count[comp, _ -> n_ /; n > 0] >= Length@comp

enter image description here

Detecting whether there are further levels of nesting can be achieved by querying for the number of enclosed components:

Count[
  ComponentMeasurements[DeleteBorderComponents@img, "EnclosingComponentCount"],
  _ -> n_ /; n > 0] == 0

enter image description here

Some of the operations above may be tricky to implement in Java. I shall pass on that one -- done with the fun part!

like image 152
Matthias Odisio Avatar answered Mar 22 '26 20:03

Matthias Odisio



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!