Forum

Author Topic: Automated Ortho Process - World file not getting generated.  (Read 4525 times)

tforward2

  • Newbie
  • *
  • Posts: 17
    • View Profile
Automated Ortho Process - World file not getting generated.
« on: November 13, 2014, 07:55:17 PM »
I have 13 chunks, for 1-9 the Ortho gets create with the world file. For 10-13 only the Ortho get created, has anyone else had this problem?

Only thing I can think of is "filename = chunk.label" is somehow not working correctly...?

Code: [Select]

for chunk in doc.chunks:
    doc.active = active_chunk
    filename = chunk.label
    chunk.crs = crs
    chunk.projection = crs
    dem_path = r"{}\DEM_{}.tif".format(path, filename)
    ortho_path = r"{}\Ortho_{}.jpg".format(path, filename)
    export_to_orthophoto(chunk, ortho_path, projection=crs)

def export_to_orthophoto(chunk, path, format='jpg', blending='mosaic', color_correction=False, projection=crs, write_kml=False, write_world=True):
print ("\nExporting ({}, {}, {}, {}) Orthophoto...\n".format(path, format, blending, color_correction, write_kml=False, write_world=True))
result = chunk.exportOrthophoto(path, format, blending, color_correction, projection, write_kml=False, write_world=True)
return result

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Automated Ortho Process - World file not getting generated.
« Reply #1 on: November 13, 2014, 08:00:54 PM »
Hello tforward2,

Are you sure that all the chunks are referenced in geographic coordinates? Also have you tried to export orthophoto using GUI with Write World file option enabled?
Best regards,
Alexey Pasumansky,
Agisoft LLC

tforward2

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Automated Ortho Process - World file not getting generated.
« Reply #2 on: November 13, 2014, 09:16:20 PM »
All images are in Lat/Long as they are pulled from the GPS. As mentioned the orthophoto still gets created it's just not the world file.

I also explicitly set the coordinate system.
Code: [Select]
crs = PhotoScan.CoordinateSystem()
#WGS84
crs.init("EPSG::4326")

I can manually do it with the GUI just does not really help as as I need it to be an automated process.
« Last Edit: November 13, 2014, 09:17:53 PM by tforward2 »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Automated Ortho Process - World file not getting generated.
« Reply #3 on: November 13, 2014, 09:30:45 PM »
Hello tforward2,

I've asked if manual way works correctly, to check whether the problem is script related.

I can suggest to change the line with the function arguments definition (starting from def word) and to leave only the names of three arguments:
Code: [Select]
def export_to_orthophoto (chunk, path, projection):
Otherwise it looks to me that there may be issues when you are using projection = crs in the function definition.
Best regards,
Alexey Pasumansky,
Agisoft LLC