Bgr2Ycr_cb inRange函数错误

时间:2017-09-27 09:11:11

标签: python machine-learning gesture-recognition

cv2.rectangle(img,(900,100),(1300,500),(255,0,0),3) # bounding box which captures ASL sign to be detected by the system
    img1=img[100:500,900:1300]
    img_ycrcb = cv2.cvtColor(img1, cv2.COLOR_BGR2YCR_CB)
    blur = cv2.GaussianBlur(img_ycrcb,(11,11),0)
    size=cv2.GetSize(blur)
    print "%d" % size

    skin_ycrcb_min = np.array([0, 138, 67], dtype=np.uint8)
    skin_ycrcb_max = np.array([255, 173, 133], dtype=np.uint8)
    mask = cv2.inRange(blur, skin_ycrcb_min, skin_ycrcb_max)  # detecting the hand in the bounding box using skin detection
    contours,hierarchy = cv2.findContours(mask.copy(),cv2.RETR_EXTERNAL, 2) 
    cnt=ut.getMaxContour(contours,4000)                       

输入参数的大小不匹配Inrange函数总是给出错误

0 个答案:

没有答案