Reputation: 8310
I developed a software for testing object detection using HOG descriptor.
The presence of overlapping detections (multiple bounding box of different positions and sizes) for each object requires a procedure to combine them into a single bounding box that includes all the detections related to the same object. How to merge multiple detections for each object?
Upvotes: 2
Views: 1999
Reputation: 8180
This can be accomplished using the OpenCV groupRectangles function, which clusters rectangles with similar sizes and locations according to a similarity parameter. Although, I believe this function may already be being used within the HOG detectMultiScale function according to the parameter group_threshold
:
void gpu::HOGDescriptor::detectMultiScale(
const GpuMat& img,
vector<Rect>& found_locations,
double hit_threshold=0,
Size win_stride=Size(),
Size padding=Size(),
double scale0=1.05,
int group_threshold=2
)
Of course you will have to try and tune the similarity criterion to suit your needs.
Upvotes: 2