Ejemplo n.º 1
0
 def __save_features(self, filepath, image, points, descriptors, colors=None):
     io.mkdir_p(self.__feature_path())
     feature_type = self.config.get('feature_type')
     if ((feature_type == 'AKAZE' and self.config.get('akaze_descriptor') in ['MLDB_UPRIGHT', 'MLDB']) or
         (feature_type == 'HAHOG' and self.config.get('hahog_normalize_to_uchar', False))):
         feature_data_type = np.uint8
     else:
         feature_data_type = np.float32
     np.savez(filepath,
              points=points.astype(np.float32),
              descriptors=descriptors.astype(feature_data_type),
              colors=colors)
Ejemplo n.º 2
0
 def save_epipolar(self, im1, im2, R, t, X=[], inliers=[]):
     io.mkdir_p(self.__epipolar_path())
     np.savez(self.__epipolar_file(im1, im2), R=R, t=t, X=X, inliers=inliers)
Ejemplo n.º 3
0
 def save_matches(self, image, matches):
     io.mkdir_p(self.__matches_path())
     with gzip.open(self.__matches_file(image), 'wb') as fout:
         pickle.dump(matches, fout)
Ejemplo n.º 4
0
 def save_exif(self, image, data):
     io.mkdir_p(self.__exif_path())
     with open(self.__exif_file(image), 'w') as fout:
         fout.write(io.json_dumps(data))