'selective search in cv2 python

I am learning R-CNN, the first step for R-CNN is selective search, I used this algorithm on a sample image from my dataset.

Code -

ss = cv2.ximgproc.segmentation.createSelectiveSearchSegmentation()
ss.setBaseImage(image)
ss.switchToSelectiveSearchFast()
rects = ss.process()

I got more than 6000 proposals. How to minimize the proposals where I have few objects?



Solution 1:[1]

Once you have your results (6000 proposals) you can then enumerate through a specified number you set. You can see an implementation here.

Solution 2:[2]

Do a processing step. Like remove all those whose bboxes area is smaller. So that now you're left with the remaining bboxes. Likewise there are some methods to process the region proposals from Selective Search.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hobbes
Solution 2 Krishna Rohith