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 - apurv.ashish

Pages: [1]
1
General / Camera Pose Estimation from XML file
« on: January 21, 2018, 02:32:45 PM »
Hello,

I would be sorry if this question has already been asked, but honestly, I didn't find anything related in archive. I am trying to estimate the camera pose from the Camera.xml file.  But I have confusion regarding the matrix in the xml file. First there is indidvidual camera transformation matrix as  shown below

Code: [Select]
<camera id="0" label="0000.png" sensor_id="0" enabled="1">
        <transform>8.9348843569377312e-01 -4.4368008724910278e-02 -4.4688913063899943e-01 1.9766637898022192e+00 -1.6367709900043652e-02 -9.9766380613968031e-01 6.6325168612786145e-02 -2.3291474933571729e-01 -4.4878782665545019e-01 -5.1946219503182171e-02 -8.9212727619169052e-01 -2.7808099942816000e-01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+00</transform>
      </camera>
      <camera id="1" label="0001.png" sensor_id="0" enabled="1">
        <transform>9.5153874076534684e-01 -3.0227983301940098e-02 -3.0603969325594976e-01 1.2625875911232747e+00 -4.7417234898363692e-03 -9.9648131819942376e-01 8.3680932941051403e-02 -2.0974993367605752e-01 -3.0749234280066901e-01 -7.8174493954463423e-02 -9.4833391145414569e-01 -9.5240781752597148e-02 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+00</transform>
      </camera>
      <camera id="2" label="0002.png" sensor_id="0" enabled="1">
        <transform>9.7916412038711897e-01 -3.3345267837347238e-02 -2.0031404958058824e-01 6.4252028723432442e-01 -2.2792511233811846e-02 -9.9823943913233903e-01 5.4758776396207326e-02 -2.0937419899366866e-01 -2.0178733056903086e-01 -4.9052168898111398e-02 -9.7820026474552535e-01 -1.3275424772011729e-01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+00</transform>
      </camera>

My questions are:

1. Should I multiply the Rotation matrix with skew, if there is any skew.
2. In which coordinate system the camera pose have been estimated, is it the center of image.
3. What are the last part of xml file represent, shown below :

Code: [Select]
<reference>LOCAL_CS["Local Coordinates (m)",LOCAL_DATUM["Local Datum",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]</reference>
    <region>
      <center>-4.4246941072257195e-01 1.9355219443093608e-01 -4.1723836479298271e+00</center>
      <size>6.3404785777131707e+00 4.2286109651128445e+00 1.5416034723321594e+00</size>
      <R>-9.4500716140856811e-01 -1.7944434163367950e-02 -3.2655698150411211e-01 -5.3985210360659480e-02 -9.7623781311151414e-01 2.0986979133158748e-01 -3.2256326813330088e-01 2.1595770311291346e-01 9.2158299057510762e-01</R>
    </region>
 


Best Regards
Apurv.

2
General / Re: Camera Pose Estimation
« on: January 11, 2018, 09:04:46 PM »
Hi, thanks for the code and sorry for the lots of questions. Below is the code I am using to call the reprojection error function error you provided, however, when I run the scripts, it throws an Error: Can't open file: No such file or directory (2). I have checked and the project file is there only hence, I am unable to understand this error.

Code: [Select]
def main():

doc = PhotoScan.app.document

doc.open("/home/apurv/Desktop/HTCV-PJA/fountain dense_orignal/fountain_dense/pj9.psz")

chunk = doc.chunk

total_error, ind_error = calc_reprojection(chunk)

print('%f'%total_error)


2. The second issue I have having is with camera pose estimation from the Transformation matrix in the camera.xml.
I am using below relation to obtain the camera pose:
                               
                                                              C = -(RT)*T
where R and T are the rotational(3x3 matrix) and translation(3x1) vector. But, there is a huge difference in the ground truth and pose esitmation. For instance, Camera 0 has follow ground truth :
                                                         [-3.48  -1.196 -9.845]
estimation :
                                                          [-1.199 -0.017  0.427]
The difference increases even more for the 10th camera in the reconstruction:
ground truth :                                  [ 19.671   0.222  11.429]
estimation :                                      [ 3.602  0.115  3.388]

My question is if the transformation matrix is represented differently in photscan XML file or I have doing something incorrectly in reconstruction steps.

Best Regards
Apurv.

3
General / Re: Camera Pose Estimation
« on: January 11, 2018, 04:32:53 PM »
Hi,

Thanks for the reply. I was looking for a way to parse and calculate camera pose. However, I have created one which parses the camera.xml and extracts the camera pose. Hope, someone else will find it useful.

However, I need help in calculating re projection error. I used the script you provoded on the thread :

http://www.agisoft.com/forum/index.php?topic=3189.0

However, it returns error: Error =  AttributeError: matrix * vector: vector length does not match matrix row size minus 1.

Is there any change due to updates. What changes are required.

Best Regards
Apurv.

4
General / Camera Pose Estimation
« on: January 07, 2018, 10:52:43 PM »
Hello,
I am working on the project to compare the camera pose estimation with the ground truth. The camera.xml, provides [r,t] matrix for all the cameras used. Does photoscan professional also has a feature which outputs the camera pose in world coordinate and its rotation.
Additionally, I am having problems in parsing the camera.xml file to extract transform matrix, is there an existing python script for parsing the XML file.

Best Regards.

Pages: [1]