11.07.2015 Views

Binary Vision

Binary Vision

Binary Vision

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.3 Counting objects -- method 3Classical Connected Components AlgorithmMakes two passes over the imageClassical_connected_components (B, LB) {LB := negate (B);Label := 0;for L:= 0 to MaxRow - 1for P:= 0 to MaxCol - 1if LB[L,P] == -1 then {if L_LAset 0 then{LB[L,P] = Label of LAset}else {label := label + 1;LB[L,P] := label;}}}Print (LB);1 0 0 0 0 0 0 0 0 0 01 1 0 0 0 2 -1 -1 0 0 00 0 0 0 0 -1 0 -1 0 -1 -10 0 0 0 0 0 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!