def test_properties(self): scene = Scene('macbeth') il = Illuminant('D50.mat', wave=scene.wave) scene.mean_luminance = 50 self.assertRaises(Exception, scene.adjust_illuminant(il)) self.assertRaises(Exception, scene.luminance) self.assertRaises(Exception, scene.mean_luminance) self.assertRaises(Exception, scene.shape) self.assertRaises(Exception, scene.width) self.assertRaises(Exception, scene.height) self.assertRaises(Exception, scene.sample_size) self.assertRaises(Exception, scene.bin_width) self.assertRaises(Exception, scene.energy) self.assertRaises(Exception, scene.xyz) self.assertRaises(Exception, scene.srgb)
def test_compute_noisefree(self): fov = 1.0 # field of view in degree scene = Scene("macbeth", fov=fov) oi = Optics().compute(scene) cone = ConeOuterSegmentMosaic() cone.set_fov(new_fov=fov, oi=oi) cone.compute_noisefree(oi) cone.position = np.round(np.random.normal(size=[100, 2], scale=5)) cone.compute(oi)
def main(): # tmp = Display.ls_display() # d = Display.init_with_isetbio_mat_file("OLED-Sony.mat") # d.visualize() scene = Scene("macbeth") scene.mean_luminance = 100 # scene.visualize() oi = Optics() # oi.plot('psf', 550) oi.compute(scene) # oi.visualize() cone = ConeOuterSegmentMosaic() cone.set_fov(scene.fov, oi) cone.init_eye_movement(n_samples=200) # cone.plot('eyemovement') cone.compute(oi) print(cone.current) cone.visualize()
def test_properties(self): scene = Scene("macbeth") oi = Optics() oi.compute(scene) self.assertRaises(Exception, oi.wave) self.assertRaises(Exception, oi.bin_width) self.assertRaises(Exception, oi.shape) self.assertRaises(Exception, oi.width) self.assertRaises(Exception, oi.height) self.assertRaises(Exception, oi.sample_size) self.assertRaises(Exception, oi.image_distance) self.assertRaises(Exception, oi.magnification) self.assertRaises(Exception, oi.pupil_diameter) self.assertRaises(Exception, oi.spatial_support) self.assertRaises(Exception, oi.n_rows) self.assertRaises(Exception, oi.n_cols) self.assertRaises(Exception, oi.meters_per_degree) self.assertRaises(Exception, oi.degrees_per_meter) self.assertRaises(Exception, oi.frequency_support)
def test_properties(self): fov = 1.0 # field of view in degree scene = Scene("macbeth", fov=fov) oi = Optics().compute(scene) cone = ConeOuterSegmentMosaic() cone.set_fov(new_fov=fov, oi=oi) cone.compute_noisefree(oi) self.assertRaises(Exception, cone.wave) self.assertRaises(Exception, cone.name) self.assertRaises(Exception, cone.bin_width) self.assertRaises(Exception, cone.n_cols) self.assertRaises(Exception, cone.n_rows) self.assertRaises(Exception, cone.size) self.assertRaises(Exception, cone.height) self.assertRaises(Exception, cone.width) self.assertRaises(Exception, cone.cone_area) self.assertRaises(Exception, cone.spatial_support) self.assertRaises(Exception, cone.degrees_per_cone) self.assertRaises(Exception, cone.rgb)
def test_visualize(self): oi = Optics() oi.compute(Scene()) self.assertRaises(Exception, oi.visualize())
def test_compute(self): scene = Scene("macbeth") oi = Optics() self.assertRaises(Exception, oi.compute(scene))
def test_init_with_display_image(self): d = Display.init_with_isetbio_mat_file(os.path.join(get_data_path(), 'Display', 'LCD-Apple.mat')) img = imread(os.path.join(get_data_path(), 'Image', 'eagle.jpg'), mode='RGB').astype(float)/255 self.assertRaises(Exception, Scene.init_with_display_image(d, img))
def test_init_with_display_image(self): d = Display.init_with_isetbio_mat_file( os.path.join(get_data_path(), 'Display', 'LCD-Apple.mat')) img = imread(os.path.join(get_data_path(), 'Image', 'eagle.jpg'), mode='RGB').astype(float) / 255 self.assertRaises(Exception, Scene.init_with_display_image(d, img))