problems when using map project to orthorectify HiRISE images

103 views
Skip to first unread message

Yu Lu

unread,
Jul 16, 2021, 10:43:32 AM7/16/21
to ames-stereo-pi...@googlegroups.com
Hi,

I'd like to use 'mapproject' to orthorectify images onto a DEM.

I translate the published HiRISE DTM.IMG to dtm.tif using gdal_translate. I used hiedr2mosaic.py program to process the HiRISE EDR to get the ***_RED.mos_hijitreged.norm.cub.

Then I tried the following codes:

mapproject -t isis dtm.tif ***_RED.mos_hijitreged.norm.cub output.tif --mpp 0.5

Everything is good. However, the output.tif was not orthorectified at all...

Do you know what is wrong with this?

I would very appreciate it if you could give me some suggestions.

Best wishes,
Yu

Alexandrov, Oleg (ARC-TI)[KBR Wyle Services, LLC]

unread,
Jul 16, 2021, 1:07:57 PM7/16/21
to Yu Lu, ames-stereo-pi...@googlegroups.com
You are doing things right. The first input to mapproject is a DTM you want to project onto, the second is a cube, and the third is the output file. You use --mpp 0.5, which hopefully means that your dtm.tif has a projection using meter units rather than lon-lat. 

You can try to do 

gdalinfo -proj4 output.tif

and see what the resolution and projection are. That file should hopefully be a GeoTiff. 

Then why do you say the output was not rectified? All that needs to happen is for output.tif to now be a georeferenced image. You can try loading both the DTM and your output in stereo_gui, such as

stereo_gui dtm.tif output.tif

then hillshade the dtm, and overlay them as georeferenced images from the View menu (or do this in QGIS). Hopefully these two will be on top of each other, assuming there are no big registration errors among the input camera and the input DTM.




From: ames-stereo-pi...@googlegroups.com <ames-stereo-pi...@googlegroups.com> on behalf of Yu Lu <grds...@gmail.com>
Sent: Friday, July 16, 2021 7:43 AM
To: ames-stereo-pi...@googlegroups.com <ames-stereo-pi...@googlegroups.com>
Subject: [EXTERNAL] problems when using map project to orthorectify HiRISE images
 
--
You received this message because you are subscribed to the Google Groups "Ames Stereo Pipeline Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ames-stereo-pipeline...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ames-stereo-pipeline-support/CAEg%3DzsSt%2BiCkGRSMhcv9VQ2hhv8FfY9UC33Zyca2RWsmb-7apA%40mail.gmail.com.

Yu Lu

unread,
Jul 19, 2021, 7:32:28 AM7/19/21
to ames-stereo-pi...@googlegroups.com

Hi Oleg,

Thanks for your kind reply. I said the output was not rectified because the output.tif could not overlay onto the dtm (published by the HiRISE team), there are some offsets between these two images. It is interesting that some orthoimages published by the HiRISE team could overlay each other completely, but all of them could not overlay the published dtm...

I have tried several times with different input cubes. However, the results are the same. As you said I'm doing things right, I'm quite confused where the problem is. 

I also tried generating a dem with stereo, and then point2dem out-PC.tif --orthoimage input.tif. However, it doesn't work too. The output image could not overlay onto the dtm completely, which is terrible for my research.

Hope that you guys could give me some advice on this. Many thanks.

Best wishes,
Yu

Alexandrov, Oleg (ARC-TI)[KBR Wyle Services, LLC] <oleg.al...@nasa.gov> 于2021年7月17日周六 上午1:07写道:

Alexandrov, Oleg (ARC-TI)[KBR Wyle Services, LLC]

unread,
Jul 19, 2021, 12:40:17 PM7/19/21
to Yu Lu, ames-stereo-pi...@googlegroups.com
Offsets can arise when mapprojecting images because of various camera position and orientation errors. You can try the ASP bundle_adjust tool first, then stereo with the same images using --bundle-adjust-prefix, followed by point2dem --orthoimage. These need not be done on the fill HiRISE images. The ISIS crop command can be used to first crop some clips from left and right images having the same area. 

Hopefully this will take are of the offsets. And I hope I understand correctly what you mean by "overlay onto the dtm completely". Maybe you can send some pictures and point out what the issue is in those pictures. 

Sent: Monday, July 19, 2021 4:32 AM
To: ames-stereo-pi...@googlegroups.com <ames-stereo-pi...@googlegroups.com>
Subject: Fwd: [EXTERNAL] problems when using map project to orthorectify HiRISE images
 

Yu Tao

unread,
Jul 20, 2021, 8:55:09 AM7/20/21
to Ames Stereo Pipeline Support
Hello Yu,

Noticing what Oleg said " You use --mpp 0.5, which hopefully means that your dtm.tif has a projection using meter units rather than lon-lat."

Have you checked that your PDS HiRISE DTM.IMG (or your DTM.tif) has a "projection"?

If your reference data "DTM.tif" itself is not in projected coordinate system, mapproject -mpp wouldn't work for your target image.

If that is the case, you can use the MOLA DTM to first project your DTM.tif from GCS to "Equidistant Cylindrical" with gdalwarp or ArcGIS/QGIS, then orthorectify your HiRISE.cub with the mapproject. 


Kind regards,
Yu (Tao)

Yu Lu

unread,
Jul 20, 2021, 10:25:38 AM7/20/21
to ames-stereo-pi...@googlegroups.com
Hi Oleg, Yu,

Thanks for your replys. I did check the projection of the dtm.tif, and it has a projection EQUIRECTANGULAR_MARS.

I tried bundle_adjust tool first, and then stereo left_image.cub right_image.cub --bundle-adjust-prefix, and then point2dem out-PC.tif --orthoimage left_image.cub. It works well. The output.DRG matches the output.DEM very well. However, when I tried point2dem out-PC.tif --orthoimage right_image.cub, it says Point cloud out-PC.tif and texture file right_image.cube do not have the same dimensions. Then I tried a third image cube, the result remains.

Can the 'point2dem' tool orthorectify only the left_image? or I did something wrong? or there are other tools that I don't know?

I'm sorry for disturbing you guys again and again. I'm really fresh to this tool and orthorectification.

Yu

Yu Tao <yu....@ucl.ac.uk> 于2021年7月20日周二 下午8:55写道:
--
You received this message because you are subscribed to the Google Groups "Ames Stereo Pipeline Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ames-stereo-pipeline...@googlegroups.com.

Alexandrov, Oleg (ARC-TI)[KBR Wyle Services, LLC]

unread,
Jul 20, 2021, 1:34:28 PM7/20/21
to Yu Lu, ames-stereo-pi...@googlegroups.com
Thanks to Yu (Tao) for being of help. 

Can the 'point2dem' tool orthorectify only the left_image? or I did something wrong? or there are other tools that I don't know?

Indeed, point2dem can only rectify the left image. That is because the point2dem tool cheats here. The L.tif image and PC.tif cloud have the same dimensions, so point2dem simply copies the L.tif pixel to color the PC.tif points without doing an honest camera projection.

However, given that now you used bundle adjustment and stereo with bundle-adjusted images, you should be able to use mapproject and will hopefully give correct and consistent results, with both the left and right image. 

You can try:

mapproject out-DEM.tif left_image.cub left_output_map.tif --bundle-adjust-prefix <your prefix goes here>

mapproject out-DEM.tif right_image.cub right_output_map.tif --bundle-adjust-prefix <your prefix goes here>

Hopefully they will give very similar answers. If not, let us know.

Later, if desired to mapproject onto your original  HiRISE DTM, that can be done as described here: https://stereopipeline.readthedocs.io/en/latest/tools/pc_align.html#applying-the-pc-align-transform-to-cameras.

Oleg






Sent: Tuesday, July 20, 2021 7:25 AM
To: ames-stereo-pi...@googlegroups.com <ames-stereo-pi...@googlegroups.com>
Subject: [EXTERNAL] Re: problems when using map project to orthorectify HiRISE images
 
Reply all
Reply to author
Forward
0 new messages