To detect certain objects in an image, Edge detection is a useful tool. Here is a documentation of all the edge detection techniques to find object boundaries in an image.
For further understanding, please watch the following video-
Try these methods to find the best method suitable for your image.