I have been googling for 1 week about object detection. What everyone show is similar to the below image.
But I don't want square boxes around the detected object. I need the rough outline of the object as shown in the below image.
Is it possible? If possible please give a brief explanation about it. Thanks in advance.
I think you are looking for semantic segmentation. Object detection usually means finding a bounding box and a label for an object, while semantic segmentation is the problem of assigning a class label to each pixel in an image. Once you have the class labels for each pixel, you can use a classical contour detection algorithm to find the outline of the object. Matlab docs have a nice explainer on semantic segmentation.
Below is an example output of a semantic segmentation model trained on a self-driving car dataset:
Image by Vladlen Koltun