- 1、本文档共26页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
眼部识别算法实现(Eye recognition algorithm)
眼部识别算法实现(Eye recognition algorithm)
眼部识别算法实现。
/ * *
*用opencv实时跟踪眼睛和眨眼
*
* @作者纳什 me@
*许可证GPL
* @网站
*
*参见本教程
* /real_time_eye_tracking_and_blink_detection
* /
#包括 stdio. h
#包括“简历。”
#包括“highgui。”
#定义frame_width 240
#定义frame_height 180
#定义tpl_width 16
#定义tpl_height 12
#定义win_width tpl_width * 2
#定义win_height tpl_height * 2
#定义tm_threshold 0.4
#定义stage_init 1
#定义stage_tracking 2
#定义point_tl(R)cvpoint(r.x,r.y)
#定义point_br(R)cvpoint(r.x + r.width,r.y + r.height)
#定义点(R)point_tl(R),point_br(R)
#定义draw_rects(F,D,RW,RO)/
{ /
cvrectangle(F点(RW),cv_rgb(255, 0, 0),1, 8, 0);/
cvrectangle(F点(RO),cv_rgb(0, 255, 0),1, 8, 0);/
cvrectangle(D点(RW),cvscalarall(255),1, 8, 0);/
cvrectangle(D点(RO),cvscalarall(255),1, 8, 0);/
}
#定义draw_text(F,T,D,use_bg)/
如果(d)/
{ /
cvsize _size;/
cvgettextsize(T,和字体,与_size,null);/
如果(use_bg)/
{ /
cvrectangle(F,cvpoint(0,f -高度),/
cvpoint(_size.width + 5 /
F—高_size。
height * 2), /
cv _ rgb (255, 0, 0), cv _ filled, 8, 0); /
} /
cvputtext (f, r, cvpoint (2, f - height - _ size.height / 2), /
font, cv _ rgb (255255,0)); /
d - - - - - - - -; /
}
cvcapture * capture;
iplimage * frame, * gray, * prev, * bllkkle: diff. * tpl;
cvmemstorage * storage;
iplconvkernel * kernel;
cvfont font;
char * wnd _ name = video;
char * wnd _ debug = bllkkle: diff.;
int get _ connected _ components (iplimage * img, iplimage * prev, cvrect window, cvseq * * comp);
int is _ eye _ pair (cvseq * comp, int num, cvrect * eye);
int locate _ eye (iplimage * img, iplimage * tpl, cvrect * window, cvrect * eye);
int is _ blink (cvseq * comp, int num, cvrect window, cvrect eye);
void delay _ frames (int nframes);
init (void);
void exit _ nicely (char * msg);
int
main (int argc, char * * argv)
{
cvseq * comp = 0;
cvrect window, eye;
int key, nc, found;
int text _ delay, stage = stage _ init;
init ();
while (key! = q)
{
frame = cvqueryframe (capture);
if (! frame)
exit _ nicely (cannot query frame!) ;
frame - origin = 0;
if (stage = = stage _ init)
window = cvrect (0, 0, frame - integral p
您可能关注的文档
- 理疗不同的水治疗疾病(Physical therapy different water treatments for diseases).doc
- 瑞星防火墙使用说明(Rising Firewall usage instructions).doc
- 理论指导(theoretical direction).doc
- 理解江本胜实验的本质)(To understand the nature of the experimental Emoto)).doc
- 甘肃旅游(Gansu Tourism).doc
- 生乳掺假实验方法(Milk adulteration test method).doc
- 生儿育女(Give birth to a child).doc
- 生产设备管理制度(Production equipment management system).doc
- 生产现场精细化管理(Fine management of production site).doc
- 生态住宅(Ecological residence).doc
- GB/T 39560.10-2024电子电气产品中某些物质的测定 第10部分:气相色谱-质谱法(GC-MS)测定聚合物和电子件中的多环芳烃(PAHs).pdf
- 中国国家标准 GB/T 39560.10-2024电子电气产品中某些物质的测定 第10部分:气相色谱-质谱法(GC-MS)测定聚合物和电子件中的多环芳烃(PAHs).pdf
- 《GB/T 39560.10-2024电子电气产品中某些物质的测定 第10部分:气相色谱-质谱法(GC-MS)测定聚合物和电子件中的多环芳烃(PAHs)》.pdf
- GB/T 39560.302-2024电子电气产品中某些物质的测定 第3-2部分:燃烧-离子色谱法(C-IC)筛选聚合物和电子件中的氟、氯和溴.pdf
- 中国国家标准 GB/T 39560.2-2024电子电气产品中某些物质的测定 第2部分:拆解、拆分和机械制样.pdf
- 中国国家标准 GB/T 39560.302-2024电子电气产品中某些物质的测定 第3-2部分:燃烧-离子色谱法(C-IC)筛选聚合物和电子件中的氟、氯和溴.pdf
- GB/T 39560.2-2024电子电气产品中某些物质的测定 第2部分:拆解、拆分和机械制样.pdf
- 《GB/T 39560.2-2024电子电气产品中某些物质的测定 第2部分:拆解、拆分和机械制样》.pdf
- 《GB/T 39560.303-2024电子电气产品中某些物质的测定 第3-3部分:配有热裂解/热脱附的气相色谱-质谱法(Py/TD-GC-MS)筛选聚合物中的多溴联苯、多溴二苯醚和邻苯二甲酸酯》.pdf
- 中国国家标准 GB/T 39560.303-2024电子电气产品中某些物质的测定 第3-3部分:配有热裂解/热脱附的气相色谱-质谱法(Py/TD-GC-MS)筛选聚合物中的多溴联苯、多溴二苯醚和邻苯二甲酸酯.pdf
文档评论(0)