Hans Georg Schaathun
NTNU, Noregs Teknisk-Naturvitskaplege Universitet
Fri 20 Aug 06:55:55 UTC 2021
Eye Model from Introduction to Psychology by University of Minnesota
Vision is the inverse problem of image formation
The Mandrill Test Image (public domain)
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
im = cv.imread("mandrill-grey.png")
The Mandrill Test Image (public domain)
In [5]: im
Out[5]:
array([[[ 76, 76, 76],
[ 60, 60, 60],
[ 68, 68, 68],
...,
[ 90, 90, 90],
[ 97, 97, 97],
[ 96, 96, 96]],
[[ 83, 83, 83],
[ 72, 72, 72],
[ 77, 77, 77],
...,
[ 99, 99, 99],
[ 87, 87, 87],
[106, 106, 106]],
...,
[[131, 131, 131],
[144, 144, 144],
[138, 138, 138],
...,
[ 85, 85, 85],
[ 98, 98, 98],
[ 90, 90, 90]],
[[109, 109, 109],
[102, 102, 102],
[109, 109, 109],
...,
[ 57, 57, 57],
[ 67, 67, 67],
[ 69, 69, 69]]], dtype=uint8)
In [6]: im.shape
Out[6]: (128, 128, 3)
In [7]:
In [7]: im[:,:,0]
Out[7]:
array([[ 76, 60, 68, ..., 90, 97, 96],
[ 83, 72, 77, ..., 99, 87, 106],
[ 51, 75, 117, ..., 99, 81, 88],
...,
[139, 140, 136, ..., 92, 96, 78],
[131, 144, 138, ..., 85, 98, 90],
[109, 102, 109, ..., 57, 67, 69]], dtype=uint8)
In [8]:
The Mandrill Test Image (public domain)
In [60]: cv.imshow("mandrill grey", im)
In [61]: cv.waitKey(1)
Out[61]: -1
Sampled function $I(x,y)$
Out[58]:
array([[ 76, 60, 68, ..., 90, 97, 96],
[ 83, 72, 77, ..., 99, 87, 106],
[ 51, 75, 117, ..., 99, 81, 88],
...,
[139, 140, 136, ..., 92, 96, 78],
[131, 144, 138, ..., 85, 98, 90],
[109, 102, 109, ..., 57, 67, 69]], dtype=uint8)
In [59]:
Burning Glass from *College Physics* by OpenStax College
Diagram of Lens Focus Point from *College Physics* by OpenStax College
Image of points (first lens model)
Image of points (first lens model)
$$\frac1Z + \frac1z = \frac1f$$
Draw figure
$$\frac Z X = \frac z x\quad\text{and}\quad \frac{f}{X} = \frac{z-f}{x}$$
$$\frac x X = \frac z Z\quad\text{and}\quad \frac{x}{X} = \frac{z-f}{f}$$
$$\frac{z}{Z} = \frac z f-1$$
$$\frac{1}{Z} = \frac1f-\frac{1}{z}$$
$$\frac{1}{Z} + \frac{1}{z} = \frac1f$$
Image of points - out of focus
Refer to Pinhole Figure
Perspective Bias
Which man is larger in the drawing?