Monthly Archives: March 2021

RM 4 – Opto Remake

Setting up Raspberry Pi

As it is my first time using raspberry pi and the servos, it took some time for me to to get the camera for pycharm cv2 to work. I enabled the camera in the command prompt and could get the camera working via the command prompt and module picamera, however errors (especially relations to gstreamer) popped up when using cv2.

Turns out it was an index error in the cv2.VideoCapture and just had to change it to (-1). I decided to make use of the Wekinator as well to control the output as we would most likely using it for our final project as well. The range is controlled from 0-1, angle degree 0-180, and is further adjusted using the def scaleBetween.

Changing the script (to Wekinator) with reference to RM3 to detect the face as well as changing the def filter_handle (from Wekinator) to allow float output. Initially only sending point 29/30 (which is in the middle of the face) to Wekinator but ended up going back to sending all the points as it worked better.

Due to Wekinator being unstable, the motor ended up jittering quite a bit at it’s place. But this reminded me of a rabbit sniffing and looking for food. Hence I created a small bunny mascot with moldable plastic.

Video Demo with Wekinator

 

 

RM3 – Cheese Remake

I initially had trouble downloading the package needed for python, dlib. And nothing was working for me, be it reinstalling python and pycharm, downloading the package online and compiling it using the setup.py given, from command prompt, and even installing through a .whl file. Finally, what worked for me was using Visual Studio’s Developer Command Prompt to install it.

As the use of Wekinator with communication with Python was new to me, I played around with wekinator, with the different models it has. I compile both given python scripts into one and felt that the all continuous model worked well in displaying and giving the output.

Video Demo

I then decide to further test out the other gestures (head turning) in wekinator as well as making use of the output given onto processing. Depending on the state (1 or 2), the small ball will move either direction along the x-axis. Wekinator’s classifier model worked well for this.

Video Demo with Processing