December 2019
Intermediate to advanced
368 pages
11h 10m
English
Each of the allowed configurations of pixels in the specific part of the retina space can be represented as a separate visual object. The Python class encapsulating the related functionality is named VisualObject and is defined in the retina_experiment.py file. It has the following constructor:
def __init__(self, configuration, side, size=2): self.size = size self.side = side self.configuration = configuration self.data = np.zeros((size, size)) # Parse configuration lines = self.configuration.splitlines() for r, line in enumerate(lines): chars = line.split(" ") for c, ch in enumerate(chars): if ch == 'o': # pixel is ON self.data[r, c] = 1.0 else: # pixel is OFF self.data[r, c] = 0.0
The constructor receives ...
Read now
Unlock full access