leftfield-geospatial/orthority

running

Closed this issue · 13 comments

xxsle commented

Hello. is there any error in the code that will prevent it from running? I can't run it. can you explain in detail how I should run the code? I would be very grateful if you can.

Hello. Please send the command line or code snippet you are using, and the error message you get.

xxsle commented

Hi. Help me pls. the project runned with default arguments (rgb tif file, dem tif file, pos ori file)

but rasterio raised some kind errors like; PHOTOMETRIC=YCBCR requires COMPRESS=JPEG

i dont know much what is that but i did convert the tif file to jpeg binary and i see the stored image. i have passed the new rgb tif file, firstly jpeg extension and then tif extension but a new exception raised from program.

the new one is about crs configuration, i look the source code and i've passed a parameter in exif.py based in rio.open(fp, mode, crs=example_crs) but nothing changes. actually i have no idea how you can work it properly. the demo files are all of your files.

please fix the issues and update the project.

bb2e5115-ac53-4911-b861-5966c4e421f8

Hello, The config.yaml file is set up for the simple-otho example data. You need to change the settings to get it to work with your camera & image data. It sounds like your input tif image has a photometric: ycbcr setting, which is not compatible with compress: deflate in config.yaml. To fix that you could try changing your config.yaml to have the compress, interleave and photometric options configured as:

...
ortho:
  ...
  compress: deflate
  interleave: band
  photometric: minisblack
  ...

Then, you also need to set the crs: option in config.yaml to the CRS (projection) of your camera positions in camera_pos_ori.txt if your input images have no CRS, or are not in the same CRS as your camera positions. E.g.

...
ortho: 
  crs: EPSG:<your EPSG code>
...

I am working on some changes that will simplify the configuration, and make some of this more obvious, but for now you need to use config.yaml.

xxsle commented

WhatsApp Image 2023-07-14 at 16 41 03
I added this code when I got crs error

WhatsApp Image 2023-07-14 at 16 41 04
rasterio._err.CPLE_AppDefinedError: Invalid coordinate
it gives a new error. it says the coordinate is incorrect. what should I do? I would be very grateful if you can help.

The crs setting in config.yaml needs to be a projected and not a geographic coordinate system. If your camera positions in camera_pos_ori.txt are in EPSG:4326, you will need to reproject them into projected coordinate system, and specify that CRS in config.yaml. I will make this clearer in the docs.

xxsle commented

I'm getting errors even though I'm doing what you mentioned. how exactly did you get it to work? why am I getting so many errors?

WhatsApp Image 2023-07-19 at 13 25 02

Based on the error message, it looks like there is no entry for 3324c_2015_1004_05_0182_RGB in camera_pos_ori.txt.

If you follow the guidelines in the readme, and have accurate camera parameter (position, orientation, focal length etc ) and DEM data, it should work. I would start by running the example.

If you have done all that and are getting an error, please share data and a command line to reproduce the error so that I can diagnose it.

xxsle commented

I wanted to run your data first anyway. could you please share all your input data with me? I can give you my e-mail address

The data is in the repository. Please follow the instructions in the readme.

xxsle commented

yes i already used those instructions and that data. but i got the errors i sent you. what can i do :(

The command line in the image you posted above is not the same as in the readme example. Please follow the installation instructions exactly. Then change into the simple-ortho directory.

cd simple-ortho

Then run the example.

simple-ortho -v 2 -rc ./data/inputs/test_example/config.yaml -od ./data/outputs/test_example ./data/inputs/test_example/*RGB.tif ./data/inputs/test_example/dem.tif ./data/inputs/test_example/camera_pos_ori.txt
xxsle commented

WhatsApp Image 2023-07-21 at 00 23 10
I got a single image result . why do you think this happened? multiple images did not overlap as in the output result you shared. so multiple images did not come out like your output result, the images did not overlap like the output result you shared. I would be very grateful if you could answer me. (the bottom one is your result)
WhatsApp Image 2023-07-21 at 00 23 49

dugalh commented

simple-ortho produces a single orthorectified image for each source image. To display a group of overlapping images in their geo-referenced locations, you could use something like QGIS.