1

I come from cell biology world so please excuse my lack of knowledge beforehand.

I primarily use ImageJ for image processing in which we fit a 2D-Gaussian to detect clusters/blobs/puncta. See image below, for example.

enter image description here

I am trying to implement a similar pipeline in python and came across opencv. I'm using simple blob detector and it works well for nicely isolated clusters and not so well where multiple clusters are clustered together. Below, left image is raw image and right is after tresholding.

enter image description here

My detector is contouring a "multi-cluster" cluster as a single cluster. Is there a way to segment these multi-cluster clusters more intelligently? Ideally, I'd like to use the same 2D-Gaussian, but am open to anything at this point?

1
  • Can you post one of your original/sample images that you are working with along with the result that you expect? How are you binarizing (thresholding) images? Commented May 30, 2020 at 19:01

1 Answer 1

1

Try contour detection and see if it works.

contours, hierarchy = cv2.findContours(image, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
out = image.copy()
out = cv2.cvtColor(image, cv2.COLOR_GRAY2RGB)

for c in contours:
    cv2.polylines(out,[c],True,(255,0,0),1)

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Hey, thanks for your reply, @Mercury! I've tried contouring with findContour(). The issue is with the larger contours. These larger contours are actually supposed to be multiple smaller clusters/contours. I think my thresholding is not the right approach. I wonder if there's some filtering I can do to make larger clusters look more like a cluster of smaller individual clusters?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.