From 05cbdcd9c4f28988688583d2214689297afba6f2 Mon Sep 17 00:00:00 2001 From: Chunk Date: Sun, 19 Apr 2015 18:02:34 +0800 Subject: [PATCH] staged. --- mdata/crop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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