So I was asked in my previous task to research on the implementation part of
this project and here I am presenting you my findings:
First, coming to the hardware implementation part:
a) All components except the Camera and Buzzer module will be embedded inside a box using 5 V , 2.5 A Adapter which can be connected to cigarette lightener port or USB port (newer vehicles) which can be connected to Raspberry Pi 3 using Micro USB connector cable. b) The whole setup can be placed such that the Pi camera is in front of the driver’s eyes and the buzzer can be placed just outside the component box to make the sound clearly audible. c) Unlike Arduino, the Raspberry Pi won’t run the code until it is executed manually and In a car we cannot expect our customer to do this task and hence we have to automate this job. So we need a scheduler to run the python code when the Pi is powered up or rebooted. Crontab (cron table) is scheduler used in Linux to schedule a specific task at a specific time. It is mostly used by Linux system Administrators to automate his daily tasks like scheduling backups and deleting old files, etc., Here we will be using it to launch the code during the startup, so we will be creating a shell script to navigate to the python code first and then launch it during startup using crontab. The command to be used is : “crontab-e” d) we should never "yank" the power cord out of your Pi as this can lead to severe data corruption (and in some cases, physically damage your SD card). So We can carefully shut down our Pi using a power button or switch .A simple pushbutton will do the job. The simplest way to install the required scripts is to clone our power button repository, and run the install script. For this we first configure SSH into the Pi, install git (if it's not already), and then clone the repo “pi-power button”. There is also a 2nd option for this job where we can manually write code for the safe shutdown of our Pi.
Now coming to the software implementation part:
a) first, we need to install OpenCV, imutils, dlib, Numpy, and some other dependencies in this project. OpenCV is used here for digital image processing . Before installing the OpenCV and other dependencies, the Raspberry Pi needs to be fully updated. b) Next we include al the required libraries at the top.
Raspberry Pi For Beginners: How to get the most out of your raspberry pi, including raspberry pi basics, tips and tricks, raspberry pi projects, and more!