Commit 99fae814 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #9626 from T0ny0:fisheye_fix_

parents 9dea2962 2f0036c9
...@@ -474,6 +474,14 @@ void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArra ...@@ -474,6 +474,14 @@ void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArra
_w = i*iR(2, 1) + iR(2, 2); _w = i*iR(2, 1) + iR(2, 2);
for( int j = 0; j < size.width; ++j) for( int j = 0; j < size.width; ++j)
{
double u, v;
if( _w <= 0)
{
u = (_x > 0) ? -std::numeric_limits<double>::infinity() : std::numeric_limits<double>::infinity();
v = (_y > 0) ? -std::numeric_limits<double>::infinity() : std::numeric_limits<double>::infinity();
}
else
{ {
double x = _x/_w, y = _y/_w; double x = _x/_w, y = _y/_w;
...@@ -484,8 +492,9 @@ void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArra ...@@ -484,8 +492,9 @@ void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArra
double theta_d = theta * (1 + k[0]*theta2 + k[1]*theta4 + k[2]*theta6 + k[3]*theta8); double theta_d = theta * (1 + k[0]*theta2 + k[1]*theta4 + k[2]*theta6 + k[3]*theta8);
double scale = (r == 0) ? 1.0 : theta_d / r; double scale = (r == 0) ? 1.0 : theta_d / r;
double u = f[0]*x*scale + c[0]; u = f[0]*x*scale + c[0];
double v = f[1]*y*scale + c[1]; v = f[1]*y*scale + c[1];
}
if( m1type == CV_16SC2 ) if( m1type == CV_16SC2 )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment