Skip to content

Added fisheye::distortPoints with non-identity projection matrix#25943

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/fisheye_distrort_newk
Aug 5, 2024
Merged

Added fisheye::distortPoints with non-identity projection matrix#25943
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/fisheye_distrort_newk

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

The function covered the case, when the fisheye image was undistorted with new camera matrix found with estimateNewCameraMatrixForUndistortRectify.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov
Copy link
Copy Markdown
Contributor Author

@catree Could you take a look? What do you think?

@asmorkalov asmorkalov force-pushed the as/fisheye_distrort_newk branch from c2579e9 to 6984db0 Compare July 23, 2024 12:55
size_t n = undistorted.total();
const Vec2f* Xf = undistorted.ptr<Vec2f>();
const Vec2d* Xd = undistorted.ptr<Vec2d>();
Vec2d* normXd = normalized.ptr<Vec2d>();
Copy link
Copy Markdown
Contributor

@vpisarev vpisarev Jul 23, 2024

Choose a reason for hiding this comment

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

isn't double precision too heavy here? Shall we use the same data type as input points? Maybe we could add a helper function to do this {(x-cx)/fx, (y-cy)/fy} normalization?

@catree
Copy link
Copy Markdown
Contributor

catree commented Jul 23, 2024

@asmorkalov Sorry, I am not used to this specific aspect between K and Knew and distortion functionality.


Just some quick minor comments:

  • at some point it would be great to unify the convention between A and K notation for the camera intrinsic matrix
  • when using \f$cameramatrix{K}\f$ there are some rendering issue:
    image
  • the macro \f$\cameramatrix{A}\f$ displays instead:
    image

@asmorkalov asmorkalov force-pushed the as/fisheye_distrort_newk branch 4 times, most recently from 4e466f7 to b956b3b Compare August 1, 2024 07:16
@asmorkalov asmorkalov self-assigned this Aug 2, 2024
@asmorkalov asmorkalov force-pushed the as/fisheye_distrort_newk branch from b956b3b to 75fca7d Compare August 5, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants