TL;DR
This paper introduces a novel two-stage automatic color thresholding technique that effectively separates foreground objects from backgrounds in images, even under challenging conditions like varying lighting and background colors. Unlike many existing methods, it's unsupervised, requires no training data, and excels at segmenting small objects, making it valuable for applications like industrial inspection and medical imaging.
What Problem Does This Paper Address?
Image segmentation, a crucial step in many computer vision tasks, often relies on thresholding to distinguish objects of interest from the background. However, traditional thresholding methods struggle with variations in lighting, background color, and image quality. This is particularly problematic for applications like inspecting Printed Circuit Assembly (PCA) boards, which have increasingly complex and small components, or segmenting skin lesions in medical images, where precise separation is vital for diagnosis. Existing methods are often supervised, requiring extensive labeled data, or are not robust to real-world image variations. The authors aim to bridge this gap by developing an automated, unsupervised, and robust color thresholding technique.
Methods
The proposed method employs a two-stage approach based on the chromaticity (hue and saturation) of image pixels, leveraging histogram analysis.
- Stage 1: Global Thresholding: The input image is converted to the HSV color space, separating chromaticity from intensity to mitigate illumination effects. A probability mass function (PMF) is computed for the hue and saturation components and then smoothed. Nominated hue and saturation ranges are identified based on significant changes in the PMF (gradient and area). A "maximum continuous range" heuristic is then applied to select the optimal global hue and saturation ranges. Pixels falling within these global ranges are classified as background.
- Stage 2: Local Thresholding: This stage refines the segmentation by addressing local variations. Relevant "blobs" (regions) are detected from the globally thresholded image. For each detected region, local hue and saturation ranges are computed, confined by the global ranges. This allows for more precise background suppression within these specific areas. The method automatically determines the size of these local regions.
The key innovations lie in the unsupervised nature, the two-stage global-local refinement, and the use of chromaticity-based histogram analysis to adapt to image variations without manual parameter tuning for each new image.
Datasets
The authors evaluated their method on two datasets:
- University of Waterloo Skin Cancer Dataset: This dataset contains 206 images of skin lesions with corresponding ground truth images.
- PCA Board Dataset: A custom dataset was created, comprising 50 images of PCA boards with varying image quality, background colors (red, yellow, blue, green), and lighting conditions. Ground truth images were generated semi-automatically.
Key Insights and Ideas
- Chromaticity is Key: Decoupling color (hue and saturation) from intensity (value) in the HSV space is crucial for robust thresholding, as it makes the method less sensitive to lighting changes.
- Global-Local Synergy: A global threshold provides a good initial separation, but a subsequent local refinement step is essential to handle intricate details and variations within specific regions, especially for complex scenes like PCA boards.
- Histogram Analysis for Automation: Using histogram properties (gradient, area) to automatically identify significant color ranges allows the method to adapt without manual intervention, a significant advantage over many existing techniques.
- Unsupervised Advantage: The absence of a requirement for labeled training data makes this method highly practical for domains like medical imaging where obtaining such data is difficult and costly.
Key Results
The proposed method demonstrated strong performance on both datasets:
- PCA Board Dataset: Achieved a Dice Similarity Index (DSI) of 0.9846 ± 0.0149, Matthews Correlation Coefficient (MCC) of 0.9791 ± 0.0203, and Peak Signal-to-Noise Ratio (PSNR) of 23.1545 ± 4.406. These scores significantly outperformed deep learning-based methods like U-Net and DTP-Net on this dataset.
- Skin Cancer Dataset: Achieved a DSI of 0.7362 ± 0.2262, MCC of 0.7259 ± 0.2334, and PSNR of 16.2185 ± 6.3079. While U-Net achieved higher scores, the proposed method was still competitive and, crucially, unsupervised.
Qualitatively, the results showed clear and robust background-foreground separation across various sample images, even under different camera or lighting conditions, where state-of-the-art methods struggled. The method was effective in segmenting small components on PCA boards and lesions in skin images.
Limitations and Future Work
- Large Background Regions: The presence of very large, uniform background regions can sometimes affect the determination of background and foreground hues. The authors suggest that cropping such images beforehand can mitigate this.
- Similar Hue Values: Foreground objects with hues very similar to the background can be misclassified.
- Image Resolution: The quality of the thresholded output can decrease with significantly reduced image resolution.
- Ink Stains: The method struggles with ink stains that resemble foreground text colors in document binarization.
Future work could involve incorporating edge information alongside chromaticity for improved accuracy, quantitatively measuring thresholded image quality to determine optimal resolutions, and exploring the potential of deep learning methods if sufficient annotated data becomes available for specific applications like PCA board analysis. The authors also note that the privacy and security aspects of their method have not yet been studied.
Summary updated