Improving Simple Blob Detection
I am using a simple blob detection to detect the moles in the input image below:
And the output image is:
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()
@Stephane have you tried adding parameters and varying them for SimpleBlobDetector ?
@ameyparanjape I have tried varying the parameters, however, I continuously get the same results. When I change the minConvexity to 0, the SimpleBlobDetector becomes slightly more accurate but not by an adequate amount (it only recognizes one more mole)
@Stephane I think tuning minArea, min/maxThreshold should improve current result.
Change this:
to