A formula of official documentation and source code are different

wsz522008
Fri, 03 Dec 2021 09:01:43 +0000
Uncategorized

Hello,
I have a question about the formula in the official documentation.
You can find the formula in ink below:
https://docs.opencv.org/4.5.4/db/d58/group__calib3d__fisheye.html

This is the formula about distorted point coordinates conversion into pixel coordinates:

\begin{align*} x' &= (\theta_d / r) a ~~~ & ~~~ (1) \\ y' &= (\theta_d / r) b ~~~ & ~~~ (2) \\ u &= f_x (x' + \alpha y') + c_x ~~~ & ~~~ (3) \\ v &= f_y y' + c_y ~~~ & ~~~ (4) \\ \end{align*}

I found the source code in link below:

github.com

opencv/opencv/blob/4.x/modules/calib3d/src/fisheye.cpp

/*M///////////////////////////////////////////////////////////////////////////////////////
//
//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
//  By downloading, copying, installing or using the software you agree to this license.
//  If you do not agree to this license, do not download, install,
//  copy or use the software.
//
//
//                           License Agreement
//                For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//   * Redistribution's of source code must retain the above copyright notice,

This file has been truncated. show original

And this how the source code programed:

            double scale = (r == 0) ? 1.0 : theta_d / r;
            u = f[0]*x*scale + c[0];
            v = f[1]*y*scale + c[1];

My question is:
1.what is α in formula(3)?
2.Why the calculation of formula(3) is different from source code?

Thank you!

2 posts - 2 participants