skanti/Scan2CAD-Annotation-Webapp

CADs and scans can not be aligned

Opened this issue · 0 comments

Hi,

Thank you for sharing this annotation app! I relabeled poses of several scenes and CADs that were given in Scan2CAD dataset and read the data by pymongo, getting the data whose form was as same as the Scan2CAD dataset. But when I transform the CAD models and scans to world coordinate system by their poses respectively, they cannot be aligned. I find that the scan2world rotation matrix in Scan2CAD is:
[[ 0 1 0]
[-1 0 0]
[ 0 0 1]]
while the one in gained data is:
[[ 1 0 0]
[ 0 0 1]
[ 0 -1 0]]
I change the rotation matrix to the one Scan2CAD uses then I find the CAD models are the reflection of their correspondence instances in Scans as shown in the following:
2021-12-27_13-59
I change the rotation matrix of CADS with a reflection matrix like this:
cad2world = from_trs_to_M(item['trs']) cad2world[:3, :3] = np.asarray([[1,0,0], [0,-1,0], [0,0,1]]).dot(cad2world[:3,:3])
Those CADs are fliped like the following, but they still can not be aligned very well. But during annotation, they are aligned very well.
2021-12-27_14-00

I will very appreciate if you could give me some hints about how to fix it. Thank you!