def show_frame(self): image = self.images[int(self.frame - self.bounds[0])] ridf = nb.ridf(image, self.snap) if self.axes_image is None: self.axes_image = self.ax_imshow.imshow(image, cmap='gray') else: self.axes_image.set_data(image) self.ax_imshow.set_title('Frame %i/%i' % (self.frame + 1, len(self))) nb.plot_ridf(ridf, self.ax_ridf) self.figure.canvas.draw()
def test_step2(): compare_mat(ridf(im0, im0, step=2), [0]) compare_mat(ridf(im3, im3, step=2), [0, 1/2])
def test_other(): compare_mat(ridf(im1, im2), [2/3, 0, 2/3]) compare_mat(ridf(im2, im1), [2/3, 2/3, 0])
def test_multi(): compare_mat(ridf([im1, im2], im1), [[0, 2/3, 2/3], [2/3, 2/3, 0]]) res = ridf([im1, im1, im2], im1) compare_mat(res, [[0, 2/3, 2/3], [0, 2/3, 2/3], [2/3, 2/3, 0]])
def test_autoridf(): compare_mat(ridf(im0, im0), [0, 0]) compare_mat(ridf(im1, im1), [0, 2/3, 2/3])