Forum

Author Topic: Export Orthophotos in v 1.2  (Read 3927 times)

lvargo13

  • Newbie
  • *
  • Posts: 14
    • View Profile
Export Orthophotos in v 1.2
« on: October 19, 2016, 07:53:42 AM »
Hello,

I'm trying to use PhotoScan to orthorectify photographs (~100 of them). I can successfully orthorectify each of the images using the pre- v 1.2 technique (build orthomosaic, disable all but one image, export orthomosaic). However, when I try and utilise the Export Orthophoto tool in v. 1.2, only 2 of the photos will successfully export as orthophotos. This happens when I try and export all cameras as orthophotos, and when I individually select photos to export one at a time- only the same 2 photos will export.

I've made sure to save the project, and the 2 images that will export are similar sizes and qualities as the ones that will not export. They are all oblique images- but I'm confident that they're aligned correctly (most images are georeferenced, with an error of less than 1 m). I've also attached the console output from 1 of the images that will work with export orthophoto, and from 1 of the images that will not export.

I'm running 1.2.5 build 2680 (64 bit)

Any suggestions for using this new tool would be great, thanks!
« Last Edit: October 19, 2016, 08:13:17 AM by lvargo13 »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Export Orthophotos in v 1.2
« Reply #1 on: October 19, 2016, 02:24:48 PM »
Hello lvargo13,

Please check if the same issue is related to the version 1.2.6 build 2834. If so, then please provide the screenshot of the Export Orthophotos dialog with the parameters used and the screenshot of the default values in the Orthomosaic export dialog.
Best regards,
Alexey Pasumansky,
Agisoft LLC

lvargo13

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Export Orthophotos in v 1.2
« Reply #2 on: October 20, 2016, 06:44:03 AM »
Hi Alexey,

Updating to 1.2.6 worked, thanks- I'll make sure to keep updated.


As a note for future users, the line in the python code I used is

Code: [Select]
chunk.exportOrthophotos("/Users/ortho_{filename}.tif", projection = chunk.crs)
« Last Edit: October 20, 2016, 07:07:53 AM by lvargo13 »

lvargo13

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Export Orthophotos in v 1.2
« Reply #3 on: October 20, 2016, 07:29:29 AM »
Hi Alexey,

One more question, If I only wanted to orthorectify a subset of images in the project, is that possible through a python script? Right now all of the images in the project are in 1 chunk, the only ways to differentiate between them is that the images I want to orthorectify are named something like 9999_999.tif and are not georeferenced, while the ones I don't need to orthorectify are named DSC_9999.tif and are georeferenced.

My script is below if that helps.
Thanks for all your help,
Lauren


Code: [Select]
#!/usr/bin/python

import PhotoScan
import os
import time
import glob

project_mask = "/Volumes/mask.psx"  # link to existing mask to use
old_photos_path = "/Volumes/data/"      # path to old photos
save_path =  "/Volumes/project_"    # where to save projects

# open existing mask
doc = PhotoScan.app.document
doc.open(project_mask)
chunk = doc.chunk

# go to correct directory, list photos in that directory (for that year)
os.chdir(old_photos_path)
photo_list = glob.glob("*.tif")  # list of paths for each tiff

# build model
chunk.addPhotos(photo_list)
chunk.matchPhotos(accuracy=PhotoScan.HighAccuracy, preselection=PhotoScan.NoPreselection, filter_mask=True, keypoint_limit=100000, tiepoint_limit=4000)
chunk.alignCameras()
chunk.buildDenseCloud(quality=PhotoScan.MediumQuality)
chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.EnabledInterpolation)
chunk.buildUV(mapping=PhotoScan.GenericMapping)
chunk.buildTexture(blending=PhotoScan.MosaicBlending, size=4096)

# orthorectify photos 
chunk.exportOrthophotos("/Volumes/ortho_{filename}.tif", projection = chunk.crs)

doc.save(path = save_path+".psx")
« Last Edit: October 20, 2016, 07:31:28 AM by lvargo13 »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Export Orthophotos in v 1.2
« Reply #4 on: October 20, 2016, 12:24:33 PM »
Hello Lauren,

Do you mean to export only certain photos (like only for selected cameras option in GUI)?

Note that exportOrthophotos operation will work only after Orthomosaic is generated (orthorectified images will then be stored in the project folder). So you need to use buildOrthomosaic option before exporting. In case you do not need all the images to be orthorectified you can disable them prior to the orthomosaic generation process.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Phogi

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Export Orthophotos in v 1.2
« Reply #5 on: October 31, 2016, 09:42:26 AM »
Hi Alexey,

Thank you, your answer helps! I find the reason and it fixed. Amazing, thanks!

Cheers,
Tim