mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 06:53:50 +08:00
bypass macro
This commit is contained in:
parent
7f14a278a7
commit
809bbb472b
@ -150,10 +150,10 @@ Rect RotationWarperBase<P>::warpRoi(Size src_size, InputArray K, InputArray R)
|
||||
template <class P>
|
||||
void RotationWarperBase<P>::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br)
|
||||
{
|
||||
float tl_uf = std::numeric_limits<float>::max();
|
||||
float tl_vf = std::numeric_limits<float>::max();
|
||||
float br_uf = -std::numeric_limits<float>::max();
|
||||
float br_vf = -std::numeric_limits<float>::max();
|
||||
float tl_uf = (std::numeric_limits<float>::max)();
|
||||
float tl_vf = (std::numeric_limits<float>::max)();
|
||||
float br_uf = -(std::numeric_limits<float>::max)();
|
||||
float br_vf = -(std::numeric_limits<float>::max)();
|
||||
|
||||
float u, v;
|
||||
for (int y = 0; y < src_size.height; ++y)
|
||||
@ -161,8 +161,8 @@ void RotationWarperBase<P>::detectResultRoi(Size src_size, Point &dst_tl, Point
|
||||
for (int x = 0; x < src_size.width; ++x)
|
||||
{
|
||||
projector_.mapForward(static_cast<float>(x), static_cast<float>(y), u, v);
|
||||
tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);
|
||||
br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);
|
||||
tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);
|
||||
br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,31 +176,31 @@ void RotationWarperBase<P>::detectResultRoi(Size src_size, Point &dst_tl, Point
|
||||
template <class P>
|
||||
void RotationWarperBase<P>::detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br)
|
||||
{
|
||||
float tl_uf = std::numeric_limits<float>::max();
|
||||
float tl_vf = std::numeric_limits<float>::max();
|
||||
float br_uf = -std::numeric_limits<float>::max();
|
||||
float br_vf = -std::numeric_limits<float>::max();
|
||||
float tl_uf = (std::numeric_limits<float>::max)();
|
||||
float tl_vf = (std::numeric_limits<float>::max)();
|
||||
float br_uf = -(std::numeric_limits<float>::max)();
|
||||
float br_vf = -(std::numeric_limits<float>::max)();
|
||||
|
||||
float u, v;
|
||||
for (float x = 0; x < src_size.width; ++x)
|
||||
{
|
||||
projector_.mapForward(static_cast<float>(x), 0, u, v);
|
||||
tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);
|
||||
br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);
|
||||
tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);
|
||||
br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);
|
||||
|
||||
projector_.mapForward(static_cast<float>(x), static_cast<float>(src_size.height - 1), u, v);
|
||||
tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);
|
||||
br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);
|
||||
tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);
|
||||
br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);
|
||||
}
|
||||
for (int y = 0; y < src_size.height; ++y)
|
||||
{
|
||||
projector_.mapForward(0, static_cast<float>(y), u, v);
|
||||
tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);
|
||||
br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);
|
||||
tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);
|
||||
br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);
|
||||
|
||||
projector_.mapForward(static_cast<float>(src_size.width - 1), static_cast<float>(y), u, v);
|
||||
tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);
|
||||
br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);
|
||||
tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);
|
||||
br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);
|
||||
}
|
||||
|
||||
dst_tl.x = static_cast<int>(tl_uf);
|
||||
|
Loading…
Reference in New Issue
Block a user