Browse Source

fix crop param when x = 0 or y = 0

tags/v1.1.0
xulei2020 5 years ago
parent
commit
2d527eaadd
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc

+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc View File

@@ -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_) {


Loading…
Cancel
Save