3. Contour extraction algorithm
1. Compute gradient of image (work on gradient image)
2. Compute global thresholds, actual values.
3. Label the pixels as Edge,Back, or Candidate according to global thresholds.
a. look in a window around it and compute local lower threshold value.
b. label the pixel as Back if below lower threshold or as Edge if it is an outlier in the window around it.
6. Remove small connected components.
7. Localize contours by “Anding” result with results of