From the GUI if I go:
>Add Chunk > Add Photos > Select Photos > and Import.
Photos come in fine "Chunk 1 (12 Cameras) [R]" and the blue point in the view window shows up where the points reside.
If I run align photos it works fine and I can see the points in the view window.
I'm trying to to this very step from a script, it does not work.
The cameras come in however they now say "Chunk 1 (12 Cameras)" without the [R] what does this mean?
Also in the view window the blue points are missing, and only appear if I goto:
Ground Control > Import EXIF
If I then perform Align Photos on these it runs through it all but with no real result. Log file below.
What I'm I missing?
projection is WGS84
import PhotoScan
import glob
app = PhotoScan.Application()
doc = PhotoScan.app.document
hint = r"Select the JSON file that holds the chunk, images"
# create chunk
# SET COORDINATE SYSTEM
print("---Settings coordinate system...")
# init coordinate system object
CoordinateSystem = PhotoScan.CoordinateSystem()
if not(CoordinateSystem.init("EPSG::4326")):
app.messageBox("Coordinate system EPSG code not recognized!")
# define coordinate system in chunk
chunk = PhotoScan.Chunk()
chunk.label = "New_Chunk"
doc.chunks.add(chunk)
chunk.crs = CoordinateSystem
chunk.projection = CoordinateSystem
AerialImageFiles = glob.glob(r"G:\Seagate\2014-09-23_4\New folder\*.jpg")
# LOAD CAMERA CALIBRATION
print("---Loading camera calibration...")
# we need to open first image to define image size
cam = PhotoScan.Camera()
cam.open(AerialImageFiles[0])
# Load sensor calib
user_calib = PhotoScan.Calibration()
# build sensor object
sensor = PhotoScan.Sensor()
sensor.label = "MyCamera"
sensor.width = cam.width
sensor.height = cam.height
sensor.fixed = False
sensor.user_calib = user_calib
chunk.sensors.add(sensor)
# LOAD AERIAL IMAGES
print("---Loading images...")
# load each image
for FileName in AerialImageFiles:
#print("File: " + FileName)
cam = PhotoScan.Camera()
if not(cam.open(FileName)):
app.messageBox("Loading of image failed: " + FileName)
cam.label = cam.path.rsplit("/", 1)[1]
cam.sensor = sensor
chunk.cameras.add(cam)
# LOAD CAMERA ORIENTATIONS
print("---Loading initial photo orientations...")
PhotoScan.app.update()
---Settings coordinate system...
---Loading camera calibration...
---Loading images...
---Loading initial photo orientations...
Finished adding chunks.
Detecting points...
photo 1: 18391 points
photo 2: 18434 points
photo 3: 18144 points
photo 4: 17929 points
photo 5: 17945 points
photo 6: 18034 points
photo 7: 17942 points
photo 8: 18558 points
photo 9: 18618 points
photo 10: 19493 points
photo 11: 19844 points
photo 12: 20671 points
points detected in 17.863 sec
Selecting pairs...
56192 matches found in 0.781 sec
60 of 66 pairs selected in 0.024 sec
Matching points...
351726 matches found in 7.54 sec
setting point indices... 46083 done in 0.004 sec
removed 1288 multiple projections
removed 3 points
generated 46080 tie points, 3.27598 average projections
finished matching in 26.236 sec
Estimating scene structure...
group size: 12 photos
finished sfm in 0.807 seconds
Finished processing in 27.055 sec (exit code 1)
>>>