How to remove detected human after DetectMultiScale?
Hi guys, now I'm workin on my False Human Detection projects. Can you tell me how to remove detected human after DetectMultiScale? So I can skip False Human Detection for the next frame detection.
For Example:
std::vector<cv::Rect> rects;
CascadeClassifier.detectMultiScale(frame, rects);
if(rects.size() > 0){
for(unsigned int r = 0; r < rects.size(); r++){
//DELETE DETECTED HUMAN (RECT) HERE!
}
}
I'll appreciate any help here, thanks. :)
could you explain, what you mean by 'remove' ? from the vector of rects ?
also, how would you recognize a false detection ?
He probably knows beforehand that the image he is testing has no humans at all
Yeah remove the vector of rects for detected human. I can recognize a false detection by it's color, motion, etc. for example: When a statue detected as human, I'll track the motion of detected statue. If there's no motion/movement at all, I'll remove the statue from detected human because the real human will move although only a little movement.
rect.erase() perhaps?
I've tried that "rect.erase()" and I got an error message: "IntelliSense: no instance of overloaded function "std::vector<_Ty, _Alloc>::erase [with _Ty=cv::Rect, _Alloc=std::allocator<cv::Rect>]" matches the argument list object type is: std::vector<cv::Rect, std::allocator<cv::Rect>>"