Parcourir la source

Merge branch 'release/v0.2.7'

Jérôme BUISINE il y a 3 ans
Parent
commit
1dc44a97fe
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      data_attributes.py

+ 6 - 0
data_attributes.py

@@ -104,6 +104,12 @@ def get_image_features(data_type, block):
         lab_img = transform.get_LAB_L(block)
         arr = np.array(lab_img)
 
+        # add sobel complexity (kernel size of 3)
+        sobelx = cv2.Sobel(arr, cv2.CV_64F, 1, 0, ksize=3)
+        sobely = cv2.Sobel(arr, cv2.CV_64F, 0, 1,ksize=3)
+
+        sobel_mag = np.array(np.hypot(sobelx, sobely), 'uint8')  # magnitude
+
         # add sobel complexity (kernel size of 5)
         sobelx = cv2.Sobel(arr, cv2.CV_64F, 1, 0, ksize=5)
         sobely = cv2.Sobel(arr, cv2.CV_64F, 0, 1,ksize=5)