Histogram Threshold by Max Contour Contrast
![]() The algorithm first histograms the 3×3 erosion and 3×3 dilation of the original image, then forms the cumulative sum of the difference of these two histograms. This array of values has the property that a pixel is counted whenever it is on a contour of the original image (why?). In other words, the algorithm counts the number of pixels on the contour, which is the contour length (left, center plot). The algorithm finds the total contrast along a contour in a similar way, with a 2-input histogram, using the eroded and dilated images for bin values, and accumulating the corresponding contrast values. Dividing this array by the contour length gives the average contour contrast. Please see the code for details. Unlike Otsu's, this algorithm can pick up small high-contrast areas. To dampen this effect slightly for the Demonstration, the contour contrast is multiplied by a weighting factor in the range 0-1, equal to the normalized contour length, raised to the power 0.25 (center plot). ![]() "Histogram Threshold by Max Contour Contrast" from The Wolfram Demonstrations Project http://demonstrations.wolfram.com/HistogramThresholdByMaxContourContrast/ Contributed by: Richard Scott | ||||||||||||||
![]() | ||
|
|
||


















Browse all topics















