示例#1
0
 def run_show_primitives():
     """Demonstrates the FT images of primitive forms"""
     transformers = [
         Transformer('round.jpg'),
         Transformer('square.png'),
         Transformer('triangle.png')
     ]
     for trans in transformers:
         trans.plot()
         trans.transform().shift()
         trans.plot_fft('Shifted FT of')
     Transformer.show_all()
     transformers.clear()
     del transformers
     gc.collect()
示例#2
0
    def run_filter(self):
        """Runs the filter class work demonstration"""
        name = self.box.get()
        try:
            fraction = float(self.fracbox.get())
            fl1 = fl.Filter(name, fraction)
            fl1.plot(name)
            fl1.low_pass_filter()

            fl2 = fl.Filter(name, fraction)
            fl2.high_pass_filter()
            Transformer.show_all()
            del fl1, fl2, name
            gc.collect()
        except Exception as er:
            print(er)
示例#3
0
 def run_comp():
     """Demonstrates the FT images of complex forms"""
     tr = Transformer('vase.jpg')
     tr2 = Transformer('face.jpg')
     tr.plot('Original vase')
     tr2.plot('Original face')
     tr.transform()
     tr.plot_fft('FT')
     tr2.transform()
     tr2.plot_fft('FT')
     tr.shift()
     tr.plot_fft('Shifted FT')
     tr2.shift()
     tr2.plot_fft('Shifted FT')
     Transformer.show_all()
     del tr, tr2
     gc.collect()
示例#4
0
from transform import Transformer

if __name__ == '__main__':
    shapes = ['round.jpg', 'square.png', 'triangle.png']
    for sh in shapes:
        trans = Transformer(sh)
        trans.transform()
        trans.plot_fft('FT of')
        trans.shift()
        trans.plot_fft('Shifted FT of')
    Transformer.show_all()

    tr = Transformer('vase.jpg')
    tr2 = Transformer('face.jpg')
    tr.plot('Original vase')
    tr2.plot('Original face')
    tr.transform()
    tr.plot_fft('FT')
    tr2.transform()
    tr2.plot_fft('FT')
    tr.shift()
    tr.plot_fft('Shifted FT')
    tr2.shift()
    tr2.plot_fft('Shifted FT')
    Transformer.show_all()