robot-arm-opencv/robotArm.py at master · joemac875/robot-arm-opencv
To better understand hand tracking with OpenCV, and to develop a hand tracking model from the ground up, this page will be responsible for documenting the functionality of this code.
global avgHSV1
global avgHSV2
global avgHSV3
global hsv
avgContainer : list = [] # container for HSV values
refPt : list = [0, 0, 0, 0] # holds x1, y1, x2, y2 coordinate values of {???}
screenHeight : int = 720 # height of window
screenWidth : int = 1280 # width of window
font : cv2.HersheyFonts = cv2.FONT_HERSHEY_SIMPLEX # font initialized
cap : cv2.VideoCapture = cv2.VideoCapture(0)
cv2.namedWindow('setup')
cv2.setMouseCallback('setup', setRectPoints)
averages = avgHSVs(1, refPt)
calibrationPointsLRTB, calibrationPointsFB = calibration(averages, refPt)
DistLtoR = calibrationPointsLRTB[0] - calibrationPointsLRTB[1]
DistTtoB = calibrationPointsLRTB[3] - calibrationPointsLRTB[2]
DistFtoB = calibrationPointsFB[0] - calibrationPointsFB[1]