首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > OpenCV的人脸检测–Java开发者

OpenCV的人脸检测–Java开发者

资 源 简 介

资源描述包com.shekhar.facedetection;并;进口org.opencv.core.core;进口org.opencv.core.mat;进口org.opencv.core.matofrect;进口org.opencv.core.point;进口org.opencv.core.rect;进口org.opencv.core.scalar;进口org.opencv.highgui.highgui;进口org.opencv.objdetect.cascadeclassifier;并;公共课facedetector {并;public static void main(String [] args){并;系统。LoadLibrary(核心。native_library_name);系统的输入(“ n跑步facedetector”);并;facedetector =新的级联分类器级联分类器(facedetector。类。getResource(“haarcascade_frontalface_alt。XML”)。getpath());Mat图像= highgui。imread(facedetector。类。getResource(“Shekhar .jpg”)。getpath());并;matofrect facedetections =新matofrect();facedetector detectmultiscale(图像,facedetections);并;系统的输入(字符串格式(“检测到%s的面孔”,facedetections。toarray()。长度));并;为(矩形:facedetections。toarray()){核心。矩形(图像,新的点(如果X,如果Y),新的点(如果X + Y + rect.width,矩形,矩形的高度),新的标量(255,0,0));}并;字符串的文件名=“PNG输出。”;系统的输入(字符串格式(写“%s”,文件名));highgui imwrite(文件名、图像);}}
VIP VIP
0.181461s