Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: saduka on April 05, 2019, 01:46:44 PM
-
Halo
I tried to import a part of calibration by a dict from laboratory precalibration. But when I double check it with graphic interface, I found all parameters are set. Then I tried remove sensor.fixed=True, no parameters are fixed. Isn't that sensor.fixed_params alone can determine the fixed parameters?
for s,sc in zip(doc.chunk.sensors, cali):
calib=Metashape.Calibration()
sc=cali[sc]
intrinsic_p=sc["intrinsic_p"]
calib.f=intrinsic_p["f"]
calib.b1=intrinsic_p["b1"]
calib.b2=intrinsic_p["b2"]
calib.cx=intrinsic_p["cx"]
calib.cy=intrinsic_p["cy"]
distortion_p=sc["distortion_p"]
calib.k1=distortion_p["k1"]
calib.k2=distortion_p["k2"]
calib.k3=distortion_p["k3"]
calib.p1=distortion_p["p1"]
calib.p2=distortion_p["p2"]
s.user_calib=calib
s.fixed_params=["f","cx","cy","k1","k2","k3","p1","p2"]
s.fixed=True
doc.save()
-
Hello saduka,
Using sensor.fixed call will fix or unfix all parameters at once.
Proper way of fixing the certain parameters would be:
s.fixed_params=["F","Cx","Cy","K1","K2","K3","P1","P2"]
Note that values here are case sensitive.
-
Does this include extrinsics?