Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AnttiV

Pages: [1]
1
Python and Java API / Re: Fisheye Calibration
« on: June 05, 2017, 07:53:18 PM »
Thanks for your help. This script worked!
Code: [Select]
sensor = c.sensors[0]
sensor.width = 2048
sensor.height = 2048
sensor.type = PhotoScan.Sensor.Type.Fisheye
cal = sensor.calibration
cal.cx = eye.m_metadata.m_center[0]
cal.cy = eye.m_metadata.m_center[1]
cal.f = eye.m_metadata.m_focal
cal.k1 = eye.m_metadata.m_distortions[0]
cal.k2 = eye.m_metadata.m_distortions[1]
cal.k3 = eye.m_metadata.m_distortions[2]
cal.k4 = eye.m_metadata.m_distortions[3]
sensor.user_calib = cal
sensor.fixed = True

2
Python and Java API / Re: Fisheye Calibration
« on: June 05, 2017, 06:29:56 PM »
Thanks! Almost there, but still one issue. Script doesn't set camera type to fisheye?

3
Python and Java API / Re: Fisheye Calibration
« on: June 05, 2017, 02:28:51 PM »
I was thinking as well that I need to use user_calib for this, but I get none when I try get it.

Code: [Select]
for eye in self.m_fisheyes:
c = PhotoScan.app.document.addChunk()
c.label = eye.m_name

for p in eye.m_files:
c.addPhotos([p])

sensor = c.sensors[0]
sensor.width = 2048
sensor.height = 2048
sensor.calibration.type = PhotoScan.Sensor.Type.Fisheye
cal = sensor.user_calib
cal.cx = eye.m_metadata.m_center[0]
cal.cy = eye.m_metadata.m_center[1]
cal.f = eye.m_metadata.m_focal
cal.k1 = eye.m_metadata.m_distortions[0]
cal.k2 = eye.m_metadata.m_distortions[1]
cal.k3 = eye.m_metadata.m_distortions[2]
cal.k4 = eye.m_metadata.m_distortions[3]
sensor.user_calib = cal

This code gives me the error which I attached to this post.


4
Python and Java API / Fisheye Calibration [solved]
« on: June 05, 2017, 12:44:04 PM »
I'm trying to calibrate images with our metadata coming from the camera with following script.
Code: [Select]
for eye in self.m_fisheyes:
c = PhotoScan.app.document.addChunk()
c.label = eye.m_name

for p in eye.m_files:
c.addPhotos([p])

sensor = c.sensors[0]
sensor.width = 2048
sensor.height = 2048
sensor.calibration.type = PhotoScan.Sensor.Type.Fisheye
cal = sensor.calibration
cal.cx = eye.m_metadata.m_center[0]
cal.cy = eye.m_metadata.m_center[1]
cal.f = eye.m_metadata.m_focal
cal.k1 = eye.m_metadata.m_distortions[0]
cal.k2 = eye.m_metadata.m_distortions[1]
cal.k3 = eye.m_metadata.m_distortions[2]
cal.k4 = eye.m_metadata.m_distortions[3]

I get chunks and images there nicely, but when I check those calibrations with Tools->Camera Calibration nothing have gone in. What am I doing wrong?

Pages: [1]