def _save_features(feature_path,
                   opensfm_config,
                   filepath,
                   points,
                   descriptors,
                   colors=None):
    io.mkdir_p(feature_path)
    features.save_features(filepath, points, descriptors, colors,
                           opensfm_config)
Exemplo n.º 2
0
 def _save_features(
     self,
     filepath: str,
     points: np.ndarray,
     descriptors: np.ndarray,
     colors: Optional[np.ndarray] = None,
     segmentations: Optional[np.ndarray] = None,
     instances: Optional[np.ndarray] = None,
 ) -> None:
     io.mkdir_p(self._feature_path())
     features.save_features(
         filepath,
         points,
         descriptors,
         colors,
         segmentations,
         instances,
         self.segmentation_labels(),
         self.config,
     )
Exemplo n.º 3
0
 def _save_features(
     self,
     filepath,
     points,
     descriptors,
     colors=None,
     segmentations=None,
     instances=None,
 ):
     io.mkdir_p(self._feature_path())
     features.save_features(
         filepath,
         points,
         descriptors,
         colors,
         segmentations,
         instances,
         self.segmentation_labels(),
         self.config,
     )
Exemplo n.º 4
0
def insert_features(feats, feats_file_path, config):
    """
    Input: 
        feats: Features to add to existing ORB features as a tuple (points, desc, color)
        feats_file_path: where the npz file is stored incl. npz file name
        config: SfM configuration info
    Output:
        saves a new npz file with extra features on it
    """
    fts = features.load_features(feats_file_path, config)

    assert (feats[0].shape[1] == fts[0].shape[1]
            )  # make sure we have the same dimension
    assert (feats[1].shape[1] == fts[1].shape[1]
            )  # make sure we have the same dimension
    assert (feats[2].shape[1] == fts[2].shape[1]
            )  # make sure we have the same dimension

    new_feat_pts = np.vstack((fts[0], feats[0]))  # append features together
    new_feat_desc = np.vstack((fts[1], feats[1]))
    new_feat_col = np.vstack((fts[2], feats[2]))

    features.save_features(feats_file_path, new_feat_pts, new_feat_desc,
                           new_feat_col, config)  # save features yeaaaaaah boi
Exemplo n.º 5
0
 def _save_features(self, filepath, points, descriptors, colors=None):
     io.mkdir_p(self._feature_path())
     features.save_features(filepath, points, descriptors, colors, self.config)