11.07.2015 Views

Binary Vision

Binary Vision

Binary Vision

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.3 Counting objects -- method 2Recursive_connected_components (B, LB) {LB := negate (B);Label := 0;Find_components (LB, label);Print (LB);}Find_components (LB, label) {for L:= 0 to MaxRow - 1for P:= 0 to MaxCol - 1if LB[L,P] == -1 then {label := label + 1;search (LB, label, L, P);}}search (LB, label, L, P) {LB[L,P] := label;Nset := neighbors (L, P);For each [L’, P’] in Nset {If LB[L’, P’] == -1 then search (LB, label, L’, P’);}}1 0 0 0 0 0 0 0 0 0 01 1 0 0 0 1 1 1 0 0 00 0 0 0 0 1 0 1 0 1 10 0 0 0 0 1 0 1 0 0 00 0 1 1 0 1 1 1 0 0 00 1 0 1 0 1 0 1 0 0 00 0 0 1 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 1 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!