Iam doing a project with nodejs and aws.
I am using WebRTC and taking photo.
After i am taking photos base64 data and posting nodejs and i am putting it my aws console and i am using it for detectfaces but its giving error.
But i am adding photo from my aws console manually detect faces not giving a error.
My codes here : MY WEBCAM JS : this is giving a base64 for me.
> drawImage(video, 0, 0, canvas.width, canvas.height);
> var data = canvas.toDataURL('image/jpeg');
> photo.setAttribute('src', data);
> console.log(data);
and i am trying post with POSTMAN CHROME EXTENSION to my nodejs i can put it well but i can't using a detect faces.
My nodejs :
app.post('/addPhoto', function (req, res) {
var base64data=new Buffer(req.body.photo.replace(/^data:image\/\w+;base64,/, ""),'base64');
console.log(base64data);
var params = {Bucket: "realeyeshomework", Key:"111111111.jpg", Body: base64data};
s3.putObject(params, function(err, data) {
if (err)
console.log(err)
else{
console.log("1");
rekognition.detectFaces( {
Image: {
S3Object: {
Bucket: "realeyeshomework",
Name:"111111111.jpg"
}
},
Attributes: [
"ALL"
]
}, function(error, response) {
if (error) console.log(error, error.stack); // an error occurred
else res.send(response);
});
}
});
});
MY ERROR : CLICK HERE FOR ERROR
How can i do this please help me i could not fint anything.
Thanks for help.