In the image , I have to remove the background from the image and detect the object.
I used canny edge detection for detecting edges and than finding contours and than draw contours on a masked image, but after canny edge detection, I am getting broken edges ,how to fix that.