From 2d527eaadd8af364dd2cf667080e48aa8340ea99 Mon Sep 17 00:00:00 2001 From: xulei2020 <“xulei83@huawei.com”> Date: Mon, 26 Oct 2020 14:38:21 +0800 Subject: [PATCH] fix crop param when x = 0 or y = 0 --- .../minddata/dataset/kernels/image/lite_cv/image_process.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc b/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc index 513a983fe6..9c35345db8 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc +++ b/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc @@ -441,7 +441,7 @@ static void CropInternal(const LiteMat &src, LiteMat &dst, int x, int y, int w, } bool Crop(const LiteMat &src, LiteMat &dst, int x, int y, int w, int h) { - if (x <= 0 || y <= 0 || w <= 0 || h <= 0) { + if (x < 0 || y < 0 || w <= 0 || h <= 0) { return false; } if (y + h > src.height_ || x + w > src.width_) {