Parcourir la source

Merge branch 'release/v0.2.1'

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

+ 11 - 0
classes/Transformation.py

@@ -1,6 +1,8 @@
 import os
 
 from ipfml.processing import reconstruction
+from ipfml.filters import convolution, kernels
+from ipfml import utils
 
 # Transformation class to store transformation method of image and get usefull information
 class Transformation():
@@ -23,6 +25,11 @@ class Transformation():
             n_components = self.param
             data = reconstruction.fast_ica(img, n_components)
 
+        if self.transformation == 'diff_filter':
+            w_size, h_size = list(map(int, self.param.split(',')))
+            # bilateral with window of size (`w_size`, `h_size`)
+            data = convolution.convolution2D(img, kernels.bilateral_diff, (w_size, h_size))
+            
         if self.transformation == 'static':
             # static content, we keep input as it is
             data = img
@@ -45,6 +52,10 @@ class Transformation():
             n_components = self.param
             path = os.path.join(path, 'N' + str(n_components))
 
+        if self.transformation == 'diff_filter':
+            w_size, h_size = list(map(int, self.param.split(',')))
+            path = os.path.join(path, 'W_' + str(w_size)) + '_' + str(h_size)
+
         if self.transformation == 'static':
             # param contains image name to find for each scene
             path = self.param