video_to_dvs.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:spiking-ratslam 作者: bjkomer 项目源码 文件源码
def run(self):
        while not rospy.is_shutdown():
            if self.im_data:
                im = self.im_data.popleft()
                self.im_im.set_data(im)
                self.im_fig.canvas.draw()

                # Get grayscale image for converting to DVS
                gray_im = cv2.cvtColor(im, cv2.COLOR_RGB2GRAY)
                diff_im = gray_im.astype(np.int16) - self.prev_im
                diff_im[np.where((diff_im < self.tol) & (diff_im > -self.tol))] = 0
                diff_im[np.where(diff_im >= self.tol)] = 1
                diff_im[np.where(diff_im <= -self.tol)] = -1
                self.prev_im = np.copy(gray_im)
                self.dv_im.set_data(diff_im)
                self.dv_fig.canvas.draw()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号