# -*- 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 import random #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() #def run(): # # x_size = 512 # y_size = 512 # number_of_points = 500 # vector1 = np.random.uniform(0,x_size,number_of_points) # vector2 = np.random.uniform(0,y_size,number_of_points) # # x_origin=256 # y_origin=256 # radius=100 # is_inside=np.square(vector1-x_origin) + np.square(vector2-y_origin) < radius*radius # # image = np.zeros((y_size,x_size)) # grid_x, grid_y = np.meshgrid(np.arange(x_size), np.arange(y_size)) # # image[np.square(grid_x - x_origin)+np.square(grid_y - y_origin)