Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Improving Simple Blob Detection

I am using a simple blob detection to detect the moles in the input image below: image description

And the output image is:

image description

My problem is that not all the moles are detected. How do I improve the simple blob detection to detect all the moles? Would there be a better way to go about this instead?

  #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov  5 12:48:48 2018

@author: 2020shatgiskessell
"""
import cv2
import numpy as np

#IN LATER VERSIONS MAKE SURE IMAGE IS ALWAYS BINARIZED OR GRAYSCALE!!
img = cv2.imread("/Users/2020shatgiskessell/Desktop/New_Mole_Detector/Test_Images/mole2.jpg")

#use blob detectiom
def identify_moles (image):
    #create blob detector and pass image through
    detector = cv2.SimpleBlobDetector_create()
    keypoints = d
    etector.detect(image)
    #draw blobs
    blank = np.zeros((1,1))
    blobs = cv2.drawKeypoints(image, keypoints, blank, (0,255,255), cv2.DRAW_MATCHES_FLAGS_DEFAULT) 
    return blobs

image_with_blobs = identify_moles(img)

cv2.imshow('identified moles', image_with_blobs)    
cv2.waitKey(0)
cv2.destroyAllWindows()