SBCV / SatelliteSurfaceReconstruction

3D Surface Reconstruction From Multi-Date Satellite Images, ISPRS, 2021
BSD 3-Clause "New" or "Revised" License
101 stars 15 forks source link

Problems installing ColmapForVisSatPatched #9

Closed lw0210 closed 2 years ago

lw0210 commented 2 years ago

Hello, I installed ColmapForVisSatPatched according to your suggestion. You can install the official colmap. But when I

Create a set of patches from a modified Colmap repository, it display :'ColmapForVisSatPatched/create_patches.sh: 77: ColmapForVisSatPatched/create_patches.sh: cannot create ....../patches/srcutiloption_manager.cc.patch: Directory nonexistent'.How can I solve the problem? What is the order of installing ColmapForVisSatPatched?

SBCV commented 2 years ago

Did you solve this problem? If yes can you describe what solved the issue? Then I'll update the documentation accordingly.

Note: You need to execute the scripts directly. Using sh is not allowed, i.e. something like sh ColmapForVisSatPatched/create_patches.sh ColmapWithModifications will (as far is I remember) produce incorrect results.

I've fixed the execute permissions of the script, so you can run them without sh. Did this help?

lw0210 commented 2 years ago

Yes,Thanks!I did use the sh command. I should use bash, now there is no error. But I want to ask if run apply patches.sh and create patches.sh, and install colmap (official) in the same folder ColmapToBePatched or ColmapWithModifications.

------------------ 原始邮件 ------------------ 发件人: "SBCV/SatelliteSurfaceReconstruction" @.>; 发送时间: 2022年10月24日(星期一) 晚上6:30 @.>; @.>;"State @.>; 主题: Re: [SBCV/SatelliteSurfaceReconstruction] Problems installing ColmapForVisSatPatched (Issue #9)

Did you solve this problem? If yes can you describe what solved the issue? Then I'll update the documentation accordingly.

Note: You need to execute the scripts directly. Using sh is not allowed, i.e. something like sh ColmapForVisSatPatched/create_patches.sh ColmapWithModifications will (as far is I remember) produce incorrect results.

I've fixed the execute permissions of the script, so you can run them without sh. Did this help?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

SBCV commented 2 years ago

That depends on what you are trying to do. Note: You need to run the create_ patches.sh only if you want to create new patch files for a more recent colmap version (for example, if you want to contribute to the repository). If you just want to patch colmap with the patch files in https://github.com/SBCV/ColmapForVisSatPatched/tree/main/patches, then running apply_ patches.sh is sufficient.

lw0210 commented 2 years ago

Ok,thanks!I see. If I just want to reproduce your code, I just need to run apply_ patch. sh, then install colmap according to the official install installations of Colmap for Linux (mkdir build and make install in ColmapToBePatched folder ).Am I right?

And  under this requirement(Install at least one of the following MVS & surface reconstruction libraries), I installed MVE and colmap. Can I meet the requirement without installing GDMR and OpenMVS?

------------------ 原始邮件 ------------------ 发件人: "SBCV/SatelliteSurfaceReconstruction" @.>; 发送时间: 2022年10月24日(星期一) 晚上9:00 @.>; @.>;"State @.>; 主题: Re: [SBCV/SatelliteSurfaceReconstruction] Problems installing ColmapForVisSatPatched (Issue #9)

That depends on what you are trying to do. Note: You need to run the create patches.sh only if you want to create new patch files for a more recent colmap version (for example, if you want to contribute to the repository). If you just want to patch colmap with the patch files in https://github.com/SBCV/ColmapForVisSatPatched/tree/main/patches, then running apply patches.sh is sufficient.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

SBCV commented 2 years ago

Ok,thanks!I see. If I just want to reproduce your code, I just need to run apply_ patch. sh, then install colmap according to the official install installations of Colmap for Linux (mkdir build and make install in ColmapToBePatched folder ).Am I right?

Yes

And  under this requirement(Install at least one of the following MVS & surface reconstruction libraries), I installed MVE and colmap. Can I meet the requirement without installing GDMR and OpenMVS?

Yes (if I remember correctly)

lw0210 commented 2 years ago

Ok!I I'll try. Thank you very much for your reply!

------------------ 原始邮件 ------------------ 发件人: "SBCV/SatelliteSurfaceReconstruction" @.>; 发送时间: 2022年10月24日(星期一) 晚上10:26 @.>; @.>;"State @.>; 主题: Re: [SBCV/SatelliteSurfaceReconstruction] Problems installing ColmapForVisSatPatched (Issue #9)

Ok,thanks!I see. If I just want to reproduce your code, I just need to run apply_ patch. sh, then install colmap according to the official install installations of Colmap for Linux (mkdir build and make install in ColmapToBePatched folder ).Am I right?

Yes

And  under this requirement(Install at least one of the following MVS & surface reconstruction libraries), I installed MVE and colmap. Can I meet the requirement without installing GDMR and OpenMVS?

Yes (if I remember correctly)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

lw0210 commented 1 year ago

Dear,I only download the [Data Fusion Contest 2019 (dfc2019) Track 3]  dataset.When I  run the runpipeline.py it  display  "TypeError " as shown below.I checked the pipeline Template.toml file,this dataset has no width and ul_ Easting parameter.How can I solve this problem?

------------------ 原始邮件 ------------------ 发件人: "SBCV/SatelliteSurfaceReconstruction" @.>; 发送时间: 2022年10月24日(星期一) 晚上10:26 @.>; @.>;"State @.>; 主题: Re: [SBCV/SatelliteSurfaceReconstruction] Problems installing ColmapForVisSatPatched (Issue #9)

Ok,thanks!I see. If I just want to reproduce your code, I just need to run apply_ patch. sh, then install colmap according to the official install installations of Colmap for Linux (mkdir build and make install in ColmapToBePatched folder ).Am I right?

Yes

And  under this requirement(Install at least one of the following MVS & surface reconstruction libraries), I installed MVE and colmap. Can I meet the requirement without installing GDMR and OpenMVS?

Yes (if I remember correctly)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

SBCV commented 1 year ago

@wagnva can you have a look at this?

lw0210 commented 1 year ago

Is it possible that the problem is dataset? I see that the MVS3DM Dataset has width and ul Easting parameter in the pipeline Template.toml file,but I don't know how to download the MVS3DM dataset.

wagnva commented 1 year ago

When using the DFC2019 dataset the input folder should have the following format:

├── input
│   ├── JAX_004_*_RGB.tif
│   └── JAX_004_*_RGB.tif
│   └── JAX_004_*_RGB.tif
│   └── JAX_004_*_RGB.tif   ... all the .tif for one location
│   └── JAX_004_DSM.txt

The JAX_004_DSM.txt is from the Track 3 / Training data / Reference Train-Track3-Truth.zip and contains the missing parameters.

Following is how the pipeline.toml looks in my setup when using the DFC2019 dataset. (Everything following after this block in the pipeline.toml is related to the IARPA MVS3DM dataset, and therefore commented out)

# ===== DFC2019 Track3 dataset =====
dataset_adapter = "ssr.input_adapters.adapter_DFC2019"
satellite_image_rgb_tif_dp = "/path/to/input"
run_input_adapter = 1
pan_sharpening = 0  # the DFC2019 dataset is already pan sharpened
depth_map_recovery = 1
skew_correction = 1

# ===== DFC2019 Site 1 =====
zone_number = 17  # JAX is 17, OMA 15
hemisphere = "N"
alt_min = -20.0
alt_max = 100.0
lw0210 commented 1 year ago

Thanks! I copy the .txt file into the image can successfully run "runpipeline. py". However, only one category can be run such as JAX 004* RGB.tif or JAX 007*_ RGB.tif. If I run all data sets, the following error will occur: INFO:root:The following config entry may not have been set correctly: satellite_image_pan_dp= INFO:root:The following config entry may not have been set correctly: satellite_image_msi_dp= INFO:root:Running dataset preprocessing using the following adapter: ssr.input_adapters.adapter_DFC2019 INFO:root:Importing the DFC2019 dataset INFO:root:Imported JAX_004_006_RGB.tif INFO:root:Imported JAX_004_007_RGB.tif INFO:root:Imported JAX_004_009_RGB.tif INFO:root:Imported JAX_004_010_RGB.tif INFO:root:Imported JAX_004_012_RGB.tif INFO:root:Imported JAX_004_013_RGB.tif INFO:root:Imported JAX_004_014_RGB.tif INFO:root:Imported JAX_004_015_RGB.tif INFO:root:Imported JAX_004_016_RGB.tif INFO:root:Imported JAX_004_019_RGB.tif INFO:root:Imported JAX_004_022_RGB.tif INFO:root:Read location metadata: ul_easting=431982.995119 INFO:root:Read location metadata: ul_northing=3358775.499913 INFO:root:Read location metadata: width=256.0 INFO:root:Read location metadata: height=256.0 INFO:root:Imported JAX_017_001_RGB.tif INFO:root:Imported JAX_017_002_RGB.tif INFO:root:Imported JAX_017_004_RGB.tif INFO:root:Imported JAX_017_005_RGB.tif INFO:root:Imported JAX_017_006_RGB.tif INFO:root:Imported JAX_017_011_RGB.tif INFO:root:Imported JAX_017_012_RGB.tif INFO:root:Imported JAX_017_015_RGB.tif INFO:root:Imported JAX_017_016_RGB.tif INFO:root:Imported JAX_017_022_RGB.tif INFO:root:Imported JAX_018_001_RGB.tif INFO:root:Imported JAX_018_002_RGB.tif INFO:root:Imported JAX_018_004_RGB.tif INFO:root:Imported JAX_018_005_RGB.tif INFO:root:Imported JAX_018_006_RGB.tif INFO:root:Imported JAX_018_007_RGB.tif INFO:root:Imported JAX_018_009_RGB.tif INFO:root:Imported JAX_018_011_RGB.tif INFO:root:Imported JAX_018_012_RGB.tif INFO:root:Imported JAX_018_015_RGB.tif INFO:root:Imported JAX_018_018_RGB.tif INFO:root:Imported JAX_020_001_RGB.tif INFO:root:Imported JAX_020_002_RGB.tif INFO:root:Imported JAX_020_003_RGB.tif INFO:root:Imported JAX_020_004_RGB.tif INFO:root:Imported JAX_020_005_RGB.tif INFO:root:Imported JAX_020_006_RGB.tif INFO:root:Imported JAX_020_007_RGB.tif INFO:root:Imported JAX_020_011_RGB.tif INFO:root:Imported JAX_020_014_RGB.tif INFO:root:Imported JAX_020_015_RGB.tif INFO:root:Imported JAX_020_016_RGB.tif INFO:root:Imported JAX_020_020_RGB.tif INFO:root:Imported JAX_022_001_RGB.tif INFO:root:Imported JAX_022_002_RGB.tif INFO:root:Imported JAX_022_004_RGB.tif INFO:root:Imported JAX_022_005_RGB.tif INFO:root:Imported JAX_022_006_RGB.tif INFO:root:Imported JAX_022_009_RGB.tif INFO:root:Imported JAX_022_010_RGB.tif INFO:root:Imported JAX_022_011_RGB.tif INFO:root:Imported JAX_022_012_RGB.tif INFO:root:Imported JAX_022_015_RGB.tif ......

warnings.warn( /home/liwei/anaconda3/envs/sbcv/lib/python3.8/site-packages/llvmlite/llvmpy/core.py:8: UserWarning: The module llvmlite.llvmpy.core is deprecated and will be removed in the future. Equivalent functionality is provided by llvmlite.ir. warnings.warn( {'dataset_dir': '', 'work_dir': '/home/liwei/lw/shiwai0/SatelliteSurfaceReconstruction/output/visdp', 'bounding_box': {'zone_number': 17, 'hemisphere': 'N', 'ul_easting': 431982.995119, 'ul_northing': 3358775.499913, 'width': 256.0, 'height': 256.0}, 'steps_to_run': {'clean_data': False, 'crop_image': False, 'derive_approx': True, 'choose_subset': True, 'colmap_sfm_perspective': True, 'inspect_sfm_perspective': True, 'reparam_depth': True, 'colmap_mvs': True, 'aggregate_2p5d': True, 'aggregate_3d': True}, 'alt_min': -20.0, 'alt_max': 100.0} step clean_data: skipped step crop_image: skipped INFO:root:deriving an affine camera approximation... INFO:root:scene coordinate frame is in lat, lon, alt INFO:root:residual error (pixels): 0.016066878046894585 Traceback (most recent call last): File "ssr/run_pipeline.py", line 67, in vissat_pipeline.run(ssr_config.reconstruct_sfm_mvs) File "/home/liwei/lw/shiwai0/SatelliteSurfaceReconstruction/ssr/sfm_mvs_rec/vissat_pipeline.py", line 98, in run pipeline.run() File "/home/liwei/lw/shiwai0/SatelliteSurfaceReconstruction/VisSatSatelliteStereo/stereo_pipeline.py", line 95, in run self.run_derive_approx() File "/home/liwei/lw/shiwai0/SatelliteSurfaceReconstruction/VisSatSatelliteStereo/stereo_pipeline.py", line 286, in run_derive_approx appr.approx_affine_latlonalt() File "/home/liwei/lw/shiwai0/SatelliteSurfaceReconstruction/VisSatSatelliteStereo/camera_approx.py", line 131, in approx_affine_latlonalt P = solve_affine(lat_points, lon_points, alt_points, col, row, keep_mask) File "/home/liwei/lw/shiwai0/SatelliteSurfaceReconstruction/VisSatSatelliteStereo/lib/solve_affine.py", line 68, in solve_affine logging.info('residual error (pixels): {}'.format(np.sqrt(res[1][0] / point_cnt))) IndexError: index 0 is out of bounds for axis 0 with size 0 It seems that only one .txt is read. Is it possible to run one scenario at a time instead of all at once?

wagnva commented 1 year ago

If you want to run the pipeline for each location, you unfortunately need to split each location into its own folder and then run it for each of these consecutively. The pipeline expects there to be only .tif for one location and one .txt in the input folder. Just copy the relevant files into its own folder and use this as input.

lw0210 commented 1 year ago

Ok,thank you!