做购物网站用什么应用,企信网企业信用信息系统贵州,电子商务网站建设工具都有那些,中资源 网站域名解析2017年#xff0c;开发了第一个版本的人脸识别#xff0c;当时费时有5天之久终于写出来了#xff0c;但是只适用于火狐浏览器#xff0c;别的浏览器都打不开摄像头。
2018年#xff0c;将人脸识别重新完善#xff0c;可以支持360、火狐、谷歌等主流浏览器#xff0c;版…2017年开发了第一个版本的人脸识别当时费时有5天之久终于写出来了但是只适用于火狐浏览器别的浏览器都打不开摄像头。
2018年将人脸识别重新完善可以支持360、火狐、谷歌等主流浏览器版本都是使用的百度云V2版当时已经出来了V3版只是一直没时间去看。
2019年重新拿出来以前写的项目将百度云V3版人脸识别写出来分享给大家以下是源码分享只是一个简单的demo不如V2版本的全面
V2版本的人脸识别java实现人脸识别源码【含测试效果图】——前期准备工作及访问提示
V3版本的jar包下载人脸识别百度APIV3的jar包
V3版本的人脸检测
/*** * Description: 该方法的主要作用* Title: 人脸检测* param param client 设定文件 * return 返回类型void * throws* 个人博客https://blog.csdn.net/qq_34137397*/public static void face_jiance(AipFace client) { // 传入可选参数调用接口HashMapString, String options new HashMapString, String();options.put(face_field, age);options.put(max_face_num, 2);options.put(face_type, LIVE);File directory new File();// 参数为空String courseFile;try {courseFile directory.getCanonicalPath();//获取当前项目的根路径//System.out.println(courseFile);String image courseFile/WebRoot/picture/111.jpg;String imageType BASE64;//转换格式String strImageToBase64 ImageToBase64(image);//输出base64图像数据//System.out.println(本地图片转换Base64:strImageToBase64);// 人脸检测JSONObject res client.detect(strImageToBase64,imageType, options);System.out.println(res.toString(2));} catch (IOException e) {// TODO 异常执行块e.printStackTrace();}}V3版本的人脸注册
/*** * Description: 该方法的主要作用人脸注册* Title: face_reg* param param client 设定文件 * return 返回类型void * throws* 个人博客https://blog.csdn.net/qq_34137397*/public static void face_reg(AipFace client) {// 传入可选参数调用接口HashMapString, String options new HashMapString, String();options.put(user_info, users info);String groupId group1;String userId user1;File directory new File();// 参数为空String courseFile;try {courseFile directory.getCanonicalPath();//获取当前项目的根路径//System.out.println(courseFile);String image courseFile/WebRoot/picture/111.jpg;String imageType BASE64;//转换格式String strImageToBase64 ImageToBase64(image);//输出base64图像数据//System.out.println(本地图片转换Base64:strImageToBase64);// 人脸注册JSONObject res client.addUser(strImageToBase64, imageType, groupId, userId, options);System.out.println(res.toString(2));} catch (IOException e) {// TODO 异常执行块e.printStackTrace();}}V3版本的人脸登陆
/*** * Description: 该方法的主要作用人脸登陆* Title: face_login* param param client 设定文件 * return 返回类型void * throws* 个人博客https://blog.csdn.net/qq_34137397*/public static void face_login(AipFace client) {// 传入可选参数调用接口HashMapString, String options new HashMapString, String();options.put(user_id, user1);File directory new File();// 参数为空String courseFile;String groupIdList group1;try {courseFile directory.getCanonicalPath();//获取当前项目的根路径//System.out.println(courseFile);String image courseFile/WebRoot/picture/222.jpg;String imageType BASE64;//转换格式String strImageToBase64 ImageToBase64(image);//输出base64图像数据//System.out.println(本地图片转换Base64:strImageToBase64);// 人脸搜索JSONObject res client.search(strImageToBase64, imageType, groupIdList, options);System.out.println(res.toString(2));} catch (IOException e) {// TODO 异常执行块e.printStackTrace();}}V3版本的本地图片转换成Base64图像格式的方法
/*** * Description: 该方法的主要作用本地图片转换成Base64图像格式的方法* Title: ImageToBase64* param param imgPath* param return 设定文件 * return 返回类型String * throws* 个人博客https://blog.csdn.net/qq_34137397*/public static String ImageToBase64(String imgPath){InputStream inputStream null;byte[] data null;try {inputStream new FileInputStream(imgPath); data new byte[inputStream.available()];inputStream.read(data);inputStream.close();}catch (Exception e) {e.printStackTrace();}//进行编码BASE64Encoder encoder new BASE64Encoder();//返回编码完成的base64图像数据return encoder.encode(data);}另外附上其他人脸识别相关的博文 1.关于人脸和指纹识别共同交流方案
2.人脸识别活体检测之眨眨眼和张张嘴
3.C#winforms实现windows窗体人脸识别
4.java实现人脸识别源码【含测试效果图】——前期准备工作及访问提示
5.多功能语音播放器上线啦~
6.纯js实现人脸识别眨眨眼张张嘴案例
7.人脸识别活体检测测试案例
8.青鸟IT汇微信公众号新增智能机器人
9.使用阿里云智能翻译接口案例
10.使用阿里云火车票查询接口案例
11.使用阿里云身份证扫描识别接口案例
12.调用阿里云接口实现短信消息的发送源码