https://github.com/sopheakchan/dull-razor-algorithm
DullRazor hair removal for dermoscopic skin images.
https://github.com/sopheakchan/dull-razor-algorithm
numpy opencv python
Last synced: about 2 months ago
JSON representation
DullRazor hair removal for dermoscopic skin images.
- Host: GitHub
- URL: https://github.com/sopheakchan/dull-razor-algorithm
- Owner: sopheakchan
- Created: 2025-11-18T08:30:42.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-11-18T08:58:20.000Z (7 months ago)
- Last Synced: 2025-11-18T10:19:01.557Z (7 months ago)
- Topics: numpy, opencv, python
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DullRazor Hair Removal for Dermoscopic Images
A Preprocessing Script for Skin Lesion Datasets (Python + OpenCV)
A simple way to remove hair from skin lesion images. When working with skin cancer datasets (like ISIC or HAM10000), many images contain hair.
Hair can cover the lesion and make it harder for doctors and machine learning models to see important details.
The script processes an entire dataset with class subfolders and outputs hair-removed images while preserving the original folder structure.
Hair on the skin can:
- hide the true shape of the lesion
- confuse machine learning models
- make the image look noisy or unclear
- affect accuracy during training
By removing hair, the images become cleaner, easier to analyze, and better for training models.
# How DullRazor actually works
DullRazor follows a few simple steps:
1. Turn the image to grayscale
→ easier to detect dark hair.
2. Find the dark hair using a filter
→ this highlights hair areas.
3. Create a mask of where the hair is
→ white = hair, black = not hair.
4. Make the mask a bit thicker (optional)
→ so all the hair is removed.
5. Use inpainting to fill the hair areas
→ fills the hair pixels using nearby skin pixels
→ makes the image look natural.
