I have a grey scale image (single channel data) and want to perform something like the Canny edge detection operation on it for foreground segmentation. But, the output has a lot of noise. I also tried bilateral filtering along with it but it didn't help the output.
Can someone please help point me in the correct direction on how to go about this?
Thank you.
Code snippet:
v = np.median(vis)
sigma = 0.33
lower = int(max(0, (1.0 - sigma) * v))
upper = int(min(255, (1.0 + sigma) * v))
edges = cv2.Canny(vis,lower,upper) edges = cv2.Canny(depth_vis,lower,upper)
Below is a sample picture of current Canny detector output. C:\fakepath\canny.png