I'm able to detect nail and palm with media pip and python but can't manage to extract the nail part. How can I select the part using media pipe
I want to show only (4,8,12,16,20) these points and remove other white dots.
Here is my code for hand detection
import mediapipe as mp
import cv2
import numpy as np
import uuid
import os
mp_drawing = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands
handConnection = [(4, 4), (8, 8), (12, 12), (16, 16), (20, 20)]
cap = cv2.VideoCapture(0)
def main():
hands = mp_hands.Hands(
min_detection_confidence=0.7, min_tracking_confidence=0.7)
hand_landmark_drawing_spec = mp_drawing.DrawingSpec(color=(121, 22, 6), thickness=0, circle_radius=0)
hand_connection_drawing_spec = mp_drawing.DrawingSpec(color=(250, 44, 90), thickness=15, circle_radius=15)
while cap.isOpened():
ret, image = cap.read()
image = cv2.flip(image, 1)
image = cv2.cvtColor(cv2.flip(image, 1), cv2.COLOR_BGR2RGB)
results_hand = hands.process(image)
image.flags.writeable = True
image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
if results_hand.multi_hand_landmarks:
for idx, hand_landmarks in enumerate(results_hand.multi_hand_landmarks):
mp_drawing.draw_landmarks(
image=image,
landmark_list=hand_landmarks,
connections=handConnection,
landmark_drawing_spec=hand_landmark_drawing_spec,
connection_drawing_spec=hand_connection_drawing_spec)
cv2.imshow('Hand Tracking', image)
if cv2.waitKey(10) & 0xFF == ord('q'):
break
hands.close()
cap.release()
main()
How can I show or use from the image below (4,8,12,16,20). I want to place text over them. How I can achieve this or able to solve this?



