Kazeo57 commited on
Commit
6870a99
·
verified ·
1 Parent(s): a4931a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -1,9 +1,9 @@
1
  import gradio as gr
2
  from PIL import Image
3
  import numpy as np
4
- #import cv2
5
  import matplotlib.pyplot as plt
6
- import sys
7
  from PIL import Image,ImageFilter
8
  # Fonctions de traitement d'image
9
  def load_image(image):
@@ -35,10 +35,10 @@ def hister(image):
35
  hist=cv2.calcHist([image],[0],None,[256],[0,256])
36
  #cv2.imshow('Gray Scale Histogram',image)
37
  #cv2.waitkey(1)
38
-
39
  #plt.plot(hist)
40
-
41
-
42
  fig, ax = plt.subplots()
43
  ax.plot(hist)
44
 
@@ -69,12 +69,12 @@ def dilate(image):
69
 
70
 
71
 
72
-
73
 
74
  # Ajoutez d'autres fonctions pour l'histogramme, le filtrage, Sobel, etc.
75
 
76
  # Interface Gradio
77
- def image_processing(image, operation, threshold=128, width=100, height=100, angle=0,radius=9):
78
  if operation == "Négatif":
79
  return apply_negative(image)
80
  elif operation == "Binarisation":
 
1
  import gradio as gr
2
  from PIL import Image
3
  import numpy as np
4
+ import cv2
5
  import matplotlib.pyplot as plt
6
+ import sys
7
  from PIL import Image,ImageFilter
8
  # Fonctions de traitement d'image
9
  def load_image(image):
 
35
  hist=cv2.calcHist([image],[0],None,[256],[0,256])
36
  #cv2.imshow('Gray Scale Histogram',image)
37
  #cv2.waitkey(1)
38
+
39
  #plt.plot(hist)
40
+
41
+
42
  fig, ax = plt.subplots()
43
  ax.plot(hist)
44
 
 
69
 
70
 
71
 
72
+
73
 
74
  # Ajoutez d'autres fonctions pour l'histogramme, le filtrage, Sobel, etc.
75
 
76
  # Interface Gradio
77
+ def image_processing(image, operation, threshold=128, width=100, height=100, angle=45,radius=9):
78
  if operation == "Négatif":
79
  return apply_negative(image)
80
  elif operation == "Binarisation":