# Revision history [back]

The bounding rectangle is calculated from your merged_contour_points1 variable which contains all the clustered blobs (except label == -1), that's why you have a rectangle that surrounds all the contours.

Instead, if you store only blobs with the same label, you will have:

If you want to retrieve only the contours (without clustering), with this tutorial:

Finally, the link to the DBSCAN algorithm implementation if someone want to use it, and to link to the original author.

The bounding rectangle is calculated from your merged_contour_points1 variable which contains all the clustered blobs (except label == -1), that's why you have a rectangle that surrounds all the contours.

Instead, if you store only blobs with the same label, you will have:

If you want to retrieve only the contours (without clustering), with this tutorial:

Finally, the link to the DBSCAN algorithm implementation if someone want to use it, and to link to the original author.

The bounding rectangle is calculated from your merged_contour_points1 variable which contains all the clustered blobs (except label == -1), that's why you have a rectangle that surrounds all the contours.

Instead, if you store only blobs with the same label, you will have:

If you want to retrieve only the contours (without clustering), with this tutorial:

Note: There is a border contour in the original image and I remove it and I use the result of cv::boundingRect directly instead of displaying the bounding rectangle of the min area rectangle.

Finally, the link to the DBSCAN algorithm implementation if someone want to use it, and to the link to the original author.author post.