diff --git a/mdata/crop.py b/mdata/crop.py index 93b5dfc..1cc3df3 100644 --- a/mdata/crop.py +++ b/mdata/crop.py @@ -33,7 +33,7 @@ def crop_Test(): try: img = cv2.imread(image, cv2.CV_LOAD_IMAGE_UNCHANGED) h, w = img.shape[:2] - left, upper = np.random.randint(w - 300), np.random.randint(h - 300) + left, upper = random.randint(0, w - 300), random.randint(0, h - 300) img_crop = img[upper:upper + 300, left:left + 300] cv2.imwrite(os.path.join(base_dir, category + '_crop_cv', name),img_crop) except Exception as e: -- libgit2 0.21.2