Forum

Author Topic: Question on setting user calibration  (Read 9513 times)

sarko

  • Newbie
  • *
  • Posts: 23
    • View Profile
Question on setting user calibration
« on: September 06, 2012, 12:37:16 AM »
I am taking my first stab at using the python API in Photoscan.   I have been able to create a document, load photos into a chunk and align/create geometry.  However, I want to update the camera calibration information and have been unable to get it to work.  Relevant snippet of code is below:


Code: [Select]
for i in range(0,numFiles):
    p = PhotoScan.Photo()
    testFile = data[i].rstrip()
    p.open(testFile)
    cenX = p.width/2
    cenY = p.height/2
    p.user_calib = ps.Calibration(cx=cenX,cy=cenY,fx=12180.0,fy=12180.0)
    newChunk.photos.add(p)
   

I'm trying to use p.user_calib to set the calibration, but it sets all values to zero when I do what's above. Any thoughts???


Thank you. 

sarko

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Question on setting user calibration
« Reply #1 on: September 06, 2012, 01:49:46 AM »
I figured it out.  Working now, but I can't filter by mask when I do my align for some reason.  Still working on that one if anyone has ideas.


an198317

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Question on setting user calibration
« Reply #2 on: June 04, 2013, 08:16:52 PM »
Hi sarko,

I am interested in this user_calib argument as well. I noticed you only used cenX, cenY, and focal length. Which kind of other information we can put into user_calib? Can we put camera position XYZ and orientation angles in user_calib as well?

Thanks,
Nan

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15177
    • View Profile
Re: Question on setting user calibration
« Reply #3 on: June 12, 2013, 01:37:18 PM »
Hello Nan,

User_calib contain only calibration data for camera (image width and height, focal length, principal point distance, radial and tangential distortion coefficients, skew).

To input camera coordinates you can use chunk.ground_control, in case the information is in real world coordinate system or use photo.transform matrix, but please note that in latter case it should be absolutely precise information.
Best regards,
Alexey Pasumansky,
Agisoft LLC