def make_image():
    image = np.random.rand(20, 70, 3)
    window = cv2.createHanningWindow((image.shape[1], image.shape[0]), cv2.CV_64FC1)
    grayscale = np.mean(image, 2)
    hanned = grayscale * window
    image_fft = PhaseCorrelate.preprocessForPhaseCorrelate(hanned)
    return image, image_fft
Beispiel #2
0
 def preprocess(self, im):
     if self._window is None:
         self._window = cv2.createHanningWindow((im.shape[1], im.shape[0]), cv2.CV_64FC1)
     # grayscale = np.mean(im, 2)
     hanned = im * self._window
     image_fft = PhaseCorrelate.preprocessForPhaseCorrelate(hanned)
     return image_fft