calculate angles in detect_keypoints