Giter Club home page Giter Club logo

s2p's People

Contributors

carlodef avatar cpalmann avatar dumasl avatar dyoussef avatar gfacciol avatar glostis avatar jguinet avatar jmichel-otb avatar learning4life avatar mnhrdt avatar oleg-alexandrov avatar sdrdis avatar wdixon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

s2p's Issues

Provided Preview image not found

Hi,

I tried to run S2p on a TriStereo Pleiade Image. Unfortunately, the processing of the entire image is way too greedy with RAM, CPU and disk space.

The solution would be to run the script on a ROI of the image. The "README" explains that if none of the ROI or full_img flags are present, I can provide a preview of the main image and select the ROI on this image.

My "image" dictionary with be define as:

"images" : [
    { "prv" : "PRV_02.JPG", 
      "img" : "IMG_02.tif",
      "rpc" : "RPC_02.xml" },
    { "img" : "IMG_01.tif",
      "rpc" : "RPC_01.xml" },
    { "img" : "IMG_03.tif",
      "rpc" : "RPC_03.xml"}
    ]

But the script ends with this error:

Traceback (most recent call last):
  File "s2p.py", line 809, in <module>
    main(user_cfg, args.step)
  File "s2p.py", line 666, in main
    initialization.build_cfg(user_cfg)
  File "/s2p/s2plib/initialization.py", line 110, in build_cfg
    check_parameters(user_cfg)
  File "/s2p/s2plib/initialization.py", line 78, in check_parameters
    d['images'][0]['prv'])
  File "/s2p/s2plib/common.py", line 708, in get_roi_coordinates
    nc_preview, nr_preview = image_size_gdal(preview)[:2]
  File "/s2p/s2plib/common.py", line 172, in image_size_gdal
    f = gdal.Open(im)
  File "/usr/lib/python2.7/dist-packages/osgeo/gdal.py", line 2943, in Open
    return _gdal.Open(*args)
RuntimeError: PRV_02.JPG: No such file or directory

The PRV_02.JPG really exists and is located in the same directory as the image. What do I do wrong with this "prv" key?

Do you have an idea of how much disk space will be enough to process the whole image (around 220 km²)?

Thanks in advance for your help!

RuntimeWarning: Mean of empty slice ... or ... gdalbuildvrt ERROR 1: No input dataset specified.

Hi,

I am attempting to run s2p, but I am getting some runtime errors, and I am not sure how to proceed. This is what I've done: I acquired/assembled the XML and TIF files, and edited the config JSON with this information. There are only a few parameters I changed from the basic example that ships with the code: (testdata/input_pair/config.json).

  1. I have three images, and no access to the original image that these were clipped from. So, if I am understanding correctly, I set 'full_img' = True
  2. I updated the 'images' list with "img" and "rpc" for each image
  3. I wasn't sure if 'utm_bbx' was used, but I populated this also with average "middle" values of the valid UTM ranges of each of the images, given the RPC parameters.

With this assumptions, I tried calling the s2p algorithm. It works great for the input_pair and input_triplet data, but when I run it on my own data (using 3-images from a dataset), I get the following runtime error:

WARNING: ignoring unknown parameter utm_bbx.                                                                                       
tile size: 286 286                                                                                                                 
total number of tiles: 98 (7 x 7) x 2 pairs                                                                                        
                                                                                                                                   
discarding masked tiles...                                                                                                         
done 49 / 49 tiles                                                                                                                 
Elapsed time: 0:00:00.136507                                                                                                       
                                                                                                                                   
correcting pointing locally...                                                                                                     
done 98 / 98 tiles                                                                                                                 
Elapsed time: 0:00:12.288325                                                                                                       
                                                                                                                                   
correcting pointing globally...                                                                                                    
Elapsed time: 0:00:00.016108                                                                                                       
                                                                                                                                   
rectifying tiles...                                                                                                                
Elapsed time: 0:00:03.823495                                                                                                       
                                                                                                                                   
running stereo matching...                                                                                                         
Elapsed time: 0:02:18.679599                                                                                                       
                                                                                                                                   
computing height maps...                                                                                                           
Elapsed time: 0:00:03.921784                                                                                                       
                                                                                                                                   
computing local pairwise height offsets...                                                                                         
done 49 / 49 tiles                                                                                                                 
Elapsed time: 0:00:00.218622                                                                                                       
                                                                                                                                   
computing global pairwise height offsets...                                                                                        
**./pipelines/1st/s2p.py:343: RuntimeWarning: Mean of empty slice**                                                                    
  global_mean_heights = np.nanmean(local_mean_heights, axis=0)                                                                     
merging height maps and computing point clouds...                                                                                  
Elapsed time: 0:00:02.440702                                                                                                       
                                                                                                                                   
computing global source window (xoff, yoff, xsize, ysize)...                                                                       
Elapsed time: 0:00:00.000659                                                                                                       
                                                                                                                                   
computing DSM by tile...                                                                                                           
Elapsed time: 0:00:00.114463                                                                                                       
                                                                                                                                   
computing global DSM...  

RUN: gdalbuildvrt -vrtnodata nan -input_file_list ./data/tmp/s2p_out/gdalbuildvrt_input_file_list.txt ./data/tmp/s2p_out/dsm.vrt   
ERROR 1: No input dataset specified.                                                                                               
Usage: gdalbuildvrt [-tileindex field_name]                                                                                        
                    [-resolution {highest|lowest|average|user}]                                                                    
                    [-te xmin ymin xmax ymax] [-tr xres yres] [-tap]                                                               
                    [-separate] [-b band] [-sd subdataset]                                                                         
                    [-allow_projection_difference] [-q]                                                                            
                    [-addalpha] [-hidenodata]                                                                                      
                    [-srcnodata "value [value...]"] [-vrtnodata "value [value...]"]                                                
                    [-a_srs srs_def]                                                                                               
                    [-r {nearest,bilinear,cubic,cubicspline,lanczos,average,mode}]                                                 
                    [-input_file_list my_list.txt] [-overwrite] output.vrt [gdalfile]*                                             
                                                                                                                                   
e.g.                                                                                                                               
  % gdalbuildvrt doq_index.vrt doq/*.tif                                                                                           
  % gdalbuildvrt -input_file_list my_list.txt doq_index.vrt                                                                        
                                                                                                                                   
NOTES:                                                                                                                             
  o With -separate, each files goes into a separate band in the VRT band.                                                          
    Otherwise, the files are considered as tiles of a larger mosaic.                                                               
  o -b option selects a band to add into vrt.  Multiple bands can be listed.                                                       
    By default all bands are queried.                                                                                              
  o The default tile index field is 'location' unless otherwise specified by                                                       
    -tileindex.                                                                                                                    
  o In case the resolution of all input files is not the same, the -resolution                                                     
    flag enable the user to control the way the output resolution is computed.                                                     
    Average is the default.                                                                                                        
  o Input files may be any valid GDAL dataset or a GDAL raster tile index.                                                         
  o For a GDAL raster tile index, all entries will be added to the VRT.                                                            
  o If one GDAL dataset is made of several subdatasets and has 0 raster bands,                                                     
    its datasets will be added to the VRT rather than the dataset itself.                                                          
    Single subdataset could be selected by its number using the -sd option.                                                        
  o By default, only datasets of same projection and band characteristics                                                          
    may be added to the VRT.                                                                                                       
Traceback (most recent call last):                                                                                                 
  File "./pipelines/1st/s2plib/common.py", line 90, in run                                                                         
    stderr=sys.stderr, env=env)                                                                                                    
  File "/opt/intel/intelpython35/lib/python3.5/subprocess.py", line 581, in check_call                                             
    raise CalledProcessError(retcode, cmd)                                                                                         
subprocess.CalledProcessError: Command 'gdalbuildvrt -vrtnodata nan -input_file_list ./data/tmp/s2p_out/gdalbuildvrt_input_file_lis
t.txt ./data/tmp/s2p_out/dsm.vrt' returned non-zero exit status 1                                                                  
                                                                                                                                   
During handling of the above exception, another exception occurred:   

Traceback (most recent call last):                                                                                                 
  File "<stdin>", line 1, in <module>                                                                                              
  File "<string>", line 225, in <module>                                                                                           
  File "<string>", line 194, in call_s2p_main                                                                                      
  File "./pipelines/1st/s2p.py", line 646, in main                                                                                 
    global_dsm(tiles)                                                                                                              
  File "./pipelines/1st/s2p.py", line 515, in global_dsm                                                                           
    out_dsm_vrt))                                                                                                                  
  File "./pipelines/1st/s2plib/common.py", line 97, in run                                                                         
    e.output})                                                                                                                     
s2plib.common.RunFailure: {'environment': environ({'TERM': 'xterm', 'JUPYTER_SERVER_ROOT': '/home/myuser', 'LINES': '62', 'PWD'
: '/home/myuser/projects/test-s2p', 'PATH': '/home/myuser/projects/test-s2p/pipelines/1st/bin:/opt/intel/intelpython35/
bin/:/opt/intel/intelpython35/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'SHLVL': '1', '_': '/opt/intel/in
telpython35/bin/python', 'USER': 'myuser', 'PYXTERM_DIMENSIONS': '80x25', 'OLDPWD': '/home/myuser', 'JUPYTER_SERVER_URL': '
http://127.0.0.1:37281/user/myuser/', 'HOME': '/home/myuser', 'SHELL': '/bin/bash', 'COLUMNS': '131'}), 'output': None, 'co
mmand': 'gdalbuildvrt -vrtnodata nan -input_file_list ./data/tmp/s2p_out/gdalbuildvrt_input_file_list.txt ./data/tmp/s2p_out/dsm.vr
t'}

My JSON config_template looks like this:

{'clean_intermediate': False,                                                                                                      
 'clean_tmp': False,                                                                                                               
 'debug': False,                                                                                                                   
 'disable_srtm': True,                                                                                                             
 'disp_range_extra_margin': 0.2,                                                                                                   
 'disp_range_method': 'sift',                                                                                                      
 'disp_range_srtm_high_margin': 50,                                                                                                
 'disp_range_srtm_low_margin': -20,                                                                                                
 'dsm_resolution': 0.5,                                                                                                            
 'epipolar_thresh': 0.5,                                                                                                           
 'full_img': True,                                                                                                                 
 'fusion_thresh': 3,                                                                                                               
 'horizontal_margin': 20,                                                                                                          
 'images': [{'img': './data/tmp/s2p_in/s2p_INPUT_IM_0.tif',                                                                        
             'rpc': './data/tmp/s2p_in/s2p_INPUT_RPC_0.xml'},                                                                      
            {'img': './data/tmp/s2p_in/s2p_INPUT_IM_1.tif',                                                                        
             'rpc': './data/tmp/s2p_in/s2p_INPUT_RPC_1.xml'},                                                                      
            {'img': './data/tmp/s2p_in/s2p_INPUT_IM_2.tif',                                                                        
             'rpc': './data/tmp/s2p_in/s2p_INPUT_RPC_2.xml'}],                                                                     
 'matching_algorithm': 'mgm',                                                                                                      
 'msk_erosion': 0,                                                                                                                 
 'n_gcp_per_axis': 5,                                                                                                              
 'out_dir': './data/tmp/s2p_out/',                                                                                                 
 'roi': {},                                                                                                                        
 'sift_match_thresh': 0.6,                                                                                                         
 'skip_existing': False,                                                                                                           
 'subsampling_factor': 1,                                                                                                          
 'temporary_dir': './data/tmp/s2p_tmp/',                                                                                           
 'tile_size': 300,                                                                                                                 
 'utm_bbx': [352280.33713790023,                                                                                                   
             352580.33713790023,                                                                                                   
             6184003.9602460349,                                                                                                   
             6184303.9602460349],                                                                                                  
 'vertical_margin': 5} 

Any ideas? I was thinking that maybe the images don't cover the same area... which may cause the algorithm to be missing information for some locations. I'm not sure how to get around this, since it seems the utm_bbx was not even used, and it will be hard to tell before-hand whether or not two images contain information that s2p can exploit. Is my interpretation of the error correct? If yes: should it work if I call it with two "overlapping" images?

Thanks in advance!

Cannot get S2P to work on IARPA challenge data

Hi,

I got the S2P pipeline working out of the box on some Airbus/Pleiades data. However, when trying to experiment with the Multi-View Stereo 3D Mapping Challenge data from IARPA (UCSD/WV03/PAN), I cannot get it to work properly (the program runs but the results do not make sense).

The main issue seems to be that the tiles between image A and B of a pair are not cropped from the same geographical extent (the content of each tile pair do not match):

  • the tile log often ends with: WARNING: sift.matches_on_rpc_roi: found no matches.
  • when matches are found in the pair, the image content do not match:
    image

I've tried the following without success:

  • cropping each image of the pair to the same extent
  • cropping each image and RPC of the pair to the same extent using the crop_rpc utility
  • rescaling image B to the same resolution/GSD as image A using the scale_image_and_rpc utility

Is this something you have encountered? Do you have any recommendation or pre-processing that I might have missed in the documentation (e.g. regarding GSD between the images, extent of the rasters)?

Thanks for your great job!

How to use the value in rpc.XML to reproject raster.tif?

Guys:
Now I have pleiades raster (raster.tif) and a RPC model (rpc.XML). In the rpc.XML, there are the following lines which can be used to reset geo information.

<RFM_Validity>  
  <Direct_Model_Validity_Domain>
    <FIRST_ROW>1</FIRST_ROW>
    <FIRST_COL>1</FIRST_COL>
    <LAST_ROW>19676</LAST_ROW>
    <LAST_COL>18665</LAST_COL>
  </Direct_Model_Validity_Domain>
  <Inverse_Model_Validity_Domain>
    <FIRST_LON>7.393918390116374</FIRST_LON>
    <FIRST_LAT>46.89414037853461</FIRST_LAT>
    <LAST_LON>7.531577540047203</LAST_LON>
    <LAST_LAT>46.98982504658424</LAST_LAT>
  </Inverse_Model_Validity_Domain>
  <LONG_SCALE>0.06584113709872685</LONG_SCALE>
  <LONG_OFF>7.462641690331035</LONG_OFF>
  <LAT_SCALE>0.04690424904394419</LAT_SCALE>
  <LAT_OFF>46.94198271255942</LAT_OFF>
  <HEIGHT_SCALE>245</HEIGHT_SCALE>
  <HEIGHT_OFF>765</HEIGHT_OFF>
  <SAMP_SCALE>9332</SAMP_SCALE>
  <SAMP_OFF>9333</SAMP_OFF>
  <LINE_SCALE>9837.499999999996</LINE_SCALE>
  <LINE_OFF>9838.499999999996</LINE_OFF>
</RFM_Validity>

And I use the following code to reset geo info of raster.tif with the value below.
xmin = 7.393918390116374
ymin = 46.89414037853461
xmax = 7.531577540047203
ymax = 46.98982504658424
first_col = 1
last_col = 18665
first_row = 1
last_row = 19676

def set_geo_info(in_path, out_path, xmin, ymin, xmax, ymax,
                 first_row, first_col, last_row, last_col, *args):
  '''
  xmin, ymin, xmax, ymax are the longitude and latitude.
  '''
  print('Set Geo Information ...')
  xres = (xmax - xmin) / (last_col - first_col + 1)
  yres = (ymax - ymin) / (last_row - first_row + 1)

  geotransform = (xmin, xres, 0, ymax, 0, -yres)

  ds = gdal.Open(in_path)
  band = ds.GetRasterBand(1)
  arr = band.ReadAsArray()
  [y, x] = arr.shape

  driver = gdal.GetDriverByName("GTiff")
  outdata = driver.Create(out_path, x, y, 1, gdal.GDT_UInt16)
  outdata.SetGeoTransform(geotransform)
  outdata.GetRasterBand(1).WriteArray(arr)
  outdata.FlushCache()

  outdata = None
  arr = None
  band = None
  ds = None

  print("Done.")

grafik

As you can see, the red line is a shapefile (EPSG21781), while the railway in the result is not entirely overlap with shapefile. The distance of shifting is not consistent for this whole image. The displacement is larger near the edge of this image.

However, the output DSM of s2p is really consistent with railway's position.
grafik
As you can see, the blue railway is in between the building perfectly.

So, my question is the following.

  1. Am I heading the right direction to reproject raster.tif?
  2. If 1. is correct, I guess the value which I fed into the gdal is wrong. How to find the correct value from RPC model (rpc.XML).
  3. How does s2p use rpc.XML to figure out the coordinate system?

Thank you. Any help will be appreciated.

Dockerfile not comment correctly and should add apt-get install unzip

Hi guys:
I found an incorrect comment in Dockerfile.
The following line
ARG DEBIAN_FRONTEND=noninteractive # https://goo.gl/aypXVx
The comment about will make my following command fails.
sudo docker build -t s2p/gdal:2.1 .
with the error.
Error response from daemon: Dockerfile parse error line 6: ARG requires exactly one argument

Another issue is that it would be better if Dockerfile has an additional line.
RUN apt-get install unzip
If not, there will be the following error.
mv lsd_1.6.zip 3rdparty unzip -o 3rdparty/lsd_1.6.zip -d 3rdparty make: unzip: Command not found make: *** [lsd] Error 127 makefile:64: recipe for target 'lsd' failed The command '/bin/sh -c cd s2p && make all' returned a non-zero code: 2

msmw/sgbm error and Config.json settings question

I am not sure I set up my Config.json settings optimally using WV-2 in-orbit stereo imagery covering an urban area. Config.json appended.

I get output using stereo matching algorithm "mgm" and "tvl1". But with mixed results when compared with a master LiDAR DSM.
Stereo matching algorithm "sgbm" and "msmw" return error. Terminal error log included in link.

Any guidance to improve settings is very welcome.

How to fill the holes in DSM.tif?

I am running the pleiades images, and the process can run successfully. But the output DSM has too many holes in it. Below it the result. (White points means no data)
screen shot 2018-11-26 at 5 49 17 pm
How to fill the holes in DSM or it's abnormal result which means I did something wrong?

Any help would be appreciated.
Thank you.

No DSM with Spot7 data

Hi,
I am working with Spot 7 data. Unlike the processing with the Pléiade data, none of dsm.tif (in tiles folders) or dsm.vrt are calculated. Moreover some cloud.ply files are generated but I cannot open them and I have the following error message : « reading error (no access right ?) » when I try to open them with CloudCompare for example.

I think the problem comes from the line « Timeout while running <multiprocessing.pool.ApplyResult object at 0x7fcffa9a7810> » but I don’t know if this is a problem with the parameters of the configuration file, with the data I use or an out of memory... I tried to launch s2p on the entire image but also on a smaller area.

You can find the initial configuration file (config_s2p.json) and the result here :
https://drive.google.com/open?id=1ZZGEfZRIIvFQiHitKdLK8Ga_rBHcKqBK

Thanks for your help,
Anne-Sophie

The s2p licence

I see that s2p is licenced under AGPL 3.0.

I am sure that you folks thought very hard about it, and there are many good things to be said about it. I, like you, believe that software should reach the largest amount of people, and have the hugest impact, changing the world with high quality tool.

Yet, if that is the goal, I will argue that AGPL is in fact not the right license. I know the worries, that somebody will steal the code and incorporate it into their proprietary solution, etc, etc.

Yet, in fact, counter-intuitively, GPL-related licences, of which I used to be a big fan, are actually quite bad at festering innovation and achieving their goals. GPL is considered poison. It messes up everything it touches. Companies, and even government agencies, like NASA Ames where I work, don't want to have anything to do with GPL.

The trend these days are towards more permissive licences, like Apache, BSD, and MIT. Look for example at OpenCV, ROS, Python source code, Android, etc.

I am sure you know all these things. And really, since S2P is a collection of standalone tools, one can still easily use them from a new glue Python software while bypassing the GPL constraint. Yet, I would still like to ask the question, why AGPL and not something more liberal which may foster more cooperation?

regression

If I clone the repository afresh and run the test suite, I obtain the following error and no DSM is produced:

Traceback (most recent call last):
File "./s2p.py", line 365, in launch_parallel_calls
r.get(3600) # wait at most one hour per call
File "/usr/lib/python2.7/multiprocessing/pool.py", line 554, in get
raise self._value
ValueError: need more than 2 values to unpack

In fact the tiles are correctly computed, but it fails when trying to join them. I do not understand the error message, I do not see anything being unpacked here...

Guys, excellent job, but how to run the program?

Guys, I am able to compile the program, but I am stuck with how to make the first test run. Can anyone update the readme a bit of more to show how to make the first test run in order to see a workable demo? Thanks!!

Hello, thank you for your code. I have some doubts. Hope to get your help.

Hello, thank you very much for your code. In the code you provided, I found that files like rpc_01.xml were used. Is this document the data provided by the competition? Or is it extracted from other data? And what data are your satellite sensors using? Do you have a download address? Hope to get your help.

Handling of missing pixels in s2p

It looks to me that when S2P aligns images it does not have the concept that sometimes in the left image there is valid intensity data, but the right image lacks data at that location, which happens because, obviously, the left and the right image do not overlap everywhere.

As I see it, at the alignment stage S2P is happy enough to write 0 or some value where there is no data. Then during the stereo correlation stage, those unreal pixels are used as if they are valid. Sometimes there is a bluring or some other operation as well before correlation, such as in the TV-L1 algorithm, when valid and invalid pixel values are further blended together.

This results in noise and inaccurate heights in the output DEM in my experiments. I saw this for both the TV-L1 and MGM algorithms. Am I missing something, or is this a valid issue with the current processing? If it is valid, the solution won't be simple, as there lots of steps in both pre-processing and correlation where pixels should be handled more carefully.

ERROR 5: Invalid -vrtnodata value

Hi,

Could you help me with this error

xoff: 287834.062000, yoff: 2075779.000000, xsize: 1642, ysize: 1751
xmin: 287834.488193, xmax: 289476.454251, ymin: 2074760.974993, ymax: 2076512.562794
xoff: 288487.562000, yoff: 2075637.500000, xsize: 1643, ysize: 1755
Elapsed time: 0:05:42.334347

computing global DSM...

RUN: gdalbuildvrt -vrtnodata nan -input_file_list /home/mayank/static-site/s2p/testdata/input_pair/../../testoutput/output_pair/gdalbuildvrt_input_file_list.txt /home/mayank/static-site/s2p/testdata/input_pair/../../testoutput/output_pair/dsm.vrt
ERROR 5: Invalid -vrtnodata value
Traceback (most recent call last):
File "s2p.py", line 831, in
main(user_cfg, args.step)
File "s2p.py", line 756, in main
global_dsm(tiles)
File "s2p.py", line 619, in global_dsm
out_dsm_vrt))
File "/home/mayank/static-site/s2p/s2plib/common.py", line 97, in run
e.output})
s2plib.common.RunFailure: {'environment': {'WINDOWID': '62914570', 'MANDATORY_PATH': '/usr/share/gconf/ubuntu.mandatory.path', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/mayank', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'UPSTART_EVENTS': 'xsession started', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'XDG_SESSION_TYPE': 'x11', 'QT_IM_MODULE': 'ibus', 'LOGNAME': 'mayank', 'USER': 'mayank', 'PATH': '/home/mayank/static-site/s2p/bin:/home/mayank/bin:/home/mayank/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'XDG_VTNR': '7', 'GNOME_KEYRING_CONTROL': '', 'DISPLAY': ':0', 'LANG': 'en_IN', 'TERM': 'xterm-256color', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'XAUTHORITY': '/home/mayank/.Xauthority', 'LANGUAGE': 'en_IN:en', 'SESSION_MANAGER': 'local/mayank-VirtualBox:@/tmp/.ICE-unix/2820,unix/mayank-VirtualBox:/tmp/.ICE-unix/2820', 'SHLVL': '1', 'QT_LINUX_ACCESSIBILITY_ALWAYS_ON': '1', 'QT_QPA_PLATFORMTHEME': 'appmenu-qt5', 'CLUTTER_IM_MODULE': 'xim', 'UPSTART_INSTANCE': '', 'QT_ACCESSIBILITY': '1', 'SESSION': 'ubuntu', 'LIBGL_ALWAYS_SOFTWARE': '1', 'SESSIONTYPE': 'gnome-session', 'XMODIFIERS': '@im=ibus', 'GPG_AGENT_INFO': '/home/mayank/.gnupg/S.gpg-agent:0:1', 'HOME': '/home/mayank', 'QT4_IM_MODULE': 'xim', 'GTK2_MODULES': 'overlay-scrollbar', 'XDG_SESSION_DESKTOP': 'ubuntu', 'COMPIZ_BIN_PATH': '/usr/bin/', 'XDG_RUNTIME_DIR': '/run/user/1000', 'INSTANCE': '', 'COMPIZ_CONFIG_PROFILE': 'ubuntu-lowgfx', 'SSH_AUTH_SOCK': '/run/user/1000/keyring/ssh', 'VTE_VERSION': '4205', 'GDMSESSION': 'ubuntu', 'IM_CONFIG_PHASE': '1', 'UPSTART_JOB': 'unity7', 'GNOME_KEYRING_PID': '', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'XDG_CURRENT_DESKTOP': 'Unity', 'XDG_SESSION_ID': 'c2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-gbLAweO7AT', '_': '/usr/bin/python', 'DEFAULTS_PATH': '/usr/share/gconf/ubuntu.default.path', 'GTK_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'ubuntu', 'UPSTART_SESSION': 'unix:abstract=/com/ubuntu/upstart-session/1000/2139', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'GTK_MODULES': 'gail:atk-bridge:unity-gtk-module', 'OLDPWD': '/home/mayank/static-site', 'GDM_LANG': 'en_US', 'XDG_DATA_DIRS': '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'PWD': '/home/mayank/static-site/s2p', 'JOB': 'unity-settings-daemon', 'XDG_MENU_PREFIX': 'gnome-', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:', 'XDG_SEAT': 'seat0'}, 'output': None, 'command': u'gdalbuildvrt -vrtnodata nan -input_file_list /home/mayank/static-site/s2p/testdata/input_pair/../../testoutput/output_pair/gdalbuildvrt_input_file_list.txt /home/mayank/static-site/s2p/testdata/input_pair/../../testoutput/output_pair/dsm.vrt'}

How to interpret the height of output DSM.tif?

Hi guys:
I am a newbie in GIS, so please bear with my newbie question. I've read this issue about the height reference, but not completely understand it.
Let's say now I have a DSM.tif from s2p pipeline. As you can see in the DSM.tif below, the height of certain point in this DSM is 84 meters, and you can see from the color bar on bottom left, the average height of this area is about 84 to 130 meters (Because it's mostly green and yellow).
screen shot 2018-11-28 at 5 38 58 pm

However, I use QGIS3 plugin SRTM downloader to download a map within this area. As you can see below, the average height of this area is only 45 meters.
screen shot 2018-11-28 at 5 42 53 pm

My question is that why is this happening? Is there a height translation between this two model? This issue says that the s2p use height reference in RPC.XML to determine the height of DSM.tif, but I am not fully understanding it.

I dive into my input RPC.XML file below. According to the explanation in the reference issue, I found <HEIGHT_SCALE>75</HEIGHT_SCALE> <HEIGHT_OFF>125</HEIGHT_OFF> in my RPC.XML. What does it mean? Does it mean that the height difference of the lowest point and the highest point is 75 meters in this image. And the lowest point in this image is 125 meters of Ellipsoidal height. If this is true, then how do I combine the height values of these two model to get a more accountable result?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Dimap_Document> <Metadata_Identification> <METADATA_FORMAT version="2.15">DIMAP</METADATA_FORMAT> <METADATA_PROFILE>PHR_SENSOR</METADATA_PROFILE> <METADATA_SUBPROFILE>RPC</METADATA_SUBPROFILE> <METADATA_LANGUAGE>en</METADATA_LANGUAGE> </Metadata_Identification> <Rational_Function_Model> <Resource_Reference> <RESOURCE_TITLE version="2.1">NITF</RESOURCE_TITLE> <RESOURCE_ID>RPC00B</RESOURCE_ID> </Resource_Reference> <Global_RFM> <Direct_Model> <SAMP_NUM_COEFF_1>-0.000746138303839824</SAMP_NUM_COEFF_1> <SAMP_NUM_COEFF_2>0.992974383138236</SAMP_NUM_COEFF_2> <SAMP_NUM_COEFF_3>-0.00136806191864779</SAMP_NUM_COEFF_3> <SAMP_NUM_COEFF_4>-0.00542589306701223</SAMP_NUM_COEFF_4> <SAMP_NUM_COEFF_5>0.000380892259008059</SAMP_NUM_COEFF_5> <SAMP_NUM_COEFF_6>-5.74617679275689e-05</SAMP_NUM_COEFF_6> <SAMP_NUM_COEFF_7>-3.08031723565177e-05</SAMP_NUM_COEFF_7> <SAMP_NUM_COEFF_8>0.00144787088325648</SAMP_NUM_COEFF_8> <SAMP_NUM_COEFF_9>-0.000917301854509243</SAMP_NUM_COEFF_9> <SAMP_NUM_COEFF_10>-2.47260537856052e-07</SAMP_NUM_COEFF_10> <SAMP_NUM_COEFF_11>3.00785886729071e-08</SAMP_NUM_COEFF_11> <SAMP_NUM_COEFF_12>4.26418350526853e-06</SAMP_NUM_COEFF_12> <SAMP_NUM_COEFF_13>1.0213526565629e-06</SAMP_NUM_COEFF_13> <SAMP_NUM_COEFF_14>6.71319472379755e-07</SAMP_NUM_COEFF_14> <SAMP_NUM_COEFF_15>9.25019008588922e-06</SAMP_NUM_COEFF_15> <SAMP_NUM_COEFF_16>-4.06204414696598e-05</SAMP_NUM_COEFF_16> <SAMP_NUM_COEFF_17>-2.29503833731854e-09</SAMP_NUM_COEFF_17> <SAMP_NUM_COEFF_18>-2.86151604858025e-08</SAMP_NUM_COEFF_18> <SAMP_NUM_COEFF_19>1.03644166473121e-07</SAMP_NUM_COEFF_19> <SAMP_NUM_COEFF_20>-3.84559434550503e-09</SAMP_NUM_COEFF_20> <SAMP_DEN_COEFF_1>1</SAMP_DEN_COEFF_1> <SAMP_DEN_COEFF_2>-0.000696601983816332</SAMP_DEN_COEFF_2> <SAMP_DEN_COEFF_3>-0.000380754439664754</SAMP_DEN_COEFF_3> <SAMP_DEN_COEFF_4>5.29662944529877e-05</SAMP_DEN_COEFF_4> <SAMP_DEN_COEFF_5>-8.99915989770518e-06</SAMP_DEN_COEFF_5> <SAMP_DEN_COEFF_6>4.79895154014135e-08</SAMP_DEN_COEFF_6> <SAMP_DEN_COEFF_7>-2.61985672394448e-08</SAMP_DEN_COEFF_7> <SAMP_DEN_COEFF_8>-1.19981423050896e-06</SAMP_DEN_COEFF_8> <SAMP_DEN_COEFF_9>-1.61566090602473e-06</SAMP_DEN_COEFF_9> <SAMP_DEN_COEFF_10>6.73896884452982e-07</SAMP_DEN_COEFF_10> <SAMP_DEN_COEFF_11>-4.62885660231331e-11</SAMP_DEN_COEFF_11> <SAMP_DEN_COEFF_12>-1.89932376294534e-08</SAMP_DEN_COEFF_12> <SAMP_DEN_COEFF_13>1.69367487391709e-09</SAMP_DEN_COEFF_13> <SAMP_DEN_COEFF_14>-1.47697514214026e-09</SAMP_DEN_COEFF_14> <SAMP_DEN_COEFF_15>-5.8667991292401e-08</SAMP_DEN_COEFF_15> <SAMP_DEN_COEFF_16>1.08547992213467e-07</SAMP_DEN_COEFF_16> <SAMP_DEN_COEFF_17>-5.07494615699108e-10</SAMP_DEN_COEFF_17> <SAMP_DEN_COEFF_18>2.80093273936124e-10</SAMP_DEN_COEFF_18> <SAMP_DEN_COEFF_19>-2.25911343768134e-10</SAMP_DEN_COEFF_19> <SAMP_DEN_COEFF_20>7.3824894362597e-11</SAMP_DEN_COEFF_20> <LINE_NUM_COEFF_1>0.00360103691895295</LINE_NUM_COEFF_1> <LINE_NUM_COEFF_2>-0.0961658386279468</LINE_NUM_COEFF_2> <LINE_NUM_COEFF_3>-0.898976212270681</LINE_NUM_COEFF_3> <LINE_NUM_COEFF_4>0.00479249483595636</LINE_NUM_COEFF_4> <LINE_NUM_COEFF_5>-0.00140329539200166</LINE_NUM_COEFF_5> <LINE_NUM_COEFF_6>1.16588473850804e-05</LINE_NUM_COEFF_6> <LINE_NUM_COEFF_7>2.38050138265085e-05</LINE_NUM_COEFF_7> <LINE_NUM_COEFF_8>-0.000584324160588339</LINE_NUM_COEFF_8> <LINE_NUM_COEFF_9>-0.00194987294808321</LINE_NUM_COEFF_9> <LINE_NUM_COEFF_10>-2.47789243082852e-08</LINE_NUM_COEFF_10> <LINE_NUM_COEFF_11>1.92459233140694e-07</LINE_NUM_COEFF_11> <LINE_NUM_COEFF_12>-2.39031311201064e-06</LINE_NUM_COEFF_12> <LINE_NUM_COEFF_13>-1.10728594750913e-05</LINE_NUM_COEFF_13> <LINE_NUM_COEFF_14>-7.00406338414866e-07</LINE_NUM_COEFF_14> <LINE_NUM_COEFF_15>-8.98842890708345e-06</LINE_NUM_COEFF_15> <LINE_NUM_COEFF_16>-3.0731198083626e-05</LINE_NUM_COEFF_16> <LINE_NUM_COEFF_17>-6.54599231060754e-06</LINE_NUM_COEFF_17> <LINE_NUM_COEFF_18>1.34260407079084e-07</LINE_NUM_COEFF_18> <LINE_NUM_COEFF_19>8.29342598728098e-08</LINE_NUM_COEFF_19> <LINE_NUM_COEFF_20>3.50270096273584e-08</LINE_NUM_COEFF_20> <LINE_DEN_COEFF_1>1</LINE_DEN_COEFF_1> <LINE_DEN_COEFF_2>-0.000971451439197196</LINE_DEN_COEFF_2> <LINE_DEN_COEFF_3>0.00134925212856526</LINE_DEN_COEFF_3> <LINE_DEN_COEFF_4>5.26296857183859e-06</LINE_DEN_COEFF_4> <LINE_DEN_COEFF_5>-3.20077365776687e-06</LINE_DEN_COEFF_5> <LINE_DEN_COEFF_6>1.04134879112501e-07</LINE_DEN_COEFF_6> <LINE_DEN_COEFF_7>-2.23177317219708e-08</LINE_DEN_COEFF_7> <LINE_DEN_COEFF_8>2.54808063989682e-06</LINE_DEN_COEFF_8> <LINE_DEN_COEFF_9>-1.11366452756127e-05</LINE_DEN_COEFF_9> <LINE_DEN_COEFF_10>7.27291705678484e-06</LINE_DEN_COEFF_10> <LINE_DEN_COEFF_11>-5.11702238239715e-10</LINE_DEN_COEFF_11> <LINE_DEN_COEFF_12>-5.2784131503655e-08</LINE_DEN_COEFF_12> <LINE_DEN_COEFF_13>-3.54928436885734e-07</LINE_DEN_COEFF_13> <LINE_DEN_COEFF_14>-1.70274177947048e-08</LINE_DEN_COEFF_14> <LINE_DEN_COEFF_15>-3.38525662104838e-08</LINE_DEN_COEFF_15> <LINE_DEN_COEFF_16>-1.22581541433828e-07</LINE_DEN_COEFF_16> <LINE_DEN_COEFF_17>-6.25857967993536e-09</LINE_DEN_COEFF_17> <LINE_DEN_COEFF_18>1.24585036941696e-09</LINE_DEN_COEFF_18> <LINE_DEN_COEFF_19>4.12074023863858e-09</LINE_DEN_COEFF_19> <LINE_DEN_COEFF_20>1.54222469626184e-10</LINE_DEN_COEFF_20> <ERR_BIAS_X>8.509809638808654e-05</ERR_BIAS_X> <ERR_BIAS_Y>9.335568356701685e-05</ERR_BIAS_Y> </Direct_Model> <Inverse_Model> <SAMP_NUM_COEFF_1>0.000756856857605915</SAMP_NUM_COEFF_1> <SAMP_NUM_COEFF_2>1.00692083658256</SAMP_NUM_COEFF_2> <SAMP_NUM_COEFF_3>-0.00154047880467261</SAMP_NUM_COEFF_3> <SAMP_NUM_COEFF_4>0.00547096458171742</SAMP_NUM_COEFF_4> <SAMP_NUM_COEFF_5>0.000540526353842057</SAMP_NUM_COEFF_5> <SAMP_NUM_COEFF_6>4.1405909715653e-05</SAMP_NUM_COEFF_6> <SAMP_NUM_COEFF_7>-4.48728846573732e-05</SAMP_NUM_COEFF_7> <SAMP_NUM_COEFF_8>-0.00141930984291985</SAMP_NUM_COEFF_8> <SAMP_NUM_COEFF_9>0.00114168199450594</SAMP_NUM_COEFF_9> <SAMP_NUM_COEFF_10>4.264958737993e-07</SAMP_NUM_COEFF_10> <SAMP_NUM_COEFF_11>2.91790228524865e-07</SAMP_NUM_COEFF_11> <SAMP_NUM_COEFF_12>4.60398789970182e-07</SAMP_NUM_COEFF_12> <SAMP_NUM_COEFF_13>-1.44186819961223e-05</SAMP_NUM_COEFF_13> <SAMP_NUM_COEFF_14>-1.50394314195192e-06</SAMP_NUM_COEFF_14> <SAMP_NUM_COEFF_15>6.72803521920308e-06</SAMP_NUM_COEFF_15> <SAMP_NUM_COEFF_16>-5.39635897796296e-05</SAMP_NUM_COEFF_16> <SAMP_NUM_COEFF_17>5.15710361782022e-10</SAMP_NUM_COEFF_17> <SAMP_NUM_COEFF_18>-1.78955172196273e-07</SAMP_NUM_COEFF_18> <SAMP_NUM_COEFF_19>6.0490939093379e-07</SAMP_NUM_COEFF_19> <SAMP_NUM_COEFF_20>-7.85211806486908e-09</SAMP_NUM_COEFF_20> <SAMP_DEN_COEFF_1>1</SAMP_DEN_COEFF_1> <SAMP_DEN_COEFF_2>0.000667664728960558</SAMP_DEN_COEFF_2> <SAMP_DEN_COEFF_3>-0.000541018796097441</SAMP_DEN_COEFF_3> <SAMP_DEN_COEFF_4>-4.59072926461328e-05</SAMP_DEN_COEFF_4> <SAMP_DEN_COEFF_5>-7.03677854987924e-06</SAMP_DEN_COEFF_5> <SAMP_DEN_COEFF_6>1.30776276037896e-07</SAMP_DEN_COEFF_6> <SAMP_DEN_COEFF_7>-2.58708477024965e-07</SAMP_DEN_COEFF_7> <SAMP_DEN_COEFF_8>-2.30202392964842e-06</SAMP_DEN_COEFF_8> <SAMP_DEN_COEFF_9>1.23406878914671e-05</SAMP_DEN_COEFF_9> <SAMP_DEN_COEFF_10>-1.50382571042063e-06</SAMP_DEN_COEFF_10> <SAMP_DEN_COEFF_11>-3.80618499014433e-10</SAMP_DEN_COEFF_11> <SAMP_DEN_COEFF_12>-1.89418545228374e-09</SAMP_DEN_COEFF_12> <SAMP_DEN_COEFF_13>-1.03762627797018e-07</SAMP_DEN_COEFF_13> <SAMP_DEN_COEFF_14>-2.87520228902415e-09</SAMP_DEN_COEFF_14> <SAMP_DEN_COEFF_15>7.57304211680357e-08</SAMP_DEN_COEFF_15> <SAMP_DEN_COEFF_16>-3.77636404129356e-07</SAMP_DEN_COEFF_16> <SAMP_DEN_COEFF_17>1.52464132095325e-09</SAMP_DEN_COEFF_17> <SAMP_DEN_COEFF_18>-6.90238524001426e-10</SAMP_DEN_COEFF_18> <SAMP_DEN_COEFF_19>3.85230372863794e-09</SAMP_DEN_COEFF_19> <SAMP_DEN_COEFF_20>1.32462143998201e-10</SAMP_DEN_COEFF_20> <LINE_NUM_COEFF_1>0.00392470722200652</LINE_NUM_COEFF_1> <LINE_NUM_COEFF_2>-0.107713117271978</LINE_NUM_COEFF_2> <LINE_NUM_COEFF_3>-1.11219087598856</LINE_NUM_COEFF_3> <LINE_NUM_COEFF_4>0.00474577982559303</LINE_NUM_COEFF_4> <LINE_NUM_COEFF_5>0.000800891483848716</LINE_NUM_COEFF_5> <LINE_NUM_COEFF_6>-3.71094084150149e-06</LINE_NUM_COEFF_6> <LINE_NUM_COEFF_7>1.26448106825261e-05</LINE_NUM_COEFF_7> <LINE_NUM_COEFF_8>-0.000427686677057257</LINE_NUM_COEFF_8> <LINE_NUM_COEFF_9>-0.00272299111915185</LINE_NUM_COEFF_9> <LINE_NUM_COEFF_10>-1.03301587229142e-07</LINE_NUM_COEFF_10> <LINE_NUM_COEFF_11>-8.0927193556137e-08</LINE_NUM_COEFF_11> <LINE_NUM_COEFF_12>1.01201629776652e-06</LINE_NUM_COEFF_12> <LINE_NUM_COEFF_13>3.51586494271183e-06</LINE_NUM_COEFF_13> <LINE_NUM_COEFF_14>1.13001042822277e-06</LINE_NUM_COEFF_14> <LINE_NUM_COEFF_15>5.2259569351849e-06</LINE_NUM_COEFF_15> <LINE_NUM_COEFF_16>3.14124650425575e-05</LINE_NUM_COEFF_16> <LINE_NUM_COEFF_17>1.16851585563268e-05</LINE_NUM_COEFF_17> <LINE_NUM_COEFF_18>-3.1173938027102e-08</LINE_NUM_COEFF_18> <LINE_NUM_COEFF_19>-2.35553382355978e-07</LINE_NUM_COEFF_19> <LINE_NUM_COEFF_20>-4.9580187664102e-08</LINE_NUM_COEFF_20> <LINE_DEN_COEFF_1>1</LINE_DEN_COEFF_1> <LINE_DEN_COEFF_2>0.00126740335618694</LINE_DEN_COEFF_2> <LINE_DEN_COEFF_3>0.00142273722715955</LINE_DEN_COEFF_3> <LINE_DEN_COEFF_4>-4.96037608396756e-06</LINE_DEN_COEFF_4> <LINE_DEN_COEFF_5>5.48028723644555e-06</LINE_DEN_COEFF_5> <LINE_DEN_COEFF_6>4.80429387478925e-08</LINE_DEN_COEFF_6> <LINE_DEN_COEFF_7>-4.83332569967243e-07</LINE_DEN_COEFF_7> <LINE_DEN_COEFF_8>-7.86209950109183e-06</LINE_DEN_COEFF_8> <LINE_DEN_COEFF_9>3.08893591052912e-05</LINE_DEN_COEFF_9> <LINE_DEN_COEFF_10>-1.05166695122597e-05</LINE_DEN_COEFF_10> <LINE_DEN_COEFF_11>-2.15970912037853e-09</LINE_DEN_COEFF_11> <LINE_DEN_COEFF_12>-7.29523014468501e-09</LINE_DEN_COEFF_12> <LINE_DEN_COEFF_13>1.32348702827656e-07</LINE_DEN_COEFF_13> <LINE_DEN_COEFF_14>-2.32089816628957e-08</LINE_DEN_COEFF_14> <LINE_DEN_COEFF_15>1.49863686043936e-07</LINE_DEN_COEFF_15> <LINE_DEN_COEFF_16>1.2694837691175e-07</LINE_DEN_COEFF_16> <LINE_DEN_COEFF_17>1.14381789621783e-08</LINE_DEN_COEFF_17> <LINE_DEN_COEFF_18>-4.07547273311536e-10</LINE_DEN_COEFF_18> <LINE_DEN_COEFF_19>-3.87187056707755e-09</LINE_DEN_COEFF_19> <LINE_DEN_COEFF_20>3.42740071591094e-11</LINE_DEN_COEFF_20> <ERR_BIAS_ROW>0.0002748236021640053</ERR_BIAS_ROW> <ERR_BIAS_COL>0.0002898099283047482</ERR_BIAS_COL> </Inverse_Model> <RFM_Validity> <Direct_Model_Validity_Domain> <FIRST_ROW>1</FIRST_ROW> <FIRST_COL>1</FIRST_COL> <LAST_ROW>19041</LAST_ROW> <LAST_COL>16133</LAST_COL> </Direct_Model_Validity_Domain> <Inverse_Model_Validity_Domain> <FIRST_LON>6.721400750431096</FIRST_LON> <FIRST_LAT>51.15814961002613</FIRST_LAT> <LAST_LON>6.883648372530217</LAST_LON> <LAST_LAT>51.27337653171568</LAST_LAT> </Inverse_Model_Validity_Domain> <LONG_SCALE>0.06903594852626016</LONG_SCALE> <LONG_OFF>6.802429273130057</LONG_OFF> <LAT_SCALE>0.05648378514193553</LAT_SCALE> <LAT_OFF>51.2157630708709</LAT_OFF> <HEIGHT_SCALE>75</HEIGHT_SCALE> <HEIGHT_OFF>125</HEIGHT_OFF> <SAMP_SCALE>8066</SAMP_SCALE> <SAMP_OFF>8067</SAMP_OFF> <LINE_SCALE>9519.999999999998</LINE_SCALE> <LINE_OFF>9520.999999999998</LINE_OFF> </RFM_Validity> </Global_RFM> </Rational_Function_Model> </Dimap_Document>

Any help would be appreciated.
Best Regards,

Steps to produce height_map in tiles that produce a dsm

I run the pipeline for an experiment using two NTF files. It produces a total of 1720 tiles.

It creates the dsm model for about 1127 tiles.
It returns an output in stderr.log of "ERROR during pointing correction with cmd: sift_roi" for the remaining tiles. I get "done 1 / 1720 tiles^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^HERROR: empty roi" in the log for those tiles

The pipeline does not produce the tile-wise height_map.tif or ref.png for any of the tiles.
How can I get it to produce the height map for at least the tiles that have the dsm.tif files?

Thanks

runtime error in gdalbuildvrt

This is apparently a non-deterministic error that happens from time to time. When running "make test" on a debian 7.7:

$ uname -a
Linux avocat 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3~bpo70+1 (2016-07-07) x86_64 GNU/Linux
$ gdalbuildvrt --version
GDAL 2.1.1, released 2016/07/07
$ make
(... everything OK)
$ make test
(... several tests pass, until this one fails)
RUN: gdalbuildvrt -vrtnodata nan testoutput/output_pair/dsm.vrt testoutput/outp
ut_pair/tiles_row_150_height_350/col_150_width_350/dsm.tif testoutput/output_pai
r/tiles_row_150_height_350/col_500_width_350/dsm.tif testoutput/output_pair/tile
s_row_500_height_350/col_150_width_350/dsm.tif testoutput/output_pair/tiles_row_
500_height_350/col_500_width_350/dsm.tif
0...10...20..*** glibc detected *** gdalbuildvrt: free(): invalid next size (nor
mal): 0x0000000001858ad0 ***

Compiling binaries is unsuccessful

Compiling binaries using ‘make’ results in “Could not find GDAL” (error code below)?
Please note that compiling binaries is new to me.

Dependencies applied:

  • cmake, libtiff, libpng, libjpeg, libfftw3, libgeotiff, gdal, and the Python module utm.
  • gdal version is 1.10.1, released 2013/08/26

I also tried to manually download gdal-1.10.1.tar.gz to 3rdparty and install following the description under “GDAL >= 1.10”.
Dose this method require gdal to be copied to the bin folder manually?

I have root access and using LMDE2 and Debian 8.6 systems.

Error code resulting from the command 'make'
mkdir -p bin/build_homography
cd bin/build_homography; cmake ../../c/homography; make
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find GDAL (missing: GDAL_LIBRARY GDAL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.0/Modules/FindGDAL.cmake:116 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:34 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/dem/local/bin/build_homography/CMakeFiles/CMakeOutput.log".
make[1]: Entering directory '/home/dem/local/bin/build_homography'
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory '/home/dem/local/bin/build_homography'
makefile:53: recipe for target 'homography' failed
make: *** [homography] Error 2

[Info] Height reference

What is the height reference in the output DSM.tif and *.ply files?

I presume it’s the Ellipsoidal height in meters, but a EPSG reference would be very helpful.

Kind regards
Thomas

homography discards color channels

The homography binary processes only the first channel. If the input image has several channel, for instance RGB, only the first is processed and saved to the output file. The resulting output image is grayscale.

Bad version of GDAL in Dockerfile

It seems the default version of GDAL (1.11.3) in ubuntu 16.04 is incompatible with s2p, at least because the "-vrtnodata nan" parameter of gdalbuildvrt is unknown before GDAL 1.11.5.
This parameter is used in "global_dsm" method of s2p.py:
common.run("gdalbuildvrt -vrtnodata nan -input_file_list %s %s" [...]

If confirmed, it may be best to recompile a newer version of GDAL in Dockerfile (the README file recommandes GDAL 2.1.0).

Related issue in GDAL bucktracker: https://trac.osgeo.org/gdal/ticket/6495

Unable to run docker image

Steps to reproduce on current master (7b12beb):

  • docker build --no-cache . -t s2p
  • docker run --rm -it s2p python s2p.py --help
  • Witness:
    Traceback (most recent call last):
    File "s2p.py", line 33, in <module>
      import rasterio
    ImportError: No module named rasterio
    

Possibly from d81966d

cartosat data produces incorrect output

I have used S2P previously from the older repository (installed in January 2016), and it worked fine with Cartosat data. Carlo had very kindly added support for Cartosat in that version. But yesterday I reinstalled S2P from this new github repository and the output is not quite right.

Attaching two dsm files (in zipped folder named dsm_error.zip).

  1. The file named dsm_original.tif is the output I got with the old installation
  2. The file named 5m_carto_dsm22feb.tif is what I get with the new installation
    Also attaching the .json file (stereo.json) so you can see the settings used to run S2P (also in zipped folder).
    dsm_error.zip

The cartosat image pair is available here: https://www.dropbox.com/s/4sj8akfoui2les0/152904411.zip?dl=0

Thank you

No DSM/point cloud tiles results with Pleiades data

Hi,

I am working on DSM generation from Pléiades data with s2p but I have some bad results that I do not understand.. Indeed, all the points clouds (and DSM) of each tile are not calculated. The following files are missing in the output files for "empty" tiles:

  • Height_map.tif
  • rectified_disp.tif
  • rectified_mask.png
  • rpc_err.tif

These files are missing in the "pair_2" folder of the affected tiles.

Is this problem related to the configuration of the starting parameters?

I have provided you as an attachment the initial configuration file (config.json) I used, the output configuration file (config_out.json) and the resulting DSM.

Thank you.

config_and-results.zip

Thomas.

"make all" error when compiling (osx)

Hi:
I've downloaded the code as tutorials told me. But I run into the following error when running make all.

/Library/Developer/CommandLineTools/usr/bin/make -j -C c/homography
make[1]: `homography' is up to date.
cp c/homography/homography bin
/Library/Developer/CommandLineTools/usr/bin/make -j -C c/sift
make[1]: Nothing to be done for `all'.
cp c/sift/sift_roi bin
cp c/sift/matching bin
/Library/Developer/CommandLineTools/usr/bin/make -C 3rdparty/mgm
make[1]: Nothing to be done for `all'.
cp 3rdparty/mgm/mgm bin
mkdir -p bin/build_mgm_multi
cd bin/build_mgm_multi; cmake ../../3rdparty/mgm_multi; /Library/Developer/CommandLineTools/usr/bin/make
-- No build type selected, default to Release
FLAGS:  -O3 -std=c99 -funroll-loops -Wno-unused -DNDEBUG
/Users/lai/s2p/bin/build_mgm_multi/iio
/Users/lai/s2p/3rdparty/mgm_multi/iio
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/lai/s2p/bin/build_mgm_multi
[  9%] Built target IIOLIB
[ 54%] Built target mgm
[100%] Built target mgm_multi
cp bin/build_mgm_multi/mgm_multi bin
/Library/Developer/CommandLineTools/usr/bin/make -C 3rdparty/tvl1flow
make[1]: Nothing to be done for `default'.
cp 3rdparty/tvl1flow/tvl1flow bin
cp 3rdparty/tvl1flow/callTVL1.sh bin
mkdir -p bin/build_msmw3
cd bin/build_msmw3; cmake -D CMAKE_BUILD_TYPE=Release ../../c/msmw; /Library/Developer/CommandLineTools/usr/bin/make
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/lai/s2p/bin/build_msmw3
[ 10%] Building CXX object CMakeFiles/msmw.dir/LibMSMW/ConnectedComponents.cpp.o
clang: error: no such file or directory: 'NOTFOUND'
make[3]: *** [CMakeFiles/msmw.dir/LibMSMW/ConnectedComponents.cpp.o] Error 1
make[2]: *** [CMakeFiles/msmw.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [msmw3] Error 2
lais-mbp:~/s2p lai$ (master)git submodule update --init
lais-mbp:~/s2p lai$ (master)make all
/Library/Developer/CommandLineTools/usr/bin/make -j -C c/homography
make[1]: `homography' is up to date.
cp c/homography/homography bin
/Library/Developer/CommandLineTools/usr/bin/make -j -C c/sift
make[1]: Nothing to be done for `all'.
cp c/sift/sift_roi bin
cp c/sift/matching bin
/Library/Developer/CommandLineTools/usr/bin/make -C 3rdparty/mgm
make[1]: Nothing to be done for `all'.
cp 3rdparty/mgm/mgm bin
mkdir -p bin/build_mgm_multi
cd bin/build_mgm_multi; cmake ../../3rdparty/mgm_multi; /Library/Developer/CommandLineTools/usr/bin/make
-- No build type selected, default to Release
FLAGS:  -O3 -std=c99 -funroll-loops -Wno-unused -DNDEBUG
/Users/lai/s2p/bin/build_mgm_multi/iio
/Users/lai/s2p/3rdparty/mgm_multi/iio
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/lai/s2p/bin/build_mgm_multi
[  9%] Built target IIOLIB
[ 54%] Built target mgm
[100%] Built target mgm_multi
cp bin/build_mgm_multi/mgm_multi bin
/Library/Developer/CommandLineTools/usr/bin/make -C 3rdparty/tvl1flow
make[1]: Nothing to be done for `default'.
cp 3rdparty/tvl1flow/tvl1flow bin
cp 3rdparty/tvl1flow/callTVL1.sh bin
mkdir -p bin/build_msmw3
cd bin/build_msmw3; cmake -D CMAKE_BUILD_TYPE=Release ../../c/msmw; /Library/Developer/CommandLineTools/usr/bin/make
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/lai/s2p/bin/build_msmw3
[ 10%] Building CXX object CMakeFiles/msmw.dir/LibMSMW/ConnectedComponents.cpp.o
clang: error: no such file or directory: 'NOTFOUND'
make[3]: *** [CMakeFiles/msmw.dir/LibMSMW/ConnectedComponents.cpp.o] Error 1
make[2]: *** [CMakeFiles/msmw.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [msmw3] Error 2

My system info:
osx: 10.12.6
GDAL: 2.1.3
gcc:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

python version (local):

/usr/local/bin/pydoc             /usr/local/bin/python3
/usr/local/bin/pydoc2            /usr/local/bin/python3-config
/usr/local/bin/pydoc2.7          /usr/local/bin/python3.6
/usr/local/bin/pydoc3            /usr/local/bin/python3.6-config
/usr/local/bin/pydoc3.6          /usr/local/bin/python3.6m
/usr/local/bin/python            /usr/local/bin/python3.6m-config
/usr/local/bin/python-config     /usr/local/bin/pythonw
/usr/local/bin/python2           /usr/local/bin/pythonw2
/usr/local/bin/python2-config    /usr/local/bin/pythonw2.7
/usr/local/bin/python2.7         /usr/local/bin/pyvenv
/usr/local/bin/python2.7-config  /usr/local/bin/pyvenv-3.6

python version (sudo):

/usr/bin/pydoc            /usr/bin/python-config    /usr/bin/python2.7-config
/usr/bin/pydoc2.6         /usr/bin/python2.6        /usr/bin/pythonw
/usr/bin/pydoc2.7         /usr/bin/python2.6-config /usr/bin/pythonw2.6
/usr/bin/python           /usr/bin/python2.7        /usr/bin/pythonw2.7

Any help would be appreciated.
Thank you.

"s2p_test.py --all" return dsm.tif error

I am unable to make the new build (963a429) work on my Ubuntu 16.04 system.
The "python s2p_test.py --all" return an error and dsm.tif is not build.

Error code appended below:

python s2p_test.py --all
The following tests will be run: ['unit_image_keypoints', 'unit_matching', 'unit_matches_from_rpc', 'end2end_pair', 'end2end_triplet', 'end2end_cluster', 'unit_distributed_plyflatten']
Running test unit_image_keypoints...

RUN: sift_roi testdata/input_triplet/img_02.tif 100 100 200 200 -o /tmp/s2p_eABiuO.txt
0:00:00.224520
144 spatially redundant kpts found in test
144 spatially redundant kpts found in ref
48 kpts found in test but not in ref
48 kpts found in ref but not in test
0 test kpts have no spatially close match in ref
0 ref kpts have no spatially close match in test
Success.

Running test unit_matching...

RUN: matching testdata/units/sift1.txt testdata/units/sift2.txt -relative 0.600000 -o /tmp/s2p_xXQwcN.txt
199 matches
0:00:00.216111
Success.

Running test unit_matches_from_rpc...

WARNING: returning coarse range from rpc
Success.

Running test end2end_pair...

Configuration file: testdata/input_pair/config.json
Reference DSM: testdata/expected_output/pair/dsm.tif

WARNING: ignoring unknown parameter utm_bbx.
tile size: 350 350
total number of tiles: 4 (2 x 2)

discarding masked tiles...
done 4 / 4 tiles
Elapsed time: 0:00:00.111502

correcting pointing locally...
done 4 / 4 tiles
Elapsed time: 0:00:04.158609

correcting pointing globally...
Elapsed time: 0:00:00.002597

rectifying tiles...
done 4 / 4 tiles
Elapsed time: 0:00:00.308419

running stereo matching...
done 4 / 4 tiles
Elapsed time: 0:00:09.623242

triangulating tiles...
done 4 / 4 tiles
Elapsed time: 0:00:00.507609

computing global source window (xoff, yoff, xsize, ysize)...
Elapsed time: 0:00:00.000363

computing DSM by tile...
done 4 / 4 tiles
Elapsed time: 0:00:00.205335

computing global DSM...

RUN: gdalbuildvrt -vrtnodata nan testoutput/output_pair/dsm.vrt testoutput/output_pair/tiles_row_150_height_350/col_150_width_350/dsm.tif testoutput/output_pair/tiles_row_150_height_350/col_500_width_350/dsm.tif testoutput/output_pair/tiles_row_500_height_350/col_150_width_350/dsm.tif testoutput/output_pair/tiles_row_500_height_350/col_500_width_350/dsm.tif
ERROR 5: Invalid -vrtnodata value
Traceback (most recent call last):
File "s2p_test.py", line 287, in
command(args)
File "s2p_test.py", line 167, in end2end
s2p.main(test_cfg)
File "/home/dem/s2p/s2p.py", line 638, in main
global_dsm(tiles)
File "/home/dem/s2p/s2p.py", line 508, in global_dsm
" ".join(dsm_list)))
File "/home/dem/s2p/s2plib/common.py", line 97, in run
e.output})
s2plib.common.RunFailure: {'environment': {'QT_QPA_PLATFORMTHEME': 'appmenu-qt5', 'IM_CONFIG_PHASE': '1', 'DBUS_STARTER_ADDRESS': 'unix:abstract=/tmp/dbus-pB2Fc4nwiv,guid=50942473b3d9100fe651f84c58d94289', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'UPSTART_EVENTS': 'starting', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'XDG_SESSION_TYPE': 'x11', 'QT_IM_MODULE': 'ibus', 'LOGNAME': 'dem', 'USER': 'dem', 'PATH': '/home/dem/s2p/bin:/home/dem/bin:/home/dem/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'XDG_VTNR': '7', 'GNOME_KEYRING_CONTROL': '', 'DISPLAY': ':0', 'LANG': 'en_US.UTF-8', 'TERM': 'xterm-256color', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'XAUTHORITY': '/home/dem/.Xauthority', 'LANGUAGE': 'en_US:en', 'SESSION_MANAGER': 'local/dem-pc:@/tmp/.ICE-unix/1921,unix/dem-pc:/tmp/.ICE-unix/1921', 'SHLVL': '1', 'QT_LINUX_ACCESSIBILITY_ALWAYS_ON': '1', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/dem', 'CLUTTER_IM_MODULE': 'xim', 'UPSTART_INSTANCE': '', 'QT_ACCESSIBILITY': '1', 'WINDOWID': '54525962', 'SESSIONTYPE': 'gnome-session', 'XMODIFIERS': '@im', 'GPG_AGENT_INFO': '/home/dem/.gnupg/S.gpg-agent:0:1', 'HOME': '/home/dem', 'QT4_IM_MODULE': 'xim', 'GTK2_MODULES': 'overlay-scrollbar', 'XDG_SESSION_DESKTOP': 'ubuntu', 'XDG_RUNTIME_DIR': '/run/user/1000', 'INSTANCE': '', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'COMPIZ_CONFIG_PROFILE': 'ubuntu', 'SSH_AUTH_SOCK': '/run/user/1000/keyring/ssh', 'VTE_VERSION': '4205', 'GDMSESSION': 'ubuntu', 'MANDATORY_PATH': '/usr/share/gconf/ubuntu.mandatory.path', 'UPSTART_JOB': 'dbus', 'GNOME_KEYRING_PID': '', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'DBUS_STARTER_BUS_TYPE': 'session', 'XDG_CURRENT_DESKTOP': 'Unity', 'XDG_SESSION_ID': 'c1', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-pB2Fc4nwiv,guid=50942473b3d9100fe651f84c58d94289', '_': '/usr/bin/python', 'DEFAULTS_PATH': '/usr/share/gconf/ubuntu.default.path', 'GTK_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'ubuntu', 'UPSTART_SESSION': 'unix:abstract=/com/ubuntu/upstart-session/1000/1406', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'GTK_MODULES': 'gail:atk-bridge:unity-gtk-module', 'OLDPWD': '/home/dem', 'GDM_LANG': 'en_US', 'DBUS_DEBUG_OUTPUT': '1', 'XDG_DATA_DIRS': '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'PWD': '/home/dem/s2p', 'JOB': 'xsession-init', 'XDG_MENU_PREFIX': 'gnome-', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:
.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:*.xspf=00;36:', 'XDG_SEAT': 'seat0'}, 'output': None, 'command': u'gdalbuildvrt -vrtnodata nan testoutput/output_pair/dsm.vrt testoutput/output_pair/tiles_row_150_height_350/col_150_width_350/dsm.tif testoutput/output_pair/tiles_row_150_height_350/col_500_width_350/dsm.tif testoutput/output_pair/tiles_row_500_height_350/col_150_width_350/dsm.tif testoutput/output_pair/tiles_row_500_height_350/col_500_width_350/dsm.tif'}

no test.json

There seems no test.json in the s2p directory for current version.

compiling unsuccessful

New to all this, so sorry if making obvious mistakes...
Running on ubuntu 16.04

When compiling following error occurs:

elske@laptop:~/software/s2p$ make all
make -j -C c/homography
make[1]: Entering directory '/home/elske/software/s2p/c/homography'
g++ -o homography main.o LibImages/LibImages.o Utilities/Utilities.o Utilities/Memory.o Utilities/Parameters.o Utilities/Time.o LibHomography/Homography.o LibHomography/Splines.o gdal-config --libs
LibImages/LibImages.o: In function Image::Image()': LibImages.cpp:(.text+0x2c): undefined reference to omp_get_max_threads'
LibImages/LibImages.o: In function Image::Image(unsigned long, unsigned long, unsigned long, unsigned long)': LibImages.cpp:(.text+0x82): undefined reference to omp_get_max_threads'
LibImages/LibImages.o: In function Image::Image(float const*, unsigned long, unsigned long, unsigned long)': LibImages.cpp:(.text+0x146): undefined reference to omp_get_max_threads'
LibImages/LibImages.o: In function Image::readGDAL(char const*, unsigned long)': LibImages.cpp:(.text+0xda7): undefined reference to omp_get_max_threads'
LibImages/LibImages.o: In function Image::copyInner(Image&, int) const': LibImages.cpp:(.text+0x2960): undefined reference to omp_get_max_threads'
LibImages/LibImages.o:LibImages.cpp:(.text+0x486e): more undefined references to `omp_get_max_threads' follow
collect2: error: ld returned 1 exit status
Makefile:15: recipe for target 'homography' failed
make[1]: *** [homography] Error 1
make[1]: Leaving directory '/home/elske/software/s2p/c/homography'
makefile:45: recipe for target 'homography' failed
make: *** [homography] Error 2

Please advice....

Thanks,
Elske

Exception in python code when running in debug mode

When using debug = true in config.json, the console log is full of the following error :

File "/home/michelj/dev/src/s2p/s2plib/rectification.py", line 376, in rectify_pair
os.path.join(out_dir, 'sift_matches_disp.png'))
File "/home/michelj/dev/src/s2p/s2plib/visualisation.py", line 174, in plot_matches
crop1 = common.image_qauto(common.image_crop_gdal(im1, x1, y1, w1, h1))
File "/home/michelj/dev/src/s2p/s2plib/common.py", line 406, in image_qauto
extension = '.tif' if tilewise else '.png'
NameError: global name 'tilewise' is not defined

Note that it does not abort the processing.

running s2p on image crops

I'm trying to run s2p on worldview3 pairs without downloading the entire 40k by 40k full-images. I can do this with nasa ASP by placing my crops of interest in their appropriate locations within an empty numpy array the size of the full-image and supplying a --left-image-crop and a --right-image-crop at runtime. Is there a way to manually set a crop for each image to s2p? If not, what would be the best way to run s2p on image crops without ever downloading the full images?

min_max_heights_from_bbx - not a sequence error with TransformPoints

When using exogenous_dem option - the function min_max_heights_from_bbx calls

x_im_proj, y_im_proj, __ = (zip(*lonlat_to_im.TransformPoints(lonlatalt)))
however lonlatalt is not a sequence as TransformPoints is expecting.

Instead changed to:
li = [a for a in lonlatalt]
x_im_proj, y_im_proj, __ = (zip(*lonlat_to_im.TransformPoints(li)))

incorrect disparity range manipulation

This line (and surrounding code) is in charge of extending the disparity range for the stereo matching:

disp_min *= (1 - np.sign(disp_min) * cfg['disp_range_extra_margin'])

But these manipulations are incorrect. If disp_min=0 to begin with, then no multiplication will ever increase the disparity range. The correct way to increase the disparity range is with:

dmin-= (dmax-dmin)* cfg['disp_range_extra_margin'])
dmax+= (dmax-dmin)* cfg['disp_range_extra_margin'])

Code base which works on MacOS?

Hi, the README describes the dependencies to run the code base on a (Ubuntu 16.04).

Is this code tested for a MacOS? Is there a parallel code base or another pipeline for the same?

Thanks

creating constant fixed size for rectified_ref.tif and rectified_sec.tif

Hi!

First of all great project and code I have been using it for a while now as a baseline for my own research!

Unfortunately I am am currently stuck with the following problem: I want to change the code so that all the resulting rectified images (reference and second, one large satellite image pair) of the tiles have always the same constant size. The best would be if the final size of the rectified_ref/rectified_sec.tif would be "tile_size x tile_size".

For now let's assume that the size of the AOI is divisible by the the tile_size (so no resize from adjust_tile_size ) and forget about the border problems of disparity maps (i.e. no margin) .
Then in s2plib/rectification.py in function rectify_pair:

  • You first find matches between ref and sec image using virtual rpc matches
  • Then the F matrix and the homography (H1, H2) is calculated using this matches
  • Then you calculate the max and min disparity range and set the horizontal margin to max(|disp_min|, |disp_max|, hmargin_config) AND compute a translation with the margins that you apply to the homopraphy matrices.

This is the part that I don't understand. Why is this necessary?

Afterwards you apply this homography to the points of the roi and calculate a bounding box? (comment compute output image size).

By try and error I found that if later in this function I write:

common.image_apply_homography(out1, im1, H1, tile_size, tile_size)

That the rectified images have the desired size but of course than when creating the point-cloud out of the disparity it fails (meaning that the tile is only have visible in the ply).

My best guess is that you do this enlargement of the image so that almost all the corresponding points are found in the pairs rather than needing huge overlapping areas. However it can create problems for instance if the AOI is very close to the sat. image border and this "resizing" does not work.

Hopefully I made my issue clear and someone can help me.

best regards

Using s2p framework with own stereo matching algorithm

Hi!

I have the following problem: I want to use the s2p framework with my own matching algorithm.
The problematic part is that this matching algorithm that I want to try does not work with negative disparities.
So the rectification that is done in the framework (disparities centered around 0) does not work for me.

I have already located that in the 3rdparty folder there is a "hack" for this disparity convention for the SGM 2002 method (hirschmuller02) in subpix.sh, however at least as of now I do not get this code, especially as it uses other code of the framework such as imprintf and iion.

Also when I tried to use this matching algorithm with the included testdata input_pair/config.json:
"matching_algorithm" : "hirschmuller02"

It did not work (does not find subpix.sh). I have already downloaded and compiled boofcv with ant in the 3rdparty/stereo_hirschmueller_2002 folder.

Maybe someone can help me to get this to work and/or elaborate on this disparity "hack" so I could try this "hack" on my own.

best regards, Dominik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.