Skip to content

Add fisheye calibration, getK, getRes, and zynqGrabber building option#222

Open
JiahangWu wants to merge 2 commits intomainfrom
feat/fisheye-calib
Open

Add fisheye calibration, getK, getRes, and zynqGrabber building option#222
JiahangWu wants to merge 2 commits intomainfrom
feat/fisheye-calib

Conversation

@JiahangWu
Copy link
Copy Markdown
Contributor

Modifications

  1. Create the functions on undistortion and rectification for quidistant distortion (cv::fisheye). This requires the yarp calibration file to add a new parameter distortion_model: b'radtan' or equidistant.
  2. Add the way to get the camera's intrinsic parameters.
  3. Add the way to get the camera's resolution.
  4. Add an option for building zynqGrabber.

@JiahangWu JiahangWu requested a review from arrenglover July 1, 2025 12:09
Comment thread CMakeLists.txt
set(prophesee_core_FOUND OFF)
endif()

option(BUILD_ZYNQGRABBER "Build the zynqGrabber module" ON)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why building zynqGrabber is related to IPT code? did we already discuss this?

Copy link
Copy Markdown
Contributor Author

@JiahangWu JiahangWu Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for confusing you. Building zynqGrabber is not related to IPT. But it is related to building the event-driven on MAC. I didn't commit it before. I am going to commit it in another pull request.

cam_matrix[cam].at<double>(2, 2) = 1.0;
cam_matrix[cam].at<double>(0, 2) = parameters.find("cx").asFloat64();
cam_matrix[cam].at<double>(1, 2) = parameters.find("cy").asFloat64();
if(cam == 0) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if no distortion model is provided?

projection[cam], size_shared, CV_32FC2,
mat_reverse_map[cam], cv::noArray());

if(distortion_model == "b'radtan'") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it common knowledge that "b'radtan'" means pinhole, while "equidistant" means fisheye? Can we make sure this is more intuitive?

cv::initUndistortRectifyMap(cam_matrix[cam], dist_coeff[cam], rotation[cam],
projection[cam], size_shared, CV_32FC2,
mat_reverse_map[cam], cv::noArray());
} else if (distortion_model == "equidistant") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if no distortion model is provided? or if there is a spelling mistake in the distortion model? seg fault?

return Q;
}

const cv::Mat& vIPT::getK(int cam) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if cam = 2. we would return cam[0]? it could introduce error.
what about
if( cam == 0 || cam == 1 ) return cam_matrix[cam]
else return empty matrix?

dist_coeff[1], size_cam[0], stereo_rotation, stereo_translation,
rotation[0], rotation[1], projection[0],projection[1], Q,
CALIB_ZERO_DISPARITY, 1, size_shared);
if(distortion_model == "b'radtan'") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here - what happens if not provided or provided incorrectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants