2001.image segmentation with improved watershed algorithm

Upload: sathish-kumar

Post on 06-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 2001.Image Segmentation With Improved Watershed Algorithm

    1/4

    IMAGE SEGMENTATION W ITH IMPROVED W ATERSHED ALGORITHMAND ITS FPGA IMPLEMENTATION

    Chuiig J . Kuo, Soulieil F. Odeh', an d Mirig C. Hi~a i i gInstitute of Communications EngineeringNational Chun g C heng U niversityChiayi 62107, Taiwan

    ABSTRACTThis paper is concerned with image segmentation based onwatershed transform techniques. It introduces a fast, im-proved watershed algorithm which processes 3x 3 pixels inone process. Simulation results show that the improved wa-tershed algorithm has a better throughput and yields compa-rable results to those of Vincent's immersion watershed al-gorithm. The improved algorithm is modified and formu-lated such that it is amena ble to computing architecture im-plementation. An PG A- ba sed architecture that is developedto implement the proposed algorithm is presented. This ar-chitectu re improves the applicability of this algorithm in realtime applications. A description of the improved watershedalgorithm. its extension to NXN pixels, and the architectureimplementation is presented.1 INTRODUCTIONImage segmentation is an important pre-processing step inthe applications of MPEG-4 and computer vision [4]. Al-though it is a difficult problem. several solutions have beenproposed. Among these existing techniques, watershedtransform [3 ] is the best-known because it guaranteed closedcontou r of objects con be found.Watershed transform is a morphology-based image seg-mentation scheme to extract shape-related information fromimages. In watershed transform. an image is considered as atopographic surface where the grayscale value of a pixeldeno tes the altitude of that point. Tw o different waters hedtransform techniques. namely, rain falling and water immer-sion, can be used to find watershed within an image. Therain falling algorithm [ l ] is a straightforward way to findwatershed but requires extensive computations. On the otherhand, the water immersion algorithm [9-31 can find water-shed of an image quickly.In water immersion algorithm, information about the ob-ject's boundary in an image is obtained by simulating im-mersion of the image surface based on flooding water fromthe lowest point in the topogfaphic surface. When waterfrom two different minima (ba sins ) merge, an artificial damis created. At the end of the immersion procedure, each localminimum in the surface is completely surrounded by an arti-ficial dam (or watershed of the im age). Simulated imm ersionalgorithm is a region-growing method but in topographicalsense. Since the water immersion algorithm is much fasterthan the rain falling algorithm , watershed transform is al-most always computed based on the simulated immersionalgorithm.Watershed transform usually produces an oversegmentedimage due to additive noise in natural scene images. Inmathematical morphology. the contour of an object withinan image corresponds to lines where gayscale values arechanging abruptly compared to the backg ound. Hence. g a -dient operation is first used to obta in the position of contou rsSmall gradient modulus, which may originate from additivenoise. corresponds to small altitude difference of neighbor-

    'Department of Computer EngineeringUniversity of JordanAmman 11942, Jordaning pixels in the grayscale image. Therefore, pixels withsmall gradient value can be ignored by a sim ple thresholdingoperation. In this case, a less oversegmented image can beobtained if the gradient image after thresholding is furtherwatershed transformed. This process is equivalent to re-moving the add itive noise in an im age by a low pass filter.In this paper. an improved watershed algorithm, which isbased on Vincent's immersion watershed algorithm. is in-troduced. In conventional watershed algorithm. label of apixel is decided based on its eight neighboring pixels andthus a processing element (P E) needs 3x3 inputs. Here. ascheme is proposed to decide the labels of 3x 3 pixels basedon their 16 neighboring pixels. As a result, the watershedcan be found quickly and the architecture throughput of theproposed algorithm is increased. Moreover, an added ad-vantage of this algorithm is that a less over-segmented im-age can be produced compared to conventional watershedalgorithm.The organization of this paper is as follows. The proposedalgorithm is explained in section 2. Section 3 presents thesimulation results, which show that the improved watershedalgorithm has a better throughput and yields comparable re-sults to those of Vincent's immersion watershed algorithm.An FPGA-based architecture, which is developed to imple-ment the improved algorithm, is described in section 4.Finally, section 5 discusses the advantages of the improvedwatershed algorithm and the architecture.2 THE IMPROVED WATERSHED ALGORITHMIn this section , we propose a new watershed algorithm that isfaster than Vincent's immersion watershed algorithm. Theoriginal idea of Vincent's immersion watershed algorithm isto design a processirig eleiiieiit ( P E ) such that the singlepixel's watershed is decided. In Vincent's algorithm. the PEneeds 3x 3 inputs while the algorithm presented in this paperneeds 5x 5 inputs. (Please note that the algorithm presentedhere can b e easily extended to process i i x i i inputs with 17 = 7 .9. 11. ... .) To decide watershed for 3x3 pixels at the sametime, modifications are needed on Vincent's algorithm. Theimproved watershed algorithm is depicted in Fig. I and isdiscussed in the following.The conventional watershed scheme provides the label ofpixel C but requires 8 additional supporting pixels ( N ,- N,)to decide Cs label. as illustrated in Fig. 9. n this scheme.the image pixels are first sorted and then processed from thesmallest to the largest. The PE of the conventional w atershedtechnique inputs the label of 3x3 pixels. if available. andoutputs the label of the central pixel C. Before processing.pixel c ' s label is not assigned yet but all other pixels' (i.e..the N, N , pixels) label will already be assigned if theirvalue is smaller than that of pixel C . Pixel C will be at thewatershed line when its neighboring pixels have two (ormore) different labels. Details of this scheme are found in[I. Apparently, the throughput (U9) of the PE is far toolow.

    11-7530-7803-6685-9/01/$10.0002001 IEEE

    Authorized licensed use limited to: VELLORE INSTITUTE OF TECHNOLOGY. Downloaded on August 09,2010 at 15:41:55 UTC from IEEE Xplore. Restrictions apply.

  • 8/3/2019 2001.Image Segmentation With Improved Watershed Algorithm

    2/4

    Our schem e, however, decides the label of pixel C and itsneighboring pixeIs NI -Nsat one pass but requires 16 addi-tional supporting pixels SI SI6, s illustrated in Fig. 3.Our objective is to increase the throughput by processing5x5 pixels together instead of 3x3. The details of the pro-posed algorithm are shown below.First, all the label and pixel values of these 25 pixels areinputted to the P E. The PE here consists of 10 smaller PESthat are almost identical to the PE in the conventional case.Our scheme first decides the label of pixel C and then de-cides the label of pixels NI - N s by using the pipeline archi-tecture (discussed in section 4) as follows. We fEst decidethe label of pixel C based on the label of pixels N I - Ns.Since the image pixels are still sorted and processed fromthe smallest to the largest, the neighboring pixels of pixel Calready have label if their value is smaller than that of pixelC. Therefore, this procedure is identical to the one shown inVincent's algorithm.Once the label of pixel C is decided, the rest of the PES(total number is 9) decides the label of pixels NI - Ns .Taking pixel NI as an ex ample, som e of its neighboring pix-els may n ot ha ve label yet although its pixel value is smallerthan the pixel value of NI. This is because the pixel value ofNI should be larger than or equal to that of pixel C. As a re-sult, some of the neighb oring pixels of N I (SI,:, &,SIs.S16,N2, an d Ns) might have pixel value smaller than N I .(Plea se note that pixel value of C is always sm aller than thatof N I . )This face leaves the decision of label for pixel N I dif-ficult. To solve this problem, we must consider the pixelvalue of the neighboring pixels of NI instead of its labelonly.In processing pixel N,. i = 1, . ., 8, only the three support-ing pixels in the opposite direction of pixel C (with respectto N i) are considered and processed. For example. in decid-ing the labei of pixel NI . we need to consider the pixel val-ues of pixels C.SI.,, an d SI6. imilarly, in deciding the la-bel of pixel N 2 , we need to consider the pixel values of pix-el s C. &. SJ. an d S4. eciding the label of pixels Nl-Ns isvery similar to that of pixel C . However, we need additionalcriteria to say pixel N , . for example, is a watershed. That is.the pixel value of N I must be the largest among pixels C, SI.S2 . an d SI,. We denote this criterion as "LHL" (low, high.and lo w) condition because the pixel value of N , (o r N2)must be larger than its four neighboring pixels C . SI .S,, andSI 6or N I (o r C,SI. ,, an d Sa) to be deem ed watershed.The reason why only some neighboring pixels of Ni . i =1, . 8. are considered in deciding whether Ni is a water-shed is as follows. Among the neighboring pixels of pixel N, .the pixel C has smallest pixel value. Take pixel N I as anexample. the watershed is very unlikely to pass throughC-N,-SI. In addition. when the image to be processed islarge. the w,atershed passing pixel N I can be considered as astraight line locally. Therefore, we only consider the valuesof pixels C.SI , ,. and SI 6 ecause pixels C. NI, an d SI or S 2or sl6)can decide whether there is a w atershed pass through

    The procedure used in the improved watershed algorithmis illustrated in the flowchart shown in Fig. 3 . Apparently,the improved watershed algorithm increases the throughputfrom 1/9 to 9/35. Also. the data transfer between the PE andthe memory is significantly reduced.The proposed algorithm can be easily extended to process17x17pixels jointly where = 5, 7 , . . Take 17 = 5 an d Fig. 3as an example. Here we first process the pixel C. then comesthe pixel N , and finally the pixel Si. difference is that 7 x 7image block must be considered in order to obtain the wa-tershed of a 5x 5 image block. Besides. all the pixel values

    SJ-NI-S~~o r S16-Nl-N2 or s2 -Nl-N~) .

    and labels must be inputted into the P E to generate the wa -tershed for of a 5 x 5 image block.3 Simulation ResultsThe improved watershed algorithm is used to compute wa-tersheds in digital grayscale images. As in conventional wa -tershed algorithms, the image pixels are sorted in increasingorder based on their grayscale values. Th e label of the imagepixels is decided in two steps: First, deciding the label of thecenter pixel (i.e., the extracted pixel). Next, deciding the la-bels of neighboring pixels.In order to verify the results of the proposed algorithmpresented in this paper, several input patterns were tested, inwhich the final results of this algorithm are close to t hose ofVincent's algorithm. An example is shown in Fig. 5 inwhich the output labels of the two algorithms are identical.The proposed algorithm is then tested on the 512x512Lena's image. Fig. 4 show two similar watershed imagesresulting from Vincent's algorithm and our proposed algo-rithm, respectively, for a gradient image with thresholdvalue 17. Table 1 summarizes the advantages of our pro-posed algorithm compared with Vincent's algorithm interms of the number of pixels to be processed, the nu mb er ofinput pixels for the PE, and the I/O translation rate. This ta-ble clearly shows that our proposed algorithm is m uch m oreefficient in processing and in J/CI translation rate while giv-ing comparable results to those of Vincent 's algorithm.The proposed algorithm can process 12x12 image blockjointly; however, the details of watershed information arelost when image block is too large. Table 2 shows the wa-tershed results of the image from the Vincent's algorithmand the proposed one. Based on this table, our proposedscheme is suitable for images with size QCIF and up when3 x3 block are processed jointly. Und er this situation. no ap-parent degradation is observed As for image with sizeSQCIF. we had better use Vincent's algorithm.It is known that a major problem with watershed tech-nique is that it always results in oversegmented images.However, via the proposed technique, the oversegmentedimage is less likely to appear. This is an added advantage ofthe proposed scheme.4 ArchitectureImplementationIn this section, a description of the ASIC chip architecturethat implements the improved watershed PE is presented.Here we only consider the window of 3x3 only. An ASICdesign is essential and necessary to implement the watershedPE because one CPU (or DSP chip) cannot handle the inten-sive computations required by the algorithm while givin g agood performance. A properly designed ASIC architecturecan provide for the massive computations required inpre-processing and post-processing of the watershed seg-mentation at a reduced watershed processing time.The block diagram of the pipeline architecture that im-plements the improved Watershed algorithm is shown in Fig.5. Using this architecture. our sche me first decides the labelof pixel C and then decides the label of pixels NI-N8. Thisarchitecture consists of 10PES that are pipelined as shown inFig. 5. Since the first and second stage PES have many c om -ponents 'and functionality in com mo n, the overall size is no tten times. 'The number of data transfer between the PE andthe memory is reduced because the throughput rate of theimproved watershed algorithm is 9/25 as opposed to 119 asin the conventional scheme.

    11-754

    Authorized licensed use limited to: VELLORE INSTITUTE OF TECHNOLOGY. Downloaded on August 09,2010 at 15:41:55 UTC from IEEE Xplore. Restrictions apply.

  • 8/3/2019 2001.Image Segmentation With Improved Watershed Algorithm

    3/4

    This watershed PE architecture has 77 serial input data(i.e., 25 pixel values, 25 label values, 25 assigned signals, Iclock. and 1 reset) and 9 serial output data. The logic gatecount of the watershed PE is 2965 gates. The gate count ofthe w atersh ed PE is less than 9 sm aller PES that process apixel, which amoun ts to a decrease of about 32% gate countsThe performance of the FPGA implementation is 50.363MHz in XC40 13Epq 160- 1.Th e schem atic diagrams of the circuits for the center labeland the neighbo ring labels are shown in Figs. 6(a) and 6(b),respectively. In order to prove and test its correctness, thiswatershed architecture was simulated on several input pat-terns. Although a single PE requires more inputs by ourscheme, the data flow between the PE and the memory isreduced because the throughput is larger as discussed above.The performance of the improved watershed algorithmand architecture is tested when extended to work with N x Npixels in order to match the pixel numbers with those ofVincents watershed algorithm. Simulation results show thatthe percentage of matches decreases as the number of pixelsincre ases. The percentage of matches is better for the case ofapproximate matches. The rate of decrease flattens up as thenumber of pixels increases and is better for the approximatematches. We found that the U 0 ata translation rate effi-ciency of the improved algorithm increases as the number ofpixels increases. Finally, simulation results indicate that themaximum path delay time of the architecture increases asthe number of pixels increases, which is expected.5 ConclusionA fast, improved watershed algorithm is introduced whichprocesses 3x 3 pixels in one process. In Vincents immersionwatershed algorithm, the PE needs 3x3 inputs while the im-proved watershed algorithm presented in this paper needs5x5 inputs. The improved watershed algorithm decides the3x3 pixels watershed simultaneously by using one PE.Although a single PE requires more inputs by our scheme,the data flow between the PE and the memory is reducedbecause the throughput is larger. Simulation results showthat the improved watershed algorithm has a better through-put and yields comparable results to those of Vincents im-mersion watershed algorithm. The improved algorithm ismodified and formulated such that it is amenable to com-puting architecture implementation. An FPGA-based archi-tecture that is developed to implement the proposed algo-rithm is presented. The gate count of the watershed PE isless than 9 sm aller PES that process a pixel. which amountsto a decrease of about 32% gate counts. The number of datatransfer between the P E and the memory can be reduced be-cause the throughput rate of the proposed algorithm is 9/35as opposed to 1/9 as in the conventional scheme. By in-creasing the processing speed. this architecture improves theapplic ability of this algorithm in real time applications.References

    Moga. B. Cramariuc and M. Gabbouj, An efficientwatershed segmentation algorithm suitable for parallelimplementation. Proceediir7gs of IEEE Iiirer-r7arioria/Corlfereizce 01 7 Iimge Processi17g,vol. 2. pp . lOl-lO4,Oct. 1995P. Salembier and M. Pardhs, Hierarchical morpho-logical segmentation for image sequence coding. ITr-nizsacrionson Image Proc-essii7p. vol. 3, pp. 639-65 1.Sep. 1994

    [3] L. Vincent and P. Soille. Watersheds in digital spaces:An efficient algorithm based on immersion simula-tions, IEEE Transactions 0 17 Pattern Aizalysis andMachiiie Iiitelligeiice, vol. 13, pp. 583-597, June 1991

    [4] ISO/IEC 14496: Information technology-Cod ing of au-dio-visual objects, MP EG- 4 standard

    Table I : Comparison of the watershed algorithms for512x5 I 2 Lena image.

    IHDTV IHDTVICCIR-601 ~C FlQ CF lSQ CIF I

    IProposed,9x91 Yes I Y es I No I N o ( No I No ITable 2 : Comparison of the watershed algorithms for im-age with different format (Yes: acceptable; No : unaccept-able).

    Process 9 pixels in an exaactiou< Sorting array

    000@..

    Pixels belong toFi-. l:.Id b of the proposed watersh&sigmh niNew mininirfin pixe? Watershed pixel

    11-755

    Authorized licensed use limited to: VELLORE INSTITUTE OF TECHNOLOGY. Downloaded on August 09,2010 at 15:41:55 UTC from IEEE Xplore. Restrictions apply.

  • 8/3/2019 2001.Image Segmentation With Improved Watershed Algorithm

    4/4

    I

    Fig. 3 . Flowchart of the proposed watershed algorithm.

    Fig. 4. Theresult of the Vincent watershed iniage

    Fig. 5. The result of the proposed watershed image(Gradient mage threshold=17)

    IFig. 6. Architectureof the proposed algorithm

    Fig. ?(a)

    , a.

    . *" _

    Fig. 7(b )Fig. 7. Schematic diagrani 01 the Y t . ( a )For center pixel.(b ) or neighboring pixe l.

    11-756

    Authorized licensed use limited to: VELLORE INSTITUTE OF TECHNOLOGY. Downloaded on August 09,2010 at 15:41:55 UTC from IEEE Xplore. Restrictions apply.