Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Dhanraj Jain

Pages: [1]
1
Hello everyone,

I hope you're all doing well. I'm currently working on a project using Agisoft Metashape and have run into an issue with the size of the 3D models generated. To reduce the file size, I'm exploring the use of the decimateModel option in Agisoft Metashape's Python API version 1.8.5.

I've used the high option for building depth and a dense model to achieve the desired accuracy in the DTM image. However, the resulting 3D model (in ModelFormatOBJ) is too large. I believe that utilizing the decimateModel function could help reduce its size, but I'm unsure about the correct way to implement this.

I would greatly appreciate any guidance or advice on how to effectively use the decimateModel function to reduce the size of 3D models generated in Agisoft Metashape.

Thank you all in advance for your help.

Best regards,
Dhanraj

2
I'm working with multispectral data from the Parrot Sequoia camera, encompassing five bands: RGB, GREEN, RED, NIR, and REDEDGE. Employing the Agisoft Metashape 1.8.5 Python API workflow code from GitHub for data processing, I encountered a challenge when generating an orthomosaic image.

Upon inspecting the band information within the orthomosaic, I observed six bands listed as ('gray', 'undefined', 'undefined', 'undefined', 'undefined', 'alpha'). I aim to accurately identify the specific band names instead of encountering 'undefined' values.

Could you advise on how to retrieve the band names instead of encountering 'undefined' in the orthomosaic image generated through the Agisoft Metashape 1.8.5 Python API workflow code?"

3
Python and Java API / Improving Orthomosaic Quality for Road Survey
« on: September 21, 2023, 02:03:39 PM »
I'm currently processing images from a road survey to generate orthomosaic and elevation TIF images, and the process is completed successfully without any errors. However, since these images are all along a single line, reflecting the nature of a road survey, I've noticed that in some parts of the orthomosaic, there are disturbances.

I'm using Agisoft Metashape Python 1.8.5 for this task, and I'm wondering if there is a special method or technique within this software that can help me address this issue and improve the quality of the orthomosaic along the road survey path. Any insights or suggestions would be greatly appreciated.

4
Hello Paulo,
Thank you for your response. Could you please share a code example for this process? I'm not sure about storing DEM and DTM together or if we need to create a separate chunk for the DTM from the main chunk.
Additionally, I came across the "classifyGroundPoints" function in the Agisoft Metashape Python 1.8.5 documentation; is this the function you are referring to?

5
Hello, Agisoft Metashape community,

I am currently using Agisoft Metashape Python API version 1.8.5 to generate orthomosaic, DEM, dense cloud, and 3D models. I've been following the code example provided at https://github.com/agisoft-llc/metashape-scripts/blob/1.8/src/samples/general_workflow.py to accomplish this.

Now, I am looking to expand my workflow and also generate Digital Terrain Model (DTM) images from the same dataset. However, I couldn't find specific information or examples in the documentation or the sample script linked above on how to achieve this.

Could someone please suggest an appropriate solution or guide on how to integrate DTM generation into my existing workflow using Agisoft Metashape Python API version 1.8.5? Any code examples or step-by-step instructions would be greatly appreciated.

Thank you in advance for your assistance!

6
Python and Java API / Re: Color contrast of the elevation data
« 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?

7
Python and Java API / Re: Color contrast of the elevation data
« 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?

8
Python and Java API / Re: Color contrast of the elevation data
« 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?

9
Python and Java API / Re: Color contrast of the elevation data
« 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.

10
Python and Java API / 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)

11
Thanks, Paulo, Please check the current code that I am using to add images in the chunk and perform processing. I have also added the keep_keypoints argument into the matchPhotos.
So now I want to add 25 new images, should I add them in preprocessed chunks with the old 50 images or add all 75 images into the chunk at the same time?
What is the best method for adding photos in chunks?

Code: [Select]
def match_photos_and_align_cameras(self):
    photos = [entry.path for entry in os.scandir(self.imgPath) if (entry.is_file() and os.path.splitext(entry.name)[1].lower() in [".jpg", ".jpeg", ".tif", ".tiff", "png"])]
    self.chunk.addPhotos(photos)
    print(str(len(self.chunk.cameras)) + " images loaded")
    self.chunk.matchPhotos(keypoint_limit = accuracyParameter[self.accuracy][0], tiepoint_limit = accuracyParameter[self.accuracy][1], generic_preselection = True, reference_preselection = True, keep_keypoints=True)
    self.chunk.alignCameras()
    self.doc.save()

12
Thanks Paulo
The mentioned solution might work for desktop applications but I am working with the Agisoft Metashape python API 1.8.5.
Hello dhanrajJain,

To avoid to have to reprocess the whole dataset, you can consider using incremental image alignment. From user manual 1.8:
Code: [Select]
Incremental image alignment
In case some extra images should be subaligned to the set of already aligned images, you can benefit
from incremental image alignment option. To make it possible, two rules must be followed: 1) the scene
environment should not have changed significantly (lighting conditions, etc); 2) do not forget to switch on
Keep key points option in the Preferences dialog, Advanced tab BEFORE the whole processing is started.
To subalign some extra images added to the chunk with already aligned set of
images
1. Add extra photos to the active chunk using Add photos command from the Workflow menu.
2. Open Align photos dialog from the Workflow menu.
3. Set alignment parameters for the newly added photos. IMPORTANT! Uncheck Reset alignment
option.
4. Click OK. Metashape will consider existing key points and try to match them with key points detected
on the newly added images.

After such incremental alignment, you would need to generate all subsequent required products: 3d model, dense cloud, dem, Ortho....

Hope this can be of seme help,

Kindly please suggest something that will work for the Python API.

13
I hope this message finds you well. I am writing to seek assistance regarding the Agisoft Python API 1.8.5 and its processing capabilities when handling large datasets.

Currently, I am utilizing the Agisoft Python API 1.8.5 to process a set of 50 images in chunks. This process generates the required output, including a point cloud, orthoimage, digital elevation model (DEM), and a 3D model. However, I now have an additional set of 25 images that I would like to include in the processing pipeline.

My question is whether it is possible to seamlessly continue the processing by adding the new set of 25 images to the existing dataset, or if the entire dataset needs to be reprocessed from scratch. I am seeking a solution that can help me save both time and resources.

I would greatly appreciate it if you could provide guidance on how to efficiently continue the processing with the Agisoft Python API 1.8.5 without the need for complete reprocessing. Any insights or recommendations regarding this matter would be highly valuable.

Thank you very much for your attention to this inquiry. I look forward to hearing from you soon.

Pages: [1]