Forum

Author Topic: Exported Ortho is wrong using API python code compared exporting it manually  (Read 2237 times)

michaelguest

  • Newbie
  • *
  • Posts: 9
    • View Profile
 Hello there! I used some code to export my orthomosaic however the export looks totally wrong compared to if I use Metashape 1.5 and manually do it from the workflow >> batch process >> export orthormosaic. I have attached my wrong tiff/right tiff and code. Also I will show you my code that I used using the Metashape 1.5 API. Also my KML file crashes Google Earth. The KML was generated manually. I was wondering do you guys know whats wrong? I am probably not adding something in my code that I am supposed to.




Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Hello michaelguest,

Is the problem with the orthomosaic generation or export? If you open the project with the orthomosaic generated with the script is the orthomosaic complete or the same part is shown?
Best regards,
Alexey Pasumansky,
Agisoft LLC

michaelguest

  • Newbie
  • *
  • Posts: 9
    • View Profile
There is no problem with the Orthomosaic generation. The problem is when I export the orthomosaic with the script if you refer to the photo I have attached below named wrongOrthoExport you can see that it doesn't show the whole area as opposed to the other photo which was done manually using Metashape GUI. When I open the project the orthomosaic is complete. I have attached the complete orthomosaic below.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Hello michaelguest,

I have not noticed that at first, but you are exporting individually orthorectified images instead of orthomosaic. In 1.5.5 version you should use exportOrthomosaic() function.
Best regards,
Alexey Pasumansky,
Agisoft LLC

michaelguest

  • Newbie
  • *
  • Posts: 9
    • View Profile
Oh ok I understand now I didn't catch that thank you I will change that.

michaelguest

  • Newbie
  • *
  • Posts: 9
    • View Profile
Thank you very much for your help!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Instead of exportOrthophotos you should use exportOrthomosaic.

Best regards,
Alexey Pasumansky,
Agisoft LLC

michaelguest

  • Newbie
  • *
  • Posts: 9
    • View Profile
Awesome thank you so much! Just one little mistake in code can mess everything up.

michaelguest

  • Newbie
  • *
  • Posts: 9
    • View Profile
The tiff export is correct now however my exported kml file crashes google earth and is only 1kb. I even tried to load it on google earth online and used another computer.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Hello michaelguest,

This KML contains the link to TIFF.

Probably you should export KMZ file which contain orthomosaic tiles? Then modify the export file name and use format = Metashape.RasterFormatKMZ
Best regards,
Alexey Pasumansky,
Agisoft LLC

michaelguest

  • Newbie
  • *
  • Posts: 9
    • View Profile
Sweet I will try that thank you so much!