Forum

Author Topic: Camera Export and Import in Multiframe  (Read 5342 times)

shirofukurou

  • Newbie
  • *
  • Posts: 6
    • View Profile
Camera Export and Import in Multiframe
« on: October 05, 2014, 09:36:09 AM »
Hi All,

I've just been starting a new multiframe project and I wanted to export the cameras so I could use the calibration elsewhere. I was using the recommended export and import functions:

# export
    chunk.matchPhotos(accuracy='high', preselection='disabled', filter_mask=False, point_limit=40000)
    chunk.alignPhotos()
    chunk.exportCameras('Cameras.xml')

# import
    chunk.importCameras('Cameras.xml')
    chunk.matchPhotos(accuracy='high', preselection='disabled', filter_mask=False, point_limit=40000)
    chunk.buildPoints()

And it just wasn't working. However I finally fixed the problem. I wasn't explicitly labelling the cameras so they were getting named after the first image file I loaded and that meant that all my cameras were called image0000 since that was the name of the first image in each folder. The fix is to explicitly label the cameras when you add the images.

# this code labels the cameras after the folder name
    for iframe in range(0, nframes):
        for icamera in range(0, ncameras):
            if iframe == 0:
                chunk.cameras.add(os.path.join(folders[icamera], image_files[icamera][iframe]))
                chunk.cameras[icamera].label = folders[icamera]
            else:
                f = PhotoScan.Frame()
                f.open(os.path.join(folders[icamera], image_files[icamera][iframe]), 0)
                chunk.cameras[icamera].frames.append(f)

Another thing I noticed is that the whole thing tends to crash if I use the doc=PhotoScan.app.document all the time and that it is much more stable if I create a new document using doc = PhotoScan.Document(). Of course I can't see what is going on then but that doesn't really matter for batch processing.

Anyway it working brilliantly now. Every time I think I've found something missing, there is a way to do it that works fine once I discover what it is.

Cheers
Bill

joy9393

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Camera Export and Import in Multiframe
« Reply #1 on: October 25, 2014, 07:51:08 PM »
And it just wasn't working. However I finally fixed the problem. I wasn't explicitly labelling the cameras so they were getting named after the first image file I loaded and that meant that all my cameras were called image0000 since that was the name of the first image in each folder. The fix is to explicitly label the cameras when you add the images.
Download high quality citrix training exam - braindumps.com       dumps to prepare and pass Intel