stuck with either bundle_adjust or mapproject

4 views
Skip to first unread message

Janko Trisic Ponce

unread,
Oct 16, 2025, 12:02:31 PM (10 days ago) Oct 16
to Ames Stereo Pipeline Support
Hi, 

I'm working with ASP 3.6.0-alpha, and isis-8.3.0. 
I'm trying to reproduce the data from Hepburn et al. (2019) - "Creating HiRISE digital elevation models for Mars using the open-source Ames Stereo Pipeline", specifically AU DEM 4. I've ran into issues after running bundle_adjust, but I don't know if it stems from running it incorrectly:

>bundle_adjust --datum MOLA ESP_052535_2225_RED_rotated.cub ESP_052324_2225_RED_rotated.cub hirise_gcps.gcp -o bundle_adjusted_hirise

I had to rotate the images because when I projected them in stereo_gui to get the GCPs they were flipped. After running bundle_adjust, I want to do mapproject on each image. I'm doing:

>mapproject --tr 1.0 HRSC.cub ESP_052535_2225_RED_rotated.cub bundle_adjusted_hirise-ESP_052535_2225_RED_rotated.adjust ESP_052535_2225_map.tiff

but get the error:

mapproject_single --query-projection HRSC.cub ESP_052535_2225_RED_rotated.cub bundle_adjusted_hirise-ESP_052535_2225_RED_rotated-stats.tif ESP_052535_2225_map.tiff --tr 1.0

ERROR: **ERROR** Unable to read PVL file [bundle_adjusted_hirise-ESP_052535_2225_RED_rotated-stats.tif].

**ERROR** Error in PVL file on line [1].

**ERROR** The PVL keyword [II*] does not appear to be a valid Pvl Keyword.

--> Setting number of processing threads to: 4

Using session: isis

Loading camera model: ESP_052535_2225_RED_rotated.cub bundle_adjusted_hirise-ESP_052535_2225_RED_rotated-stats.tif

I don't know where I went wrong. I'm not sure if I'm passing bundle_adjust correctly, and that doesn't create the necessary files, or if it's an issue of how I'm passing mapproject. The HRSC.cub file that I use is the HRSC DEM that is used in the article. When I have tried using the .tiff file, it says it's lacking georeference information; nevertheless I used it to mapproject the CTX image on the DEM as they do in the AU pipeline and so far it's worked. 

If you know what the issue is and could give me some guidelines, it would be much appreciated!

Oleg Alexandrov

unread,
Oct 16, 2025, 12:14:09 PM (10 days ago) Oct 16
to Janko Trisic Ponce, Ames Stereo Pipeline Support

I had to rotate the images because when I projected them in stereo_gui to get the GCPs they were flipped.

Note that stereo_gui cannot project images. I guess what you mean is that when you visualize them they appear flipped. That is possible. Sometimes, the way the satellite flies or the way the camera is configured the images can appear upside down. 

The raw images should be left as-is. To perform a sanity check, one should use the mapproject command with the original cub files and without bundle adjustment. If your "flipped" images result in a normal-looking orthoimage after mapproject (which may be shifted a little) that means that the images are good.

 
After running bundle_adjust, I want to do mapproject on each image. I'm doing:

>mapproject --tr 1.0 HRSC.cub ESP_052535_2225_RED_rotated.cub bundle_adjusted_hirise-ESP_052535_2225_RED_rotated.adjust ESP_052535_2225_map.tiff


This is likely not the right command. The first argument should be a DEM. I guess HRSC.cub is a DEM, but it may be better to convert it to a regular geotiff file with tif extension with gdal_translate to not confuse the program.

The third argument is  bundle_adjusted_hirise-ESP_052535_2225_RED_rotated.adjust. The program will not understand this. One should either avoid this at all, or specify instead the --bundle-adjust-prefix option. We have an example here: https://stereopipeline.readthedocs.io/en/latest/tools/bundle_adjust.html#use-of-the-results

 The HRSC.cub file that I use is the HRSC DEM that is used in the article. When I have tried using the .tiff file, it says it's lacking georeference information; nevertheless I used it to mapproject the CTX image on the DEM as they do in the AU pipeline and so far it's worked. 


Let us hope that using --bundle-adjust-prefix as in that example at the link above, while keeping HRSC.cub as a DEM will work. You cannot use a different tiff file instead of this. All you can do is run the command gdal_translate inputDEM.cub outputDEM.tif (but likely it will work as you say even without this).

 
Reply all
Reply to author
Forward
0 new messages