This application is developed as a part of our manuscript titled Skin cancer diagnostics with an all-inclusive smartphone application.
The application reads dermoscopic lesion images and classfies them as melanoma or benign. It is developed using OpenCV 3.2.0 and Python 2.7
-
Download & Install Python using Anaconda or Miniconda (Recommended)
-
Then you can run the following commands install required packages
sudo install python-pip # if pip is not installed (Linux only)
pip install opencv-python==3 numpy scikit-learn scipy scons
# (or)
conda install -y opencv=3.2 numpy scikit-learn scipy scons -c conda-forge
- Clone this repository and change directory
git clone https://github.com/ukalwa/melanoma_project_python
cd melanoma_project_python
-
Install prerequisites for active contour (C++) module (Windows)
-
Download and extract boost-libraries which includes boost-python either from official website or unofficial prebuilt binaries (1.62 msvc-14 64bit) and set an environment variable (BOOST_DIR) pointing to the root of the extracted folder.
-
Download and extract OpenCV 2.4.10 libraries and set an environment variable (OPENCV_DIR) pointing to
{folder path}\build\x64\vc12
.
-
-
Create the
active_contour
module by runningscons
in the terminal in the cloned folder.
It is compatible with both Python 2.7 and Python 3.5 tested on Windows.
The usage of the program is as mentioned below
python run_script.py [--file <filename> | --dir <dirname>]
The code performs following steps:
- Reads in dermoscopic lesion image specified by --file or a directory name specified by --dir
- Preprocess the image by applying color transformation and filtering
- Segment the lesion from the image using active contour model
- Extract features (Asymmetry, Border irregularity, Colors, Diameter) from the lesion
- Classify the lesion based on the features extracted using an SVM classifier and output the result.
- Save the processed images and results
-
If you face any vcvarsall.bat errors, try installing visual studio 2017 community edition.
-
If you are unable to import
active_contour
module, please follow the steps in the environment setup to generate the module.
This code is GNU GENERAL PUBLIC LICENSED.
If you have any suggestions or identified bugs please feel free to post them!