I'm trying to get the edges of this object from a TEM(microscope) image and the problem is that the contact is low especially in the upper edge, I tried several things thresholding, contrast equalization... but I wasn't able to get the upper edge.
N.B: I'm trying to calculate the angle between the droplet and the tube I'm not sure if this is the best way to approach this problem.
The original image:
The Canny Edge detection I get:
the steps I got to get this result are:
- Contrast enhancement
- Thresholding
- Gauss filter
- Canny Edge detection
Code:
clahe = cv2.createCLAHE(clipLimit=clip_limit, tileGridSize=(grid_size, grid_size))
equ = clahe.apply(img)
val = filters.threshold_otsu(equ)
mask = img < val
# denoising part
mask = filters.gaussian(mask,sigma=sigmaG)
# edge detection
edge = feature.canny(mask,sigma=sigmaC)
edge = img_as_ubyte(edge)