top of page
White Structure

Segmentation

To analyze a Melanoma's asymmetry, border, and color; we first had to segment the area of the melanoma to identify its location in the image. 

01

Pre-Processing and Filtering

The first thing we do is read the image into Matlab and initialize a variable "count" to keep track of the number of thresholds the pictures satisfies for the asymmetry, border, and color functions. If the image satisfies 2 out of the 3 functions then the algorithm will classify the lesion as melanoma. Next, we apply a Gaussian blur filter with a standard deviation of 5 to smooth out the image to improve the edge detection accuracy. 

Gaussian.jpg

Image Courtesy of: Dominic Dadabbo and https://en.wikipedia.org/wiki/Melanoma

Grayscale.jpg

Image Courtesy of: Dominic Dadabbo and https://en.wikipedia.org/wiki/Melanoma

02

Otsu's Method 

Next, we call rgb2gray() to convert the image to grayscale and then binarize the image using Otsu's method, which converts all the pixels above the global threshold to 1's and pixels below to 0's. We then call imcomplement() to reverse the pixels output by the binarization. 

03

Image Masking

Last, we use bsxfun() to mask the binary image over the original image to show the accuracy of our segmentation and show the location of the melanoma located on the region of interest.

Masked Image.jpg

Image Courtesy of: Dominic Dadabbo and https://en.wikipedia.org/wiki/Melanoma

DSP Tool: Gaussian Blur Filter

Initially, our segmentation had difficulties identifying the perimeter of the melanoma, which we addressed by applying a Gaussian Blur filter to the image before converting the original image to binary format. 

The Gaussian blur filter is a low pass filter which removes high frequency noise from the image that results in a smoother image. 

Mathematically, the Gaussian Filter convolves pixels with the Gaussian function shown to the right. Using a larger value of standard deviation in the Gaussian Function results in a more blurred image as is shown below. 

Gaussian Equation Jpeg.heic
  • x is the horizontal distance from the origin

  • y is the vertical distance from the origin

  • σ is your prefered standard deviation for the Gaussian (normal) distribution

guru image.heic

DSP Tool: Otsu's Method

Otsu’s method performs automatic thresholding on grayscale images. It uses the equation shown to the right to minimize the weighted variance between the foreground and background pixels. After the threshold is determined, all pixels above the threshold are set to 1, while all pixels below are set to 0. The output is a binary image of the original grayscale.

Threshold Equation.jpg

Segmentation Results 

Seg2.png

Our segmentation algorithm performs well on dermoscopic images that contain a singular melanoma as is shown in the image to the left.

Segmentation_dark.jpg

The segmentation struggles in the following situations:​

  • Non-Dermoscopic Images: Picture includes objects other than just skin such as the edge of a body part  

  • Melanomas with pigment similar to surrounding skin

  • Images with significant lighting glare

bottom of page