Image Processing Toolbox    

Step 6: Detect Intensity Valleys

The example detects all the intensity valleys deeper than a particular threshold with the imextendedmin function. The output of the imextendedmin function is a binary image. The location rather than the size of the regions in the imextendedmin image is important. The imimposemin function modifies the image to contain only those valleys found by the imextendedmin function. The imimposemin function also changes a valley's pixel values to zero (deepest possible valley for uint8 images). All regions containing an imposed minima are detected by the watershed transform.


  Step 5: Convert Objects of Interest Step 7: Watershed Segmentation