ceno980
ceno980

Reputation: 2011

OpenCV: Image segmentation of greyscale image

I have the following EM image of brain tissue and I am trying to segment the neurons.

enter image description here

The following is what the segmented result should look like:

enter image description here

I am trying to do Watershed segmentation to segment the image. However, when trying to create a binary mask (using simple thresholding in OpenCV), I do not get a very good mask at all because of the dark round features in the image (circled in red).

enter image description here

Here is the mask I got below:

enter image description here

# code used to get the mask
img_smooth = cv2.GaussianBlur(img_grey, (21,21), 0)
retval, threshold = cv2.threshold(img_smooth, 125, 255, cv2.THRESH_BINARY)

Is there any way that one can replace these dark round features with grey using simple techniques like filtering/thresholding? Or is there no way to remove these round dark features through simple techniques and machine learning methods are necessary to accomplish this task? Any insights are appreciated.

Upvotes: 0

Views: 1012

Answers (0)

Related Questions