1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Fix fluid resize operating with zero output size

This commit is contained in:
Smirnov Alexey
2020-05-06 16:43:06 +03:00
parent c722625f28
commit 3e3d4ad797
3 changed files with 26 additions and 6 deletions
@@ -2030,10 +2030,16 @@ GAPI_FLUID_KERNEL(GFluidResize, cv::gapi::core::GResize, true)
}
static void initScratch(const cv::GMatDesc& in,
cv::Size outSz, double /*fx*/, double /*fy*/, int /*interp*/,
cv::Size outSz, double fx, double fy, int /*interp*/,
cv::gapi::fluid::Buffer &scratch)
{
CV_Assert(in.depth == CV_8U && in.chan == 3);
GAPI_Assert(in.depth == CV_8U && in.chan == 3);
if (outSz.area() == 0)
{
outSz.width = static_cast<int>(round(in.size.width * fx));
outSz.height = static_cast<int>(round(in.size.height * fy));
}
cv::Size scratch_size{static_cast<int>(outSz.width * sizeof(ResizeUnit)), 1};