Sagar Bharadwaj commited on
Commit
2969573
·
1 Parent(s): 91d2705

Updated Utils

Browse files
Files changed (1) hide show
  1. colorbynumber/utils.py +3 -1
colorbynumber/utils.py CHANGED
@@ -20,5 +20,7 @@ def draw_contours(contour, image_width, image_height):
20
  cv.drawContours(contours_image, [contour], 0, (0,255,0), 4)
21
  show_image(contours_image, cmap = 'gray')
22
 
23
- def save_image(image, filename):
 
 
24
  cv.imwrite(filename, image)
 
20
  cv.drawContours(contours_image, [contour], 0, (0,255,0), 4)
21
  show_image(contours_image, cmap = 'gray')
22
 
23
+ def save_image(image, filename, convert_to_bgr = True):
24
+ if convert_to_bgr:
25
+ image = cv.cvtColor(image.astype(np.uint8), cv.COLOR_RGB2BGR)
26
  cv.imwrite(filename, image)