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:
@@ -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};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user