Parcourir la source

Merge branch 'release/v0.3.0'

Jérôme BUISINE il y a 4 ans
Parent
commit
6b8f28e9e2
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      classes/Transformation.py

+ 4 - 4
classes/Transformation.py

@@ -55,13 +55,13 @@ class Transformation():
             data = np.array(img_array)
 
         if self.transformation == 'min_diff_filter':
-            w_size, h_size = list(map(int, self.param.split(',')))
+            w_size, h_size, stride = list(map(int, self.param.split(',')))
             h, w = list(map(int, self.size.split(',')))
 
             # bilateral with window of size (`w_size`, `h_size`)
             lab_img = transform.get_LAB_L(img)
     
-            img_filter = convolution.convolution2D(lab_img, kernels.min_bilateral_diff, (w_size, h_size))
+            img_filter = convolution.convolution2D(lab_img, kernels.min_bilateral_diff, (w_size, h_size), stride)
             diff_array = np.array(img_filter*255, 'uint8')
             diff_img = Image.fromarray(diff_array)
             diff_img.thumbnail((h, w))
@@ -94,9 +94,9 @@ class Transformation():
             path = os.path.join(path, 'N' + str(n_components)) + '_S_' + str(w) + '_' + str(h)
 
         if self.transformation == 'min_diff_filter':
-            w_size, h_size = list(map(int, self.param.split(',')))
+            w_size, h_size, stride = list(map(int, self.param.split(',')))
             w, h = list(map(int, self.size.split(',')))
-            path = os.path.join(path, 'W_' + str(w_size)) + '_' + str(h_size) + '_S_' + str(w) + '_' + str(h)
+            path = os.path.join(path, 'W_' + str(w_size)) + '_' + str(h_size) + '_Stride_' + str(stride) + '_S_' + str(w) + '_' + str(h)
 
         if self.transformation == 'static':
             # param contains image name to find for each scene