openlifu.nav.photoscan¶
Functions
|
Transforms an image array to undo or redo EXIF orientation. |
Converts a mesh (polydata, unstructured grid or even just a point cloud) between the LPS (left-posterior-superior) coordinate system and RAS (right-anterior-superior) coordinate system. |
|
|
Converts a numpy array with dimensions [HxWx3] representing an RGB image into vtkImageData |
|
Extract the node names and downscale factor used in the DepthMap_1 node from a Meshroom pipeline. |
Get a list of names of valid meshroom pipelines that can be used in run_reconstruction |
|
|
This function returns the data directly from the model and texture filepaths without requiring a photoscan object. param model_abspath: absolute filepath to model data texture abspath: absolute filepath to texture data Returns: Photoscan data as (model_vtkpolydata, texture_vtkimagedata). |
|
param parent_dir: parent directory containing model and texture data filepaths Returns: Photoscan data as (model_vtkpolydata, texture_vtkimagedata) |
|
This function assumes that the model is saved to file in LPS coordinates. |
|
|
|
Runs MODNet on a list of image paths and saves the output masks. |
|
Merge the UDIM textures output by meshroom into a single large texture |
|
Preprocess an input image for MODNet inference. |
|
Sorts and sub-samples a list of image file paths. |
|
|
|
|
|
Run Meshroom with the given images and pipeline. :param images: List of image file paths. :type images: list[Path] :param pipeline_name: Name of the Meshroom pipeline in meshroom_pipelines folder. See also get_meshroom_pipeline_names. :type pipeline_name: str :param input_resize_width: Width to which input images will be resized, in pixels. :type input_resize_width: int :param use_masks: Whether to include a background removal step to filter the dense reconstruction. :type use_masks: bool :param matching_mode: Strategy for generating image pairs. One of: - 'exhaustive': Match every image with every other image. - 'sequential': Match each image with the previous and next window_radius images (no wrap-around). - 'sequential_loop': Like 'sequential' but wraps around at the end of the sequence. - 'spatial': Match each image with its num_neighbors nearest neighbors based on 3D location. :type matching_mode: str :param window_radius: Required for 'sequential' and 'sequential_loop' matching_mode. Number of images forward and backward in the sequence to try and match with. :type window_radius: int | None :param num_neighbors: Required for 'spatial' matching_mode. Number of nearest neighbors to match based on 3D distance in locations. :type num_neighbors: int | None :param locations: Required for 'spatial'. Must be the same length as images. Provides 3D coordinates for spatial matching. :type locations: List[Tuple[float, float, float]]] | None :param return_durations: If True, also return a dictionary mapping node names to durations in seconds. :type return_durations: bool :param progress_callback: An optional function that will be called to report progress. The function should accept two arguments: an integer progress value from 0 to 100 followed by a string message describing the step currently being worked on. :param download_masking_model: Whether to auto-download the masking model weights if they are not present; only relevant if use_masks is enabled. |
|
Run a subprocess and stream its stdout and stderr output to separate handlers/loggers. |
|
Convert UDIM string to tile coordinates |
|
Convert image index-based pairs to Meshroom internal view ID pairs using the provided camera_init_file. |
Classes
|