Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
VladyslavUsenko committed Jul 24, 2018
1 parent 9fb2679 commit ff62f3c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ cameraModels = { 'pinhole-radtan': acvb.DistortedPinhole,
'pinhole-fov': acvb.FovPinhole,
'omni-none': acvb.Omni,
'omni-radtan': acvb.DistortedOmni,
'uni-none': acvb.Unified,
'extuni-none': acvb.ExtendedUnified,
'eucm-none': acvb.ExtendedUnified,
'ds-none': acvb.DoubleSphere}

def signal_exit(signal, frame):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def setRosTopic(self, topic):
def checkIntrinsics(self, model, intrinsics):
cameraModels = ['pinhole',
'omni',
'eucm'
'ds']

if model not in cameraModels:
Expand Down Expand Up @@ -297,6 +298,22 @@ def checkIntrinsics(self, model, intrinsics):
if alpha_ds < 0 or alpha_ds >= 1:
self.raiseError("invalid alpha_ds of {} (0<=alpha<1)".format(alpha_ds) )

elif model == "eucm":

if len(intrinsics) != 6:
self.raiseError("invalid intrinsics for ds; should be [xi, alpha, fu, fv, pu, pv], but got {} parameters".format(len(intrinsics)))

alpha_eucm = intrinsics[0]
beta_eucm = intrinsics[1]
focalLength = intrinsics[2:4]
principalPoint = intrinsics[4:6]

if alpha_eucm < 0 or alpha_eucm >= 1:
self.raiseError("invalid alpha_eucm of {} (0<=alpha<1)".format(alpha_ds) )

if beta_eucm < 0:
self.raiseError("invalid beta_eucm of {} (beta>=0)".format(beta_eucm) )

else:
self.raiseError('internal error: invalid camera model {} (should have been checked before)'.format(model))

Expand Down Expand Up @@ -377,6 +394,11 @@ def printDetails(self, dest=sys.stdout):
focalLength = intrinsics[1:3]
principalPoint = intrinsics[3:5]

elif camera_model == 'eucm':
[alpha_eucm, beta_eucm] = intrinsics[0:2]
focalLength = intrinsics[2:4]
principalPoint = intrinsics[4:6]

elif camera_model == 'ds':
[xi_ds, alpha_ds] = intrinsics[0:2]
focalLength = intrinsics[2:4]
Expand All @@ -390,6 +412,9 @@ def printDetails(self, dest=sys.stdout):
print >> dest, " Principal point: {0}".format(principalPoint)
if camera_model == 'omni':
print >> dest, " Omni xi: {0}".format(xi_omni)
if camera_model == 'eucm':
print >> dest, " EUCM alpha: {0}".format(alpha_eucm)
print >> dest, " EUCM beta: {0}".format(beta_eucm)
if camera_model == 'ds':
print >> dest, " DS xi: {0}".format(xi_ds)
print >> dest, " DS alpha: {0}".format(alpha_ds)
Expand Down

0 comments on commit ff62f3c

Please sign in to comment.