CSE 633 2010 Fall Parallel Connected Component Labeling For Image Analysis Yang Fei Dec. 7. 2010 Computer Science and Engineering SUNY at Buffalo Connected Component Labeling Application Widely used to group connected Pixels in Image Distinguish segments of an image Application: Medical Testing and Meteorological Image Problem belong to subset of Connected Components in Graph Several Parallel problem about this topics Image Analysis Example Problem Description • Using Binary image as example pixels have two value 1 (object pixels) 0(background pixels) • Labeling object pixels with value equal to 1 Under 4-connectivity, adjacent pixels mark as the same label Two Pass algorithm • First Pass Scan each element of data by row Assign temporary label to each element Store equivalence between adjacent pixel • Second Pass Based on the equivalence table, scan image again Relabel the element with the lowest equivalent label Parallel • Why parallel time-consuming, need maintain large table for equivalent label • Parallel Method Divide pixels into n parts Assign each part to different processors Try to decrease computation time of this algorithm • Advantages Each scan only on small size Don t need maintain large equivalent table Experiment • Edge machine • Used functions MPI_Scatter MPI_Gather • Input Image Simulate binary image as two-dimensional matrix (two-dimensional array) Implementation • Generate two-dimensional matrix on root processor • Assign each part to other processor by MPI_Scatter • Run two- pass algorithm on each processor • Collect label information from each processor • Relabel adjacent pixels on boundary and relative pixels Result 30 8 processors 25 4 processors Time(ms) 20 15 10 5 0 64 256 576 1024 1600 2304 Number of Pixels 3136 4096 5184 6400 Result 40 35 30 time(ms) 25 20 pixels=6400 15 10 5 0 4 5 6 7 8 9 10 number of processors 12 14 16 Reference Susanne Hambrusch A Study of Connected Component Labeling Algorithm on The MMP D. S. Hirschberg A Parallel Graph Algorithm For Finding Connected Components Jung-Me Park, Carl G.Looney Fast Connected Component Labeling Algorithm Using A Divide and Conquer Algorithm