ddovidovich commited on
Commit
c793716
·
1 Parent(s): 882d2a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -63,7 +63,7 @@ def CCA_Analysis(orig_image,predict_image,erode_iteration,open_iteration):
63
  cnts = cnts[0]
64
  c_area = cv2.contourArea(cnts)
65
  # threshhold for tooth count
66
- if c_area>1000:
67
  count2+=1
68
 
69
  (x,y),radius = cv2.minEnclosingCircle(cnts)
@@ -167,6 +167,11 @@ if image_file is not None:
167
  img_dc=convert_one_channel(img)
168
  decay_mask = detect_decays_static_th(img_dc, predict1)
169
 
 
 
 
 
 
170
  mask = np.uint8(predict1 * 255)
171
  _, mask = cv2.threshold(mask, thresh=255/2, maxval=255, type=cv2.THRESH_BINARY)
172
  cnts, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
 
63
  cnts = cnts[0]
64
  c_area = cv2.contourArea(cnts)
65
  # threshhold for tooth count
66
+ if c_area>2000:
67
  count2+=1
68
 
69
  (x,y),radius = cv2.minEnclosingCircle(cnts)
 
167
  img_dc=convert_one_channel(img)
168
  decay_mask = detect_decays_static_th(img_dc, predict1)
169
 
170
+
171
+ predict1 = cv2.cvtColor(predict1,cv2.COLOR_GRAY2RGB)
172
+ img_dc = cv2.cvtColor(img_dc,cv2.COLOR_GRAY2RGB)
173
+ decay_mask = cv2.cvtColor(decay_mask,cv2.COLOR_GRAY2RGB)
174
+
175
  mask = np.uint8(predict1 * 255)
176
  _, mask = cv2.threshold(mask, thresh=255/2, maxval=255, type=cv2.THRESH_BINARY)
177
  cnts, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)