Merge remote-tracking branch 'origin/DM' into DM
This commit is contained in:
commit
76fe23b4f2
8
demo.py
8
demo.py
@ -36,14 +36,16 @@ class HandDetector:
|
|||||||
self.results = None
|
self.results = None
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.max_hands = max_hands
|
self.max_hands = max_hands
|
||||||
self.modelComplex = False
|
self.modelComplex = 1
|
||||||
self.detection_con = detection_con
|
self.detection_con = detection_con
|
||||||
self.min_track_con = min_track_con
|
self.min_track_con = min_track_con
|
||||||
|
|
||||||
# 初始化手部的识别模型
|
# 初始化手部的识别模型
|
||||||
self.mpHands = mp.solutions.hands
|
self.mpHands = mp.solutions.hands
|
||||||
self.hands = self.mpHands.Hands(self.mode, self.max_hands, self.modelComplex,
|
self.hands = self.mpHands.Hands(static_image_mode=self.mode,
|
||||||
self.detection_con, self.min_track_con)
|
max_num_hands=self.max_hands,
|
||||||
|
min_detection_confidence=self.detection_con,
|
||||||
|
min_tracking_confidence=self.min_track_con)
|
||||||
self.mpDraw = mp.solutions.drawing_utils # 初始化绘图器
|
self.mpDraw = mp.solutions.drawing_utils # 初始化绘图器
|
||||||
self.tipIds = [4, 8, 12, 16, 20] # 指尖列表
|
self.tipIds = [4, 8, 12, 16, 20] # 指尖列表
|
||||||
# self.knuckles = {'0': [4, 3, 2, 1], "1": [8, 7, 6, 5], "2": [12, 11, 10, 9], "3": [16, 15, 14, 13],
|
# self.knuckles = {'0': [4, 3, 2, 1], "1": [8, 7, 6, 5], "2": [12, 11, 10, 9], "3": [16, 15, 14, 13],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user