def _detect_and_compute(self, frame: Frame): if frame not in self._feature_hash: keypoints, descriptors = self._orb.detectAndCompute( frame.get_frame(), None) self._feature_hash[frame] = (keypoints, descriptors) return self._feature_hash[frame]
def _quantize_frame(self, frame: Frame): """ Normalize pixel values from 0-255 to values from 0-self._scale_factor Returns quantized frame """ return np.floor(frame.get_frame().astype(np.float32) * self._scale_factor / 255.0).astype(np.int32)
def _detect_and_compute(self, frame: Frame): if frame not in self._feature_hash: keypoints = self._fast.detect(frame.get_frame(), None) keypoints = ssc( keypoints, 10000, 0.1, frame.get_frame().shape[1], frame.get_frame().shape[0], ) descriptors = self._orb.compute(frame.get_frame(), keypoints) keypoints = descriptors[0] descriptors = descriptors[1] self._feature_hash[frame] = (keypoints, descriptors) return self._feature_hash[frame]