Комментарии:
Guruji you are great
ОтветитьThe man in the video is really a gem 💎....what an amazing project tutorial it's !.....The energy throughout the entire project is superb....Your teaching process is superb duperb...i should say Bang Bang Bang 🤩😌..... Satisfaction level is high 🫡
Thank you sir 🙏🏼
how can i get cv2 ?
ОтветитьIt works, but it is really jittery please tell a solution
ОтветитьSir i am getting an error plz help me
ОтветитьSbse bda python to tumhi LG rhe ho
Ответитьlol you use a phone to record, not like I could do better tho
Ответитьbro your code isn't working it is showing too many problems
Ответитьthier is a lag in my camera video, can you tell me how to solve this problem?
ОтветитьThanks a lot programming hero, I did a course 2 years back, and after that did not even try to get in touch back with Python and forgot everything but this video w a unique as I watched your videos 2 years back and I still understood why the code was done and even executed it so thanks
Ответитьok :)
import cv2
import mediapipe as mp
import pyautogui
index_y = 0
cap = cv2.VideoCapture(0)
hand_detector = mp.solutions.hands.Hands()
drawing_utils = mp.solutions.drawing_utils
screen_width, screen_height = pyautogui.size()
while True:
_, frame = cap.read()
frame = cv2.flip(frame, 1)
frame_height, frame_width, _ = frame.shape
rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
output = hand_detector.process(rgb_frame)
hands = output.multi_hand_landmarks
print(hands)
if hands:
for hand in hands:
drawing_utils.draw_landmarks(frame, hand)
landmarks = hand.landmark
for id, landmarks in enumerate(landmarks):
x = int(landmark.x*frame_width)
y = int(landmark.y*frame_height)
print(x, y)
if id == 8:
cv2.circle(img=frame, center=(x,y), radius=10, (0, 255, 255))
index_x = screen_width/frame_width*x
index_y = screen_height/frame_height*y
pyautogui.moveTo(index_x, index_y)
if id == 4:
cv2.circle(img=frame, center=(x, y), radius=10, (0, 255, 255))
thumb_x = screen_width / frame_width * x
thumb_y = screen_height / frame_height * y
print('outside', abs(index_y - thumb_y))
if abs(index_y - thumb_y) <20:
pyautogui.click()
pyautogui.sleep(1)
print('click')
cv2.imshow('Virtual Mouse' , frame)
drawing_utils.draw_landmarks(frame, hands)
cv2.waitKey(1)
Source code plss!!
ОтветитьThis is an awesome turtorial, but I have a question, can we make our cursor movement faster and synchronized?
ОтветитьCan anyone fix it for me?
frame_height, frame_width, _ = frame.shape
AttributeError: 'NoneType' object has no attribute 'shape'
Amazing!! Awesome video! Thank You Sir❤
ОтветитьHello i have a small problem with it and i cant seem to figure out how to fix it to try to make the hand on the frame and mouse on the screen line up its converted to the same size however for me that does really work because my hand goes out of frame before i hit any of the corners which makes it hard to click on a windows icon or close a tab how you would you suggest i make the mouse move more when the finger moves
Ответитьwhat is the python version you are using?
ОтветитьWonderful dear...
ОтветитьI can't install mediapipe package in pycharm any solution?
ОтветитьIt's always popping that error found in installing mediapipe 🥴....ANY SOLUTION?
Ответить