1
General / Re: Cameras positions and EO for multi-cameras layouts
« on: September 06, 2023, 05:23:45 PM »
Thank you JMR! I will try very soon this workflow and will let you know if it solve this out.
Best Regards
Best Regards
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.
<?xml version="1.0" encoding="UTF-8"?>
<calibration>
<projection>frame</projection>
<width>10336</width>
<height>7788</height>
<f>15963.115384616023</f>
<cx>-1.3333000000002044</cx>
<cy>-4.7148000000001868</cy>
<date>2021-09-22T08:40:25Z</date>
</calibration>
$CAMERA
$TYPE : unknown
$DATE : 10:43:20 22/09/2021
$BRAND : Custom
$KIND : CCDFrame
$CCD_INTERIOR_ORIENTATION :
299.114 -0 5166.17
0.0000000000 -299.114 3888.79
$CCD_COLUMNS : 10336
$CCD_ROWS : 7788
$PIXEL_REFERENCE : CenterTopLeft
$FOCAL_LENGTH : 53.3681
$PRINCIPAL_POINT_PPA : 0.000000 0.000000
$DISTORTION_TYPE : Polynomial
$RADIAL_COEFFS :
0 -7.25205e-19 6.26401e-22 7.52744e-24
-1.34583e-26 0 0 0
$DECENTRE_COEFFS :
3.46799e-19 1.68792e-19 0 0
$GPS_ANTENNA_OFFSET : 0.000000 0.000000 0.000000
$CAMERA_MOUNT_ROTATION : 0.000000
import Metashape
chunk = Metashape.app.document.chunk
crs = chunk.crs
T = chunk.transform.matrix
origin = None
for camera in chunk.cameras:
if not camera.type == Metashape.Camera.Type.Regular:
continue
if not camera.reference.location:
continue
if not camera.reference.rotation:
continue
pos = crs.unproject(camera.reference.location)
m = crs.localframe(pos)
rot = Metashape.utils.opk2mat(camera.reference.rotation) * Metashape.Matrix().Diag([1, -1, -1])
R = Metashape.Matrix().Translation(pos) * Metashape.Matrix().Rotation(m.rotation().t() * rot)
if not origin:
origin = pos
chunk.transform.matrix = Metashape.Matrix().Translation(origin)
T = chunk.transform.matrix
camera.transform = T.inv() * R
chunk.updateTransform()
<Photo>
<Id>55610</Id>
<ImagePath>D:/IMAGES/Left/09_137_124824_203_Left.jpg</ImagePath>
<Component>1</Component>
<Pose>
<Rotation>
<Omega>-44.2294659638294</Omega>
<Phi>-8.98957986763937</Phi>
<Kappa>-81.0641551920933</Kappa>
<Accurate>true</Accurate>
</Rotation>
<Center>
<x>705884.750718091</x>
<y>7061439.17630715</y>
<z>773.699714511843</z>
<Accurate>true</Accurate>
</Center>
<Metadata>
<SRSId>0</SRSId>
<Rotation>
<Omega>135.77379</Omega>
<Phi>8.97211999999996</Phi>
<Kappa>81.04876</Kappa>
<Accurate>true</Accurate>
</Rotation>
<Center>
<x>505872.457</x>
<y>5610891.335</y>
<z>773.346</z>
<Accurate>true</Accurate>
</Center>
</Metadata>
</Pose>
<NearDepth>587.593386139714</NearDepth>
<MedianDepth>1131.75971060136</MedianDepth>
<FarDepth>1382.12451767816</FarDepth>
<ExifData />
09_137_124824_203_Left.jpg
x : 705884.750718
y : 7061439.176307
z : 817.664289
omega : -179.987093
phi : 0.012384
kappa : 0.000929