Content deleted Content added
No edit summary |
Changed "occupied" to "label", added clarification on on the "labels" array, different from the "label" array, which is the resulting array. |
||
Line 30:
'''Raster Scan and Labeling on the Grid'''
largest_label = 0;
label = zeros[n_columns, n_rows]
labels = [0:n_columns*n_rows] /* Array containing integers from 0 to the size of the image. */
for x in 0 to n_columns {
for y in 0 to n_rows {
if occupied[x, y] then
left =
above =
if (left == 0) and (above == 0) then /* Neither a label above nor to the left. */
largest_label = largest_label + 1; /* Make a new, as-yet-unused cluster label. */
|