Replies: 2 comments
-
I am developing my own software for a research dissertation. I have camera position coordinates in x,y,z,w format. How do I replicate these in Meshlab? I want to compare a cross-section taken from my software to one taken in Meshlab. To do so I need to replicate the camera position in Meshab. I know how to copy camera settings from Meshlab, and how to update the camera settings back to Meshlab. I just don't know what the fields in the camera settings mean (similar to question above). Any help appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
-
No. RotationMatrix is initialized to "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 " when meshlab is started, but the value will change if you orbit the camera clicking and dragging in the scene.
Currently, yes. This is a remain of old code that saved camera data in binary format instead of XML.
Your project uses two values to "Focal Length", perhaps different values per horizontal and vertical axis?. I would use the average value. The "Rotation Euler" contains same info than RotationMatrix, so can be ignored. Implementation details:The information of the ViewState will be written as a XML string to the clipboard. You can paste this screen into notepad or other text editor. The XML string has always this format <!DOCTYPE ViewState>
<project>
<VCGCamera
BinaryData="0"
TranslationVector="-1312.22 -1719.2 -2217.1 1"
RotationMatrix="0.690565 -0.0230493 -0.722903 0 -0.491698 0.71804 -0.492597 0 0.530427 0.69562 0.48452 0 0 0 0 1 "
PixelSizeMm="0.0369161 0.0369161"
ViewportPx="1479 921"
LensDistortion="0 0"
CameraType="0"
FocalMm="29.444607509282928"
CenterPx="739 460"
/>
<ViewSettings
FarPlane="8.5907297"
NearPlane="0.30310887"
TrackScale="0.001281216"
/>
</project>
The code that writes this XML string is GLArea::viewToText(), and the code that read the XML string and apply to the trackball is GLArea::loadViewFromViewStateFile(const QDomDocument &doc). As you see, the XML has two sections:
|
Beta Was this translation helpful? Give feedback.
-
MeshLab 2021.10 camera setting is in this format:
TranslationVector="1.36674 -3.59469 -40.0356 1" RotationMatrix="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 " CameraType="0" PixelSizeMm="0.0369161 0.0369161" CenterPx="484 387" ViewportPx="969 774" LensDistortion="0 0" BinaryData="0" FocalMm="24.74498"
TrackScale="0.068330936" FarPlane="6.0881977" NearPlane="0.30310887"
In my project, camera setting is given in this format:
#focal length
22977.3 22917.8
#resolution
3482 5218
#principal point
1741 2609
#distortion coeffs
0.641043 -22.3842 0 0
#camera transformation matrix 1
Rotation Euler X Y Z (degrees): 0.525084 -48.0539 0.176361
Translation : -119.556 3.04448 103.007
MATRIX :
0.668428 -0.0098941 -0.743711 -119.556
0.00205749 0.999932 -0.0114536 3.04448
0.743774 0.00612572 0.668403 103.007
0 0 0 1
Now I am having difficulty to convert from my camera setting to MeshLab's format.
What is MeshLab's PixelSizeMm, LensDistortion, BinaryData, FocalMm, TrackScale, FarPlane, NearPlane? How to convert from my format to MeshLab's for those variables?
Is RotationMatrix always fixed as "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ", and BinaryData always "0" in MeshLab, or at least that is the case for my application?
Thank you for any input!
Beta Was this translation helpful? Give feedback.
All reactions