Spaghetti Labeling: Directed Acyclic Graphs for Block-Based Connected Components Labeling