Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Solved!

for(int cnum = 0; cnum < contours.size(); cnum++){

            if(contours[cnum].size() > cmin && contours[cnum].size() < cmax){       


                human.detectMultiScale(frame(cv::boundingRect(contours[cnum])),rects);

                if(rects.size() > 0){
                            cv::Rect r0 = cv::boundingRect(contours[cnum]);
                            cv::rectangle(frame, 
                                    r0,
                                    cv::Scalar(255, 0, 0));

                            cv::putText(frame,
                                "HUMAN",
                                cv::Point(r0.x + r0.width / 2, r0.y + r0.height / 2),
                                cv::FONT_HERSHEY_SIMPLEX,
                                0.5,
                                cv::Scalar(0,0,255),
                                2,
                                8);

                }
            }