Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for case when left.Tx() != 0 #286

Open
wants to merge 1 commit into
base: melodic
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions image_geometry/include/image_geometry/stereo_camera_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@ inline const cv::Matx44d& StereoCameraModel::reprojectionMatrix() const { return
inline double StereoCameraModel::baseline() const
{
/// @todo Currently assuming horizontal baseline
return -right_.Tx() / right_.fx();
return (left_.Tx() - right_.Tx()) / right_.fx();
}

inline double StereoCameraModel::getZ(double disparity) const
{
assert( initialized() );
return -right_.Tx() / (disparity - (left().cx() - right().cx()));
return (left_.Tx() - right_.Tx()) / (disparity - (left().cx() - right().cx()));
}

inline double StereoCameraModel::getDisparity(double Z) const
{
assert( initialized() );
return -right_.Tx() / Z + (left().cx() - right().cx()); ;
return (left_.Tx() - right_.Tx()) / Z + (left().cx() - right().cx()); ;
}

} //namespace image_geometry
Expand Down