Category Archives: OpenCV

Tracking an Object of Interest in OpenCV using Contours on the Raspberry Pi

In this video lesson we show how to track an object of interest based on color in OpenCV. We show how to create masks, contours, and then how to box the contour of the object of interest. We also show a convenient way to train the system for finding the Object of Interest. For your convenience, the code is included below.

 

Tracking an Object of Interest Based on Color in OpenCV on Raspberry Pi


 

In this video lesson we show how you can track an object of interest in OpenCV on the Raspberry Pi. We do this by tracking color in the HSV color space. We dial in our object of interest using trackbars. For your convenience, the code below is what we developed in our video.

 

Using the Raspberry Pi Camera on Bullseye OS and OpenCV

Then the following code will allow you to grab a frame and show a frame in a window. Looking this sequence creates a live video preview on your Raspberry Pi Screen.

 

AI for Everyone LESSON 29: Control of Real World Objects with Gesture Recognition in Mediapipe

In this video lesson we show you how you can control objects in the real world using OpenCV, Python, Mediapipa and our old friend, the Arduino. On the Python side, we recognize hand gestures, and then we pass the recognized gesture to Arduino and Arduino lights LED in response to what hand signal is seen. This is a simple example, but a very powerful method. Instead of LED, you could operate servos, stepper motors or relays to control any manner of different devices. For your convenience, this is the code we used on the Arduino side:

And on the python side, we used the following code.

 

Improved Gesture Recognition in Python and MediaPipe

In this video lesson we show you how you can improve the accuracy of your gesture recognition program developed in the last lesson. We do this by normalizing the hand landmarks distance matrix to a standard size. By doing this, you get accurate results independent of the distance your hand is from the camera. For your convenience, I include the code below which we develop in this lesson. Enjoy!

 

s lesson. Enjoy!