orient = orient[argmax, :] cos = orient[0] sin = orient[1] #img = Batch2Image(batch) theta = np.arctan2(sin, cos) / np.pi * 180 theta = theta + centerAngle[argmax] / np.pi * 180 orientation_estimate = pydriver.common.functions.pyNormalizeAngle(np.radians(360 - info['ThetaRay'] - theta)) orientation_estimate = orientation_estimate / np.pi * 180 error = abs(orientation_estimate - info['Ry']) if error > 180: error = abs(360 - error) error_lst.append(error) Translation = Eval.GetTranslation(P, box_2D, orientation_estimate, dim) distance_lst.append(np.linalg.norm(Translation - info['Location'])) #Translation = Eval.GetTranslation(P, box_2D, info['Ry'], np.array(dimGT)) #print box_2D, info['Ry'], dimGT #print Translation #print info['ID'] #print info['Location'] #print error #print dimGT #print dim #sys.exit() #error = abs(theta - info['LocalAngle']) if i % 40 == 0: print '====' print info['Ry'] print info['ThetaRay']
#img = Batch2Image(batch) theta = np.arctan2(sin, cos) / np.pi * 180 theta = theta + centerAngle[argmax] / np.pi * 180 orientation_estimate = pydriver.common.functions.pyNormalizeAngle( np.radians(360 - info['ThetaRay'] - theta)) orientation_estimate = orientation_estimate / np.pi * 180 error = abs(orientation_estimate - info['Ry']) if error > 180: error = abs(360 - error) error_lst.append(np.cos(np.radians(error))) continue Translation = Eval.GetTranslation(P, box_2D, orientation_estimate, dim, init=np.array(info['Location'])) #Translation = Eval.GetTranslation(P, box_2D, info['Ry'], np.array(dimGT)) distance_lst.append(np.linalg.norm(Translation - info['Location'])) #print box_2D, info['Ry'], dimGT #print Translation #print info['ID'] #print info['Location'] #print error #print dimGT #print dim #sys.exit() #error = abs(theta - info['LocalAngle']) if i % 40 == 0: print '===='