两款强大的jQuery图片和视频人脸识别插件,点击“click here”进行识别图像或视频里的人脸,并用方框选中人物脸部位置。
视频人物人脸识别演示:http://yanshi.sucaihuo.com/jquery/35/3558/demo/examples/video.html
js代码
<script src="../dist/jquery.facedetection.js"></script>
<script>
/* global $ */
$(function () {
"use strict";
$('#try-it').click(function (e) {
e.preventDefault();
$('.face').remove();
$('#picture').faceDetection({
complete: function (faces) {
for (var i = 0; i < faces.length; i++) {
$('<div>', {
'class':'face',
'css': {
'position': 'absolute',
'left': faces[i].x * faces[i].scaleX + 'px',
'top': faces[i].y * faces[i].scaleY + 'px',
'width': faces[i].width * faces[i].scaleX + 'px',
'height': faces[i].height * faces[i].scaleY + 'px'
}
})
.insertAfter(this);
}
},
error:function (code, message) {
alert('Error: ' + message);
}
});
});
});
</script>
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791