Forum

Author Topic: Color contrast of the elevation data  (Read 7907 times)

Dhanraj Jain

  • Newbie
  • *
  • Posts: 13
    • View Profile
Color contrast of the elevation data
« on: August 14, 2023, 09:30:02 AM »
I've successfully generated Orthomosaic TIF, DSM TIF, 3D model, and point cloud using the Python API in Agisoft Metashape 1.8.5. However, I've noticed that the DSM TIF image has an excessively high color contrast, and I'd like to adjust this. Are there any options or methods within Agisoft Metashape 1.8.5 Python API that allow me to modify the color contrast of the DSM TIF image during or after generation?

This is my code for the reference
Code: [Select]
chunk.buildDem(source_data=Metashape.DenseCloudData, interpolation=Metashape.Interpolation.EnabledInterpolation)
chunk.exportRaster('/dem.tif', source_data = Metashape.ElevationData)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15438
    • View Profile
Re: Color contrast of the elevation data
« Reply #1 on: August 14, 2023, 02:15:07 PM »
Hello dhanrajJain,

If you are not using Raster Transform -> Palette for DEM export, then it will be saved as a single channel GeoTIFF image with absolute altitude values for each pixel. So I am not sure, what do you mean about "contrast" for such kind of output? Visualization and interpretation of single band data can be adjusted in the application that is used to view and analyze DEM data.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Dhanraj Jain

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Color contrast of the elevation data
« Reply #2 on: August 16, 2023, 08:41:54 AM »
Dear Alexey,
Thank you for explaining the export process for DEMs. I've been converting a DSM TIFF image into a Cloud-Optimized GeoTIFF (COG) format, but I've encountered an issue. When visualizing the COG, the DSM image appears significantly darker in color. I'm wondering if using Agisoft Metashape Python 1.8.5 could potentially help address this concern. Your insights on this matter would be greatly appreciated.

Dhanraj Jain

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Color contrast of the elevation data
« Reply #3 on: August 16, 2023, 10:09:50 AM »
Also, I've noticed that in the Agisoft Metashape 1.8.5 documentation, there are a couple of options mentioned: 'colorizeDenseCloud' and 'colorizeMode'. Could you please provide some insights into the purpose and usage of these options?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15438
    • View Profile
Re: Color contrast of the elevation data
« Reply #4 on: August 16, 2023, 07:12:37 PM »
Hello Dhanraj Jain,

Can you please provide the screenshot of the Export DEM dialog with the parameters that you are using? Or the exportRaster line, if you are performing the export via Python API.

Colorize Dense Cloud and Colorize Model operations allows to apply the colors to the dense cloud points or mesh vertices (respectively) based on the different options, like source images or orthomosaic, for example.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Dhanraj Jain

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Color contrast of the elevation data
« Reply #5 on: August 17, 2023, 08:44:58 AM »
Dear Alexey,

Thank you for your response. I appreciate your guidance regarding the Colorize Dense Cloud and Colorize Model operations.

Regarding the Export DEM dialog and the parameters I'm using, I'd be happy to share that information. Here is the relevant 'exportRaster' line from my Python API code:
Code: [Select]
chunk.buildDem(source_data=Metashape.DenseCloudData, interpolation=Metashape.Interpolation.EnabledInterpolation)
chunk.exportRaster('/dem.tif', source_data = Metashape.ElevationData)

I'm intrigued by the Colorize Dense Cloud and Colorize Model options you mentioned. It sounds like they could potentially help me achieve the desired color adjustments for the DSM. Could you provide some more details on how to utilize these options effectively? Specifically, how can I apply these operations to modify the color contrast of the DSM TIF image? Are there any specific parameters or steps I should follow in Agisoft Metashape 1.8.5 to achieve this?

Dhanraj Jain

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Color contrast of the elevation data
« Reply #6 on: August 17, 2023, 04:37:59 PM »
I have another query regarding the generated report. I noticed that the report includes a Reconstructed digital elevation model image, and I'm interested in obtaining this image separately, Can we do this in Agisoft Metashape 1.8.6 Python API?
Could you please guide me on how I can extract or save this image from the report as a standalone file?
« Last Edit: August 17, 2023, 04:40:57 PM by Dhanraj Jain »