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 opencv init intrinsic calib #27
Conversation
src/Camera.cpp
Outdated
bool valid_board = true; | ||
if (distortion_model_ == 1) { | ||
float thresh_border_x = im_cols_ / 20; | ||
float thresh_border_y = im_rows_ / 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const float . Also why do we need to divide img size by this number 20?
src/Camera.cpp
Outdated
float thresh_border_x = im_cols_ / 20; | ||
float thresh_border_y = im_rows_ / 20; | ||
for (int i = 0; i < board_obs_temp->pts_2d_.size(); i++) { | ||
float pt_x = board_obs_temp->pts_2d_[i].x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const float&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I am not sure where you would like to set a const float&
src/Camera.hpp
Outdated
@@ -44,6 +44,9 @@ class Camera final { | |||
// camera index | |||
int cam_idx_; | |||
|
|||
// fisheye border margin to exclude invalid boards during initialization | |||
const float border_marging = 0.05; // border margin tolerance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr float border_margin_ = 0.05f
. Also it could be inside private.
src/Camera.cpp
Outdated
const float thresh_border_x = float(im_cols_) * border_marging; | ||
const float thresh_border_y = float(im_rows_) * border_marging; | ||
for (int i = 0; i < board_obs->pts_2d_.size(); i++) { | ||
float pt_x = board_obs->pts_2d_[i].x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float pt_x
-> const float& pt_x
Fix the bug of OpenCV fisheye camera calibration error when points are too close to image's borders.
Notes: