Пример #1
0
 def create_scene_from_sfm_result(
     self, ifp_or_idp, mve_workspace, downscale_level=-1, lazy=False
 ):
     views_folder = os.path.join(mve_workspace, "views")
     if (
         os.path.isdir(mve_workspace)
         and os.path.isdir(views_folder)
         and lazy
     ):
         return
     mve_creator = MVECreator(workspace_dp=mve_workspace)
     mve_creator.create_scene_from_sfm_result(ifp_or_idp, downscale_level)
Пример #2
0
    def create_textured_mesh_from_nvm_and_mesh(
        self,
        nvm_ifp,
        untextured_mesh_ifp,
        mve_workspace,
        texture_odp,
        lazy=True,
    ):

        logger.info("create_textured_mesh_from_nvm: ...")
        mve_creator = MVECreator(workspace_dp=mve_workspace)
        if not lazy or not os.path.isdir(mve_workspace):
            mve_creator.create_scene_from_sfm_result(nvm_ifp)

        texrecon = MVETexrecon()
        texrecon.create_textured_mesh(
            mve_workspace, untextured_mesh_ifp, texture_odp
        )
        logger.info("create_textured_mesh_from_nvm: Done")
Пример #3
0
    def compute_gdmr_reconstruction(
        self,
        mve_workspace,
        point_cloud_with_scale_ply_ifp=None,
        mesh_ply_ofp=None,
        lazy=False,
    ):
        mve_creator = MVECreator(workspace_dp=mve_workspace)
        if point_cloud_with_scale_ply_ifp is None:
            point_cloud_with_scale_ply_ifp = (
                mve_creator.get_point_cloud_with_scale_ply_fp()
            )
        if mesh_ply_ofp is None:
            mesh_ply_ofp = mve_creator.get_mesh_ply_fp()

        if not os.path.isfile(mesh_ply_ofp) or not lazy:
            msr = MultiScaleReconstructor()
            msr.create_mesh_from_point_cloud(
                point_cloud_with_scale_ply_ifp, mve_workspace, mesh_ply_ofp
            )
Пример #4
0
    def compute_dense_point_cloud_from_depth_maps(
        self,
        mve_workspace,
        point_cloud_with_scale_ply_ofp=None,
        downscale_level=0,
        view_ids=None,
        fssr_output=True,
        lazy=False,
    ):
        mve_creator = MVECreator(workspace_dp=mve_workspace)
        if point_cloud_with_scale_ply_ofp is None:
            point_cloud_with_scale_ply_ofp = (
                mve_creator.get_point_cloud_with_scale_ply_fp()
            )

        if not os.path.isfile(point_cloud_with_scale_ply_ofp) or not lazy:
            mve_creator.compute_dense_point_cloud_from_depth_maps(
                point_cloud_with_scale_ply_ofp,
                downscale_level=downscale_level,
                view_ids=view_ids,
                fssr_output=fssr_output,
            )
Пример #5
0
    def compute_clean_mesh(
        self,
        mve_workspace,
        mesh_ply_ifp=None,
        mesh_cleaned_ply_ofp=None,
        delete_color=True,
        lazy=False,
    ):
        mve_creator = MVECreator(workspace_dp=mve_workspace)
        if mesh_ply_ifp is None:
            mesh_ply_ifp = mve_creator.get_mesh_ply_fp()
        if mesh_cleaned_ply_ofp is None:
            mesh_cleaned_ply_ofp = mve_creator.get_mesh_cleaned_ply_fp()

        if not os.path.isfile(mesh_cleaned_ply_ofp) or not lazy:
            mve_creator.compute_cleaned_mesh(
                mesh_ply_ifp,
                mesh_cleaned_ply_ofp,
                delete_color=delete_color,
                delete_scale=True,
                delete_conf=True,
            )
Пример #6
0
 def compute_depth_maps(self, mve_workspace, downscale_level=0):
     mve_creator = MVECreator(workspace_dp=mve_workspace)
     mve_creator.compute_depth_maps(downscale_level=downscale_level)
Пример #7
0
 def import_images_to_scene(self, image_idp, mve_workspace):
     mve_creator = MVECreator(workspace_dp=mve_workspace)
     mve_creator.import_images_to_scene(image_idp)