Skip to main content

Posts

Showing posts with the label OpenCV

Make a Virtual Pen and Eraser Using Python || Virtual Pen and Eraser Using OpenCV || Draw Using a Virtual Pen || Creation Code

 Introduction The project aims to create a virtual pen and eraser using OpenCV and python. This project is very simple and easy to implement. The code is given in this article which you can easily copy and paste into a file and run it on your machine. In this article, we will be using OpenCV for detection of the mouse movements, PyQt5 for GUI creation, Numpy for storing data as well as NumPy array manipulation functions such as slicing and indexing along with Pandas Dataframes which are very helpful while working with Numpy arrays. Virtual Pen and Eraser Using OpenCV In this section, you will learn how to create a virtual pen and eraser by using OpenCV. The first step is importing the required Python libraries. We need to import the cv2 module from opencv library import cv2 import numpy as np This project aims to create a virtual pen and eraser using OpenCV and Python The project aims to create a virtual pen and eraser using opencv and python. This is a very interesting topic for th

How to Make Gesture Controlled Snake Game in Python || Python code for snake game - Creation Code

 How to make a snake game in python? History of Snake Game: Snake is a video game genre where the player maneuvers a growing line that becomes a primary obstacle to itself. The concept originated in the 1975 two-player arcade game Blockade from Gremlin Industries, and the ease of implementation has led to hundreds of versions (some of which have the word snake or worm in the title) for many segments. After a variant was preloaded on Nokia mobile phones in 1998, there was a resurgence of interest in snake games as it found a larger audience. There are several hundred snake games for iOS alone. Modules: cv2 cvzone matplotlib scipy sklearn Roadmap: Problems Our first work will be to againcognising the hand Then find the point of the finger Now we will going to create a point with the finger We need to create a logic where the point will increase as we move the finger Next step is to stop the snake game when the coordinate of the points clash with each other Create random foods for the sna

Volume Control With Hand Using Python || How do you controll gestures in Python - Creation Code

Introduction: Gesture recognition helps computers to understand human body language. This helps to build a more potent link between humans and machines, rather than just the basic text user interface or graphical user interfaces(GUIs). In this project for gesture recognition, the human body's motions are read by a computer camera. The computer then makes use of this data as input to handle applications. The objective of this project is to develop an interface that will capture human hand gestures dynamically and will control the volume level Code: import cv2 import mediapipe as mp from math import hypot from ctypes import cast , POINTER from comtypes import CLSCTX_ALL from pycaw . pycaw import AudioUtilities , IAudioEndpointVolume import numpy as np cap = cv2 . VideoCapture ( 0 ) mpHands = mp . solutions .hands hands = mpHands .Hands() mpDraw = mp . solutions .drawing_utils devices = AudioUtilities . GetSpeakers () interface = devices .Activate( IAudioEnd

How to Make a Social Distancing Detector || social distancing detector using python || social distancing-detection using python github - Creation Code

Social Distancing: In public health, social distancing, also called physical distancing, is a set of non-pharmaceutical interventions or measures intended to prevent the spread of a contagious disease by maintaining a physical distance between people and reducing the number of times people come into close contact with each other. It usually involves keeping a certain distance from others(the distance specified differs from country to country and can change with time) and avoiding gathering together in large groups. Now let's build this system in python Approach: First we will create utils for the project Second we will plot the points also known as birds view Now we will create the main program utills.py import cv2 import numpy as np # Function to calculate bottom center for all bounding boxes and transform prespective for all points. def get_transformed_points ( boxes , prespective_transform ):         bottom_points = []     for box in boxes :         pnts = np . array