Commit 0ceb9b6a authored by Andrey Kamaev's avatar Andrey Kamaev

Fixed division by zero case in SphericalProjector::mapForward

parent 017abbd9
......@@ -242,7 +242,8 @@ void SphericalProjector::mapForward(float x, float y, float &u, float &v)
float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];
u = scale * atan2f(x_, z_);
v = scale * (static_cast<float>(CV_PI) - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)));
float w = y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_);
v = scale * (static_cast<float>(CV_PI) - acosf(w == w ? w : 0));
}
......
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