ddovidovich commited on
Commit
32391ba
·
1 Parent(s): 5b3fee9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -20,20 +20,14 @@ def load_image(image_file):
20
  return img_np
21
 
22
  def convert_one_channel(img):
23
- #some images have 3 channels , although they are grayscale image
24
  if len(img.shape)>2:
25
  img= cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
26
- return img
27
- else:
28
- return img
29
 
30
  def convert_rgb(img):
31
- #some images have 3 channels , although they are grayscale image
32
  if len(img.shape)==2:
33
  img= cv2.cvtColor(img,cv2.COLOR_GRAY2RGB)
34
- return img
35
- else:
36
- return img
37
 
38
  def midpoint(ptA, ptB):
39
  return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5)
 
20
  return img_np
21
 
22
  def convert_one_channel(img):
 
23
  if len(img.shape)>2:
24
  img= cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
25
+ return img
 
 
26
 
27
  def convert_rgb(img):
 
28
  if len(img.shape)==2:
29
  img= cv2.cvtColor(img,cv2.COLOR_GRAY2RGB)
30
+ return img
 
 
31
 
32
  def midpoint(ptA, ptB):
33
  return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5)