Skip to main content
. 2019 Apr 6;5(4):45. doi: 10.3390/jimaging5040045
Algorithm 1 Zig-zag CCA algorithm
Input: Binary image I of width W and height H
Output: A feature vector for each connected component in I
  • 1:

    StartOfLine:=False

  • 2:

    fory:=0toH1do

  • 3:

       for x:=0 to W1 when y is even else x:=W1 downto 0 do ▹ Zig-zag scan

  • 4:

         if StartOfLine then

  • 5:

            ReverseNeighbourhood                     ▹ Algorithm 3

  • 6:

            StartOfLine:=False

  • 7:

         else

  • 8:

            UpdateNeighbourhood                     ▹ Algorithm 2

  • 9:

         end if

  • 10:

         UpdateDataStructures                     ▹ Algorithm 4

  • 11:

       end for

  • 12:

       StartOfLine:=True

  • 13:

    end for