(self, img)
| 125 | draw_str(vis, (x1, y2+16), 'PSR: %.2f' % self.psr) |
| 126 | |
| 127 | def preprocess(self, img): |
| 128 | img = np.log(np.float32(img)+1.0) |
| 129 | img = (img-img.mean()) / (img.std()+eps) |
| 130 | return img*self.win |
| 131 | |
| 132 | def correlate(self, img): |
| 133 | C = cv2.mulSpectrums(cv2.dft(img, flags=cv2.DFT_COMPLEX_OUTPUT), self.H, 0, conjB=True) |