-
-
Save amarlearning/238ff29ba026e3ec8000be50bdd534e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hand_histogram(frame): | |
global hand_rect_one_x, hand_rect_one_y | |
hsv_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) | |
roi = np.zeros([90, 10, 3], dtype=hsv_frame.dtype) | |
for i in range(total_rectangle): | |
roi[i * 10: i * 10 + 10, 0: 10] = hsv_frame[hand_rect_one_x[i]:hand_rect_one_x[i] + 10, | |
hand_rect_one_y[i]:hand_rect_one_y[i] + 10] | |
hand_hist = cv2.calcHist([roi], [0, 1], None, [180, 256], [0, 180, 0, 256]) | |
return cv2.normalize(hand_hist, hand_hist, 0, 255, cv2.NORM_MINMAX) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment