# -*- coding: utf-8 -*- """ Created on Thu Mar 7 11:14:23 2019 @author: Student """ #class VectorExample(): # def __init__(self, input_list): # self.vector = input_list # # def foreach(self, other, input_function): # return VectorExample([input_function(self.vector[i], other.vector[i]) for i in range(len(self.vector))]) # # def __add__(self,other): # return self.foreach(other, lambda a,b: a+b) # # def __sub__(self, other): # return self.foreach(other, lambda a,b: a-b) # # def __mul__(self, other): # return self.foreach(other, lambda a,b: a*b) # # def __truediv__(self,other): # return self.foreach(other, lambda a,b: a/b) # # def __str__(self): # return str(self.vector) # # #def run(): # vector_1 = VectorExample([1, 13, 4]) # vector_2 = VectorExample([3, -2, 2]) # # print(vector_1 + vector_2) # print(vector_1 - vector_2) # print(vector_1 * vector_2) # print(vector_1 / vector_2) # #if __name__== "__main__": # run() import os import numpy as np from matplotlib import pyplot as plt from skimage import io def run(): example_array = np.array([ [8,1,1,1], [9,7,5,3], [4,6,8,10], [2,3,5,7] ]) noise_1 = np.random.randn(128,256) noise_2 = np.random.randn(128,256) vmin=-0.5;vmax=0.5 plt.figure() plt.subplot(2,1,1) plt.imshow(noise_1,cmap='gray', vmin=vmin, vmax=vmax) plt.axis('off') plt.subplot(2,1,2) plt.imshow(noise_2, cmap='gray', vmin=vmin, vmax=vmax) plt.axis('off') plt.show() run()