设为首页 加入收藏

TOP

mini6410成功移植OPENCV-2.0.0实现人脸检测(二)
2014-11-24 08:42:16 来源: 作者: 【 】 浏览:1
Tags:mini6410 成功 移植 OPENCV-2.0.0 实现 人脸 检测
img->height/scale)),
8, 1 );
int i;
//图像转换RGB模式转为灰度图
cvCvtColor( img, gray, CV_BGR2GRAY );


cvResize( gray, small_img, CV_INTER_LINEAR );
cvEqualizeHist( small_img, small_img );
cvClearMemStorage( storage );


if( cascade )
{
double t = (double)cvGetTickCount();
CvSeq* faces = cvHaarDetectObjects( small_img, cascade, storage,
1.1, 2, 0/*CV_HAAR_DO_CANNY_PRUNING*/,
cvSize(30, 30) );
t = (double)cvGetTickCount() - t;
printf( "detection time = %gms\n", t/((double)cvGetTickFrequency()*1000.) );


for( i = 0; i < (faces faces->total : 0); i++ )
{
CvRect* r = (CvRect*)cvGetSeqElem( faces, i );
CvPoint center;
int radius;
center.x = cvRound((r->x + r->width*0.5)*scale);
center.y = cvRound((r->y + r->height*0.5)*scale);
radius = cvRound((r->width + r->height)*0.25*scale);
//cvCircle( img, center, radius, colors[i%8], 3, 8, 0 );
cvRectangle(img,cvPoint(center.x-radius,center.y-radius),cvPoint(center.x+radius,center.y+radius),colors[i%8],3,8,0);
//cvRect(center.x-radius,center.y-radius,center.x+radius,center.y+radius);


}
}
}


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇JS写的音乐游戏——JS音速V1.0.0 下一篇嵌入式Linux工控主板精简ISA总线..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Redis压力测试实战 - (2025-12-27 09:20:24)
·高并发一上来,微服 (2025-12-27 09:20:21)
·Redis 高可用架构深 (2025-12-27 09:20:18)
·Linux 系统监控 的完 (2025-12-27 08:52:29)
·一口气总结,25 个 L (2025-12-27 08:52:27)