0
我想用OpenCV库实现手语翻译器。要做到这一点,我需要检测手势作为第一阶段。所以基本上我已经通过将RGB色彩空间转换为YCbCr来实现手的检测,然后阈值范围的肤色。在OpenCV中的手势python
ycc = cv2.cvtColor(img , cv2.COLOR_BGR2YCR_CB)
min_ycc = np.array([0,133,85], np.uint8)
max_ycc = np.array([255,170,125], np.uint8)
skin = cv2.inRange(ycc, min_ycc, max_ycc)
opening = cv2.morphologyEx(skin, cv2.MORPH_OPEN, np.ones((5,5), np.uint8), iterations=3)
sure_bg = cv2.dilate(opening,np.ones((3,3),np.uint8), iterations=2)
_,contours,_ = cv2.findContours(sure_bg, cv2.RETR_LIST,cv2.CHAIN_APPROX_NONE)
此代码工作正常低详细背景,但有一些噪音,如果我们有一个详细的背景,其中包括近肤色。
我唯一关心的是如何确定哪个轮廓是手轮廓。我尝试了最大轮廓,但没有很准确。