Compare image module code

Now, finally, we write the main modules to upload the face comparison, where the IR sensor detects a presence and triggers Pi to capture the image and send it to S3 and then to Rekognition, where it compares the face with the collection:

  1. Create a file with the name FaceComparision.js and add the following code:
 var GPIO = require('pigpio').Gpio,                        cameraModule = require('./CameraModuleRekognition'),                         s3Bucket = require('./S3Put'),                        green_LED = new GPIO(19,{mode: GPIO.OUTPUT}),                        red_LED= new GPIO(17,{mode: GPIO.OUTPUT}),                        IR_out= new GPIO(5,{mode: GPIO.INPUT,alert: true}); red_LED.digitalWrite(0);green_LED.digitalWrite(0);            IR_out.on('alert', function(level, tick){            if(level==1){  cameraModule.takeTargetPicture(function ...

Get Internet of Things with Raspberry Pi 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.