Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -69,9 +69,9 @@ def analyze_image_features(image):
|
|
69 |
from skimage.feature import graycomatrix, graycoprops
|
70 |
|
71 |
# 计算GLCM
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
76 |
# 计算GLCM属性
|
77 |
features["texture_contrast"] = float(np.mean(graycoprops(glcm, 'contrast')[0]))
|
|
|
69 |
from skimage.feature import graycomatrix, graycoprops
|
70 |
|
71 |
# 计算GLCM
|
72 |
+
distances = [5]
|
73 |
+
angles = [0, np.pi/4, np.pi/2, 3*np.pi/4]
|
74 |
+
glcm = graycomatrix(gray, distances=distances, angles=angles, symmetric=True, normed=True)
|
75 |
|
76 |
# 计算GLCM属性
|
77 |
features["texture_contrast"] = float(np.mean(graycoprops(glcm, 'contrast')[0]))
|