Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC rectification using Planet Scope Scenes #141

Open
FergusDal opened this issue May 30, 2023 · 3 comments
Open

RPC rectification using Planet Scope Scenes #141

FergusDal opened this issue May 30, 2023 · 3 comments

Comments

@FergusDal
Copy link

I am experiencing issues applying the s2p pipeline to Planet Scope Scenes. Particularly, it seems that the rectification isn't working properly. Upon visual inspection, the rectification pairs seem to be shifted, and not correctly coregistered. (See attached red and green image).
Rectification_Issue

I am using two PlanetScope Basic Scenes (level 1B), (Names: 20201124_031355_67_1064_1B_AnalyticMS, 20201126_031738_79_105d_1B_AnalyticMS), with"rectification method" = "rpc". If I am reading the source code correctly, the code assumes the accompanying RPC txt files can be parsed the same as ikonos rpc files. Do you know if Planet and Ikonos rpc files are really compatible? Or do you have any other ides why it is not working?

Attached is also the config file. The images were converted to grayscale before introduction to the pipeline by simply averaging the 4 channels. I also tested with original images, they also seem to not rectify properly.

config.txt

@gfacciol
Copy link
Member

Hi!
Could you try "rectification_method": "sift" instead of "rpc" ?
My guess is that the RPC are not globally adjusted, so it's better to ignore them for the rectification.

@jveitchmichaelis
Copy link

jveitchmichaelis commented Jun 22, 2023

Thanks @gfacciol I had a play around with the config. Apologies for the late reply, I've been in the field. This seems to work well:

Initial band merging (one image for example):

echo 20201124_031355_67_1064_1B_AnalyticMS.tif | xargs -I{} gdal_calc.py -R {} --R_band=1 -G {} --G_band=2 -B {} --B_band=3 --outfile=gray.tif --calc="R*0.2989+G*0.5870+B*0.1140"
{
  "clean_tmp": true,
  "clean_intermediate": false,
  "out_dir" : "./output/",
  "images" : [
    {"img" : "files/PSScene/20201124_031355_67_1064/basic_analytic_udm2/gray.tif"},
    {"img" : "files/PSScene/20201126_031738_79_105d/basic_analytic_udm2/gray.tif"}
    ],
  "roi": {
      "x": 0,
      "y": 0,
      "w": 3000,
      "h": 3000
   },
  "full_img": true,
  "horizontal_margin": 128,
  "vertical_margin": 128,
  "tile_size" : 1024,
  "disp_range_method" : "sift",
  "rectification_method": "rpc",
  "dsm_resolution": 0.5,
  "use_srtm": true
}

I'm not sure what we had set up wrong the first time, but this seems to produce a decent DEM!

@gfacciol
Copy link
Member

Hi @jveitchmichaelis,
the config looks good!
You can also try using "rectification_method": "sift"
that's because if rpcs are not too precise the epipolar rectification based on rpcs can lead to poorer DEMs.
let me know if it improves.
best
g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants