Merge branch '2.4'
This commit is contained in:
@@ -56,11 +56,12 @@ static void detect_and_draw_objects( IplImage* image, CvLatentSvmDetector* detec
|
||||
for( i = 0; i < detections->total; i++ )
|
||||
{
|
||||
CvObjectDetection detection = *(CvObjectDetection*)cvGetSeqElem( detections, i );
|
||||
float score = detection.score;
|
||||
CvRect bounding_box = detection.rect;
|
||||
cvRectangle( image, cvPoint(bounding_box.x, bounding_box.y),
|
||||
cvPoint(bounding_box.x + bounding_box.width,
|
||||
bounding_box.y + bounding_box.height),
|
||||
CV_RGB(255,0,0), 3 );
|
||||
CV_RGB(cvRound(255.0f*score),0,0), 3 );
|
||||
}
|
||||
cvReleaseMemStorage( &storage );
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ _cleanup_:
|
||||
}
|
||||
|
||||
void detectAndDraw( Mat& img,
|
||||
cv::ocl::OclCascadeClassifier& cascade, CascadeClassifier& nestedCascade,
|
||||
cv::ocl::OclCascadeClassifier& cascade, CascadeClassifier&,
|
||||
double scale)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@@ -217,10 +217,10 @@ int main(int argc, char* argv[])
|
||||
perspectiveTransform( obj_corners, scene_corners, H);
|
||||
|
||||
//-- Draw lines between the corners (the mapped object in the scene - image_2 )
|
||||
line( img_matches, scene_corners[0] + Point2f( cpu_img1.cols, 0), scene_corners[1] + Point2f( cpu_img1.cols, 0), Scalar( 0, 255, 0), 4 );
|
||||
line( img_matches, scene_corners[1] + Point2f( cpu_img1.cols, 0), scene_corners[2] + Point2f( cpu_img1.cols, 0), Scalar( 0, 255, 0), 4 );
|
||||
line( img_matches, scene_corners[2] + Point2f( cpu_img1.cols, 0), scene_corners[3] + Point2f( cpu_img1.cols, 0), Scalar( 0, 255, 0), 4 );
|
||||
line( img_matches, scene_corners[3] + Point2f( cpu_img1.cols, 0), scene_corners[0] + Point2f( cpu_img1.cols, 0), Scalar( 0, 255, 0), 4 );
|
||||
line( img_matches, scene_corners[0] + Point2f( (float)cpu_img1.cols, 0), scene_corners[1] + Point2f( (float)cpu_img1.cols, 0), Scalar( 0, 255, 0), 4 );
|
||||
line( img_matches, scene_corners[1] + Point2f( (float)cpu_img1.cols, 0), scene_corners[2] + Point2f( (float)cpu_img1.cols, 0), Scalar( 0, 255, 0), 4 );
|
||||
line( img_matches, scene_corners[2] + Point2f( (float)cpu_img1.cols, 0), scene_corners[3] + Point2f( (float)cpu_img1.cols, 0), Scalar( 0, 255, 0), 4 );
|
||||
line( img_matches, scene_corners[3] + Point2f( (float)cpu_img1.cols, 0), scene_corners[0] + Point2f( (float)cpu_img1.cols, 0), Scalar( 0, 255, 0), 4 );
|
||||
|
||||
//-- Show detected matches
|
||||
namedWindow("ocl surf matches", 0);
|
||||
|
||||
Reference in New Issue
Block a user