示例#1
0
    def run_whole_image(self, img, minu_thr=0.2):
        # feed_dict = {self.images_placeholder: img}
        # minutiae_cylinder = self.sess.run(self.minutiae_cylinder_placeholder, feed_dict=feed_dict)

        img = img / 128.0 - 1
        img = np.expand_dims(img, axis=2)
        img = np.expand_dims(img, axis=0)
        feed_dict = {self.images_placeholder: img}
        minutiae_cylinder = self.sess.run(self.minutiae_cylinder_placeholder, feed_dict=feed_dict)

        minutiae_cylinder = np.squeeze(minutiae_cylinder, axis=0)
        #start = timeit.default_timer()
        minutiae = prepare_data.get_minutiae_from_cylinder2(minutiae_cylinder, thr=0.25)
        # stop = timeit.default_timer()
        # minu_time = stop - start
        # print minu_time
        # cv2.imwrite('test_0.jpeg', (minutiae_cylinder[:, :, 0:3]) * 255)
        # cv2.imwrite('test_1.jpeg', (minutiae_cylinder[:, :, 3:6]) * 255)
        # cv2.imwrite('test_2.jpeg', (minutiae_cylinder[:, :, 6:9]) * 255)
        # cv2.imwrite('test_3.jpeg', (minutiae_cylinder[:, :, 9:12]) * 255)
        # prepare_data.show_features(img, minutiae, fname=os.path.basename(file)[:-4] +'.jpeg')

        minutiae = prepare_data.refine_minutiae(minutiae, dist_thr=10, ori_dist=np.pi / 4)

        minutiae = self.remove_crowded_minutiae(minutiae)
        return minutiae
示例#2
0
    def run_whole_image(self, img, minu_thr=0.2):
        img = img / 128.0 - 1
        img = np.expand_dims(img, axis=2)
        img = np.expand_dims(img, axis=0)
        feed_dict = {self.images_placeholder: img}
        minutiae_cylinder = self.sess.run(self.minutiae_cylinder_placeholder, feed_dict=feed_dict)

        minutiae_cylinder = np.squeeze(minutiae_cylinder, axis=0)
        minutiae = prepare_data.get_minutiae_from_cylinder2(minutiae_cylinder, thr=minu_thr)
        minutiae = prepare_data.refine_minutiae(minutiae, dist_thr=20, ori_dist=np.pi / 4)

        minutiae = self.remove_crowded_minutiae(minutiae)
        return minutiae