JAvaは顔認識ソース【テスト効果図を含む】——フロント表示層(index.jsp)を実現
function CatchCode() {
// , , ,
var canvans = document.getElementById("canvas");
var video = document.getElementById("video");
var context = canvas.getContext("2d");
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
context.drawImage(video,0,0);
var imgData = canvans.toDataURL();
// 22
var imgData1 = imgData.substring(22);
var username = $("#username").val();
$.ajax({
type: "post",
url: "FaceServlet?tag=reg",
data: {"img":imgData1,"username":username},
success: function(data){
alert(data);
},error:function(msg){
alert(" ");
}
});
}
:
:
クリックしてログイン