GoPiGo 小汽車︰格點圖像算術《什麼是影像》二

假使從物理說,一個物體可看成 『點光源』E(\vec{r}, t, \lambda) 聚集之三維『能量流』。然後依據『幾何光學』之『成像條件』︰

Justin Peatross 和 Michael Ware 兩位先生解釋『成像條件

成像條件一

成像條件二

宛如順手捻來不費力氣!甚至三言兩語說明了經典的『幾何光學』三條線!!

幾何光學三條線一

幾何光學三條線二

─── 摘自《光的世界︰矩陣光學六丁

 

產生二維『影像』。由於『矩陣光學』一般是以『眼睛』或『光學系統』之『光軸』為中心立論,也就是『物面』之『透視投影』也

Perspective projection

When the human eye views a scene, objects in the distance appear smaller than objects close by – this is known as perspective. While orthographic projection ignores this effect to allow accurate measurements, perspective projection shows distant objects as smaller to provide additional realism.

The perspective projection requires a more involved definition as compared to orthographic projections. A conceptual aid to understanding the mechanics of this projection is to imagine the 2D projection as though the object(s) are being viewed through a camera viewfinder. The camera’s position, orientation, and field of view control the behavior of the projection transformation. The following variables are defined to describe this transformation:

  •   {\mathbf {a}}_{{x,y,z}} – the 3D position of a point A that is to be projected.
  •   {\mathbf {c}}_{{x,y,z}} – the 3D position of a point C representing the camera.
  •   {\mathbf {\theta }}_{{x,y,z}} – The orientation of the camera (represented by Tait–Bryan angles).
  •   {\mathbf {e}}_{{x,y,z}} – the viewer’s position relative to the display surface [3] which goes through point C representing the camera.

Which results in:

  •   {\mathbf {b}}_{{x,y}} – the 2D projection of  \mathbf {a} .

When  {\mathbf {c}}_{{x,y,z}}=\langle 0,0,0\rangle , and  {\mathbf {\theta }}_{{x,y,z}}=\langle 0,0,0\rangle , the 3D vector  \langle 1,2,0\rangle is projected to the 2D vector \langle 1,2\rangle .

Otherwise, to compute  {\mathbf {b}}_{{x,y}} we first define a vector  {\mathbf {d}}_{{x,y,z}} as the position of point A with respect to a coordinate system defined by the camera, with origin in C and rotated by  \mathbf {\theta } with respect to the initial coordinate system. This is achieved by subtracting  \mathbf {c} from  \mathbf {a} and then applying a rotation by -{\mathbf {\theta }} to the result. This transformation is often called a camera transform, and can be expressed as follows, expressing the rotation in terms of rotations about the x, y, and z axes (these calculations assume that the axes are ordered as a left-handed system of axes): [4] [5]

{\displaystyle {\begin{bmatrix}\mathbf {d} _{x}\\\mathbf {d} _{y}\\\mathbf {d} _{z}\\\end{bmatrix}}={\begin{bmatrix}1&0&0\\0&{\cos(\mathbf {\theta } _{x})}&{\sin(\mathbf {\theta } _{x})}\\0&{-\sin(\mathbf {\theta } _{x})}&{\cos(\mathbf {\theta } _{x})}\\\end{bmatrix}}{\begin{bmatrix}{\cos(\mathbf {\theta } _{y})}&0&{-\sin(\mathbf {\theta } _{y})}\\0&1&0\\{\sin(\mathbf {\theta } _{y})}&0&{\cos(\mathbf {\theta } _{y})}\\\end{bmatrix}}{\begin{bmatrix}{\cos(\mathbf {\theta } _{z})}&{\sin(\mathbf {\theta } _{z})}&0\\{-\sin(\mathbf {\theta } _{z})}&{\cos(\mathbf {\theta } _{z})}&0\\0&0&1\\\end{bmatrix}}\left({{\begin{bmatrix}\mathbf {a} _{x}\\\mathbf {a} _{y}\\\mathbf {a} _{z}\\\end{bmatrix}}-{\begin{bmatrix}\mathbf {c} _{x}\\\mathbf {c} _{y}\\\mathbf {c} _{z}\\\end{bmatrix}}}\right)}

This representation corresponds to rotating by three Euler angles (more properly, Tait–Bryan angles), using the xyz convention, which can be interpreted either as “rotate about the extrinsic axes (axes of the scene) in the order z, y, x (reading right-to-left)” or “rotate about the intrinsic axes (axes of the camera) in the order x, y, z (reading left-to-right)”. Note that if the camera is not rotated (  {\mathbf {\theta }}_{{x,y,z}}=\langle 0,0,0\rangle ), then the matrices drop out (as identities), and this reduces to simply a shift:  {\mathbf {d}}={\mathbf {a}}-{\mathbf {c}}.

Alternatively, without using matrices (let’s replace (ax-cx) with x and so on, and abbreviate cosθ to c and sinθ to s):

{\begin{array}{lcl}{\mathbf {d}}_{x}=c_{y}(s_{z}{\mathbf {y}}+c_{z}{\mathbf {x}})-s_{y}{\mathbf {z}}\\{\mathbf {d}}_{y}=s_{x}(c_{y}{\mathbf {z}}+s_{y}(s_{z}{\mathbf {y}}+c_{z}{\mathbf {x}}))+c_{x}(c_{z}{\mathbf {y}}-s_{z}{\mathbf {x}})\\{\mathbf {d}}_{z}=c_{x}(c_{y}{\mathbf {z}}+s_{y}(s_{z}{\mathbf {y}}+c_{z}{\mathbf {x}}))-s_{x}(c_{z}{\mathbf {y}}-s_{z}{\mathbf {x}})\\\end{array}}

This transformed point can then be projected onto the 2D plane using the formula (here, x/y is used as the projection plane; literature also may use x/z):[6]

  {\begin{array}{lcl}{\mathbf {b}}_{x}&=&{\frac {{\mathbf {e}}_{z}}{{\mathbf {d}}_{z}}}{\mathbf {d}}_{x}-{\mathbf {e}}_{x}\\{\mathbf {b}}_{y}&=&{\frac {{\mathbf {e}}_{z}}{{\mathbf {d}}_{z}}}{\mathbf {d}}_{y}-{\mathbf {e}}_{y}\\\end{array}}.

Or, in matrix form using homogeneous coordinates, the system

{\begin{bmatrix}{\mathbf {f}}_{x}\\{\mathbf {f}}_{y}\\{\mathbf {f}}_{z}\\{\mathbf {f}}_{w}\\\end{bmatrix}}={\begin{bmatrix}1&0&-{\frac {{\mathbf {e}}_{x}}{{\mathbf {e}}_{z}}}&0\\0&1&-{\frac {{\mathbf {e}}_{y}}{{\mathbf {e}}_{z}}}&0\\0&0&1&0\\0&0&1/{\mathbf {e}}_{z}&0\\\end{bmatrix}}{\begin{bmatrix}{\mathbf {d}}_{x}\\{\mathbf {d}}_{y}\\{\mathbf {d}}_{z}\\1\\\end{bmatrix}}

in conjunction with an argument using similar triangles, leads to division by the homogeneous coordinate, giving

  {\begin{array}{lcl}{\mathbf {b}}_{x}&=&{\mathbf {f}}_{x}/{\mathbf {f}}_{w}\\{\mathbf {b}}_{y}&=&{\mathbf {f}}_{y}/{\mathbf {f}}_{w}\\\end{array}}.

The distance of the viewer from the display surface,  \mathbf{e}_z, directly relates to the field of view, where  \alpha =2\cdot \tan ^{{-1}}(1/{\mathbf {e}}_{z}) is the viewed angle. (Note: This assumes that you map the points (-1,-1) and (1,1) to the corners of your viewing surface)

The above equations can also be rewritten as:

{\begin{array}{lcl}{\mathbf {b}}_{x}=({\mathbf {d}}_{x}{\mathbf {s}}_{x})/({\mathbf {d}}_{z}{\mathbf {r}}_{x}){\mathbf {r}}_{z}\\{\mathbf {b}}_{y}=({\mathbf {d}}_{y}{\mathbf {s}}_{y})/({\mathbf {d}}_{z}{\mathbf {r}}_{y}){\mathbf {r}}_{z}\\\end{array}}.

In which  {\mathbf {s}}_{{x,y}} is the display size,  {\mathbf {r}}_{{x,y}} is the recording surface size (CCD or film),  {\mathbf {r}}_{z} is the distance from the recording surface to the entrance pupil (camera center), and  {\mathbf {d}}_{z} is the distance, from the 3D point being projected, to the entrance pupil.

Subsequent clipping and scaling operations may be necessary to map the 2D plane onto any particular display media.

Diagram

Perspective transform diagram.svg

To determine which screen x-coordinate corresponds to a point at  A_{x},A_{z} multiply the point coordinates by:

  B_{x}=A_{x}{\frac {B_{z}}{A_{z}}}

where

  B_x is the screen x coordinate
  A_x is the model x coordinate
  B_z is the focal length—the axial distance from the camera center to the image plane
  A_z is the subject distance.

Because the camera is in 3D, the same works for the screen y-coordinate, substituting y for x in the above diagram and equation.

 

豈能不覺得奇怪嗎?若按『成像條件』所說︰

\frac{1}{object \ distance} + \frac{1}{image \ distance} = \frac{1}{focal \ length}

,三維物體如何可能滿足『物面』假設乎?故而務須明白什麼是『模糊圈』︰

為什麼一張圖

Circle_of_confusion_calculation_diagram.svg

一個式子

c = A \frac{| S_2 - S_1 |}{S_2} \frac{f}{S_1 -f}

= \frac{| S_2 - S_1 |}{S_2} \frac{f^2}{N (S_1 -f)}

這裡 A = \frac{f}{N}

會 令人如此困惑耶?假使不知道它說人眼『分辨率』有極限!藉此來定義『模糊』與『清晰』的分野。即使不談『孔徑』,一個透鏡也自有邊界 A 的哩!更由於『成像條件』使得只有一物距 S_1 能完美聚焦成像 f_1 【像距】。就此而論其它 S_2 遠、近之物在像面上將形成『彌散圓』,要是它小到人可將之視為『點』,此時視力不得不以為成像『清晰』的了。雖然那個式子貌似複雜,涉及多個參數,其中 fN 是這個光學系統內稟參數,實際是以『聚焦之物』 S_1 ,論述『相對』它物 S_2 所產生的『模糊圈』大小而已。在下面兩種情況裡, c 得以簡化︰

【聚焦於無窮遠】 S_1 \to \infty

c = \frac{f^2}{N S_2} ,與 S_1 無關。

【相對無窮遠之物】 S_2 \to \infty

c = \frac{f^2}{N (S_1 - f)} ,與 S_2 無關。

或可先思其蘊涵意義耶!!

Circle of confusion diameter limit in photography

In photography, the circle of confusion diameter limit (“CoC”) for the final image is often defined as the largest blur spot that will still be perceived by the human eye as a point.

With this definition, the CoC in the original image (the image on the film or electronic sensor) depends on three factors:

  1. Visual acuity. For most people, the closest comfortable viewing distance, termed the near distance for distinct vision (Ray 2000, 52), is approximately 25 cm. At this distance, a person with good vision can usually distinguish an image resolution of 5 line pairs per millimeter (lp/mm), equivalent to a CoC of 0.2 mm in the final image.
  2. Viewing conditions. If the final image is viewed at approximately 25 cm, a final-image CoC of 0.2 mm often is appropriate. A comfortable viewing distance is also one at which the angle of view is approximately 60° (Ray 2000, 52); at a distance of 25 cm, this corresponds to about 30 cm, approximately the diagonal of an 8″×10″ image. It often may be reasonable to assume that, for whole-image viewing, a final image larger than 8″×10″ will be viewed at a distance correspondingly greater than 25 cm, and for which a larger CoC may be acceptable; the original-image CoC is then the same as that determined from the standard final-image size and viewing distance. But if the larger final image will be viewed at the normal distance of 25 cm, a smaller original-image CoC will be needed to provide acceptable sharpness.
  3. Enlargement from the original image to the final image. If there is no enlargement (e.g., a contact print of an 8×10 original image), the CoC for the original image is the same as that in the final image. But if, for example, the long dimension of a 35 mm original image is enlarged to 25 cm (10 inches), the enlargement is approximately 7×, and the CoC for the original image is 0.2 mm / 7, or 0.029 mm.

The common values for CoC may not be applicable if reproduction or viewing conditions differ significantly from those assumed in determining those values. If the original image will be given greater enlargement, or viewed at a closer distance, then a smaller CoC will be required. All three factors above are accommodated with this formula:

CoC (mm) = viewing distance (cm) / desired final-image resolution (lp/mm) for a 25 cm viewing distance / enlargement / 25

For example, to support a final-image resolution equivalent to 5 lp/mm for a 25 cm viewing distance when the anticipated viewing distance is 50 cm and the anticipated enlargement is 8:

CoC = 50 / 5 / 8 / 25 = 0.05 mm

Since the final-image size is not usually known at the time of taking a photograph, it is common to assume a standard size such as 25 cm width, along with a conventional final-image CoC of 0.2 mm, which is 1/1250 of the image width. Conventions in terms of the diagonal measure are also commonly used. The DoF computed using these conventions will need to be adjusted if the original image is cropped before enlarging to the final image size, or if the size and viewing assumptions are altered.

Using the “Zeiss formula”, the circle of confusion is sometimes calculated as d/1730 where d is the diagonal measure of the original image (the camera format). For full-frame 35 mm format (24 mm × 36 mm, 43 mm diagonal) this comes out to be 0.025 mm. A more widely used CoC is d/1500, or 0.029 mm for full-frame 35 mm format, which corresponds to resolving 5 lines per millimeter on a print of 30 cm diagonal. Values of 0.030 mm and 0.033 mm are also common for full-frame 35 mm format. For practical purposes, d/1730, a final-image CoC of 0.2 mm, and d/1500 give very similar results.

Criteria relating CoC to the lens focal length have also been used. Kodak (1972), 5) recommended 2 minutes of arc (the Snellen criterion of 30 cycles/degree for normal vision) for critical viewing, giving CoC ≈ f /1720, where f is the lens focal length. For a 50 mm lens on full-frame 35 mm format, this gave CoC ≈ 0.0291 mm. This criterion evidently assumed that a final image would be viewed at “perspective-correct” distance (i.e., the angle of view would be the same as that of the original image):

Viewing distance = focal length of taking lens × enlargement

However, images seldom are viewed at the “correct” distance; the viewer usually doesn’t know the focal length of the taking lens, and the “correct” distance may be uncomfortably short or long. Consequently, criteria based on lens focal length have generally given way to criteria (such as d/1500) related to the camera format.

If an image is viewed on a low-resolution display medium such as a computer monitor, the detectability of blur will be limited by the display medium rather than by human vision. For example, the optical blur will be more difficult to detect in an 8″×10″ image displayed on a computer monitor than in an 8″×10″ print of the same original image viewed at the same distance. If the image is to be viewed only on a low-resolution device, a larger CoC may be appropriate; however, if the image may also be viewed in a high-resolution medium such as a print, the criteria discussed above will govern.

Depth of field formulas derived from geometrical optics imply that any arbitrary DoF can be achieved by using a sufficiently small CoC. Because of diffraction, however, this isn’t quite true. Using a smaller CoC requires increasing the lens f-number to achieve the same DOF, and if the lens is stopped down sufficiently far, the reduction in defocus blur is offset by the increased blur from diffraction. See the Depth of field article for a more detailed discussion.

也可細想針孔成像之幾何光學原理果然太完美矣??

─── 摘自《光的世界︰【□○閱讀】話眼睛《九》

 

以及何謂『超焦距』耶!

術語因其目的而生,應其行業而別,所以在攝影天地裡講

超焦距

超焦距或稱 泛焦距離攝影術語。是一個和焦距光圈有關的對焦距離,當鏡頭以這個距離對焦時景深最大、可以從相機和對焦點之間的某處(景深前緣)起延伸到無限遠(景深後緣)。

從1933年開始,徠卡將 超焦距尺刻印在鏡頭上,此後大部分各廠家出產的鏡頭或照相機,都有超焦距刻度。見圖一,將無窮遠對準箭頭(將鏡頭對焦在無窮遠),這時f8對準10米,這 裡10米就是這個鏡頭在f8時的超焦距;用這枚鏡頭拍照,如將鏡頭對焦在無窮遠,用f8光圈,那麼從10米以外直到無窮遠的物體,在相片上保證清晰。如嫌 景深不夠,可以收小光圈,例如用f16,則超焦距=5米,景深從5米到無窮遠。

SUMMICRON-HYPERFOCAL

徠卡SUMMICRON 50毫米鏡頭的超焦距

Hyperfocal distance

In optics and photography, hyperfocal distance is a distance beyond which all objects can be brought into an “acceptable” focus. There are two commonly used definitions of hyperfocal distance, leading to values that differ only slightly:

Definition 1: The hyperfocal distance is the closest distance at which a lens can be focused while keeping objects at infinity acceptably sharp. When the lens is focused at this distance, all objects at distances from half of the hyperfocal distance out to infinity will be acceptably sharp.

Definition 2: The hyperfocal distance is the distance beyond which all objects are acceptably sharp, for a lens focused at infinity.

The distinction between the two meanings is rarely made, since they have almost identical values. The value computed according to the first definition exceeds that from the second by just one focal length.

As the hyperfocal distance is the focus distance giving the maximum depth of field, it is the most desirable distance to set the focus of a fixed-focus camera.[1]

。談可接受清晰度︰

Acceptable sharpness

The hyperfocal distance is entirely dependent upon what level of sharpness is considered to be acceptable. The criterion for the desired acceptable sharpness is specified through the circle of confusion (CoC) diameter limit. This criterion is the largest acceptable spot size diameter that an infinitesimal point is allowed to spread out to on the imaging medium (film, digital sensor, etc.).

Formulae

For the first definition,

H={\frac {f^{2}}{Nc}}+f

where

H is hyperfocal distance
  f is focal length
N {\displaystyle N} N is f-number (  f/D for aperture diameter  D)
  c is the circle of confusion limit

For any practical f-number, the added focal length is insignificant in comparison with the first term, so that

H\approx {\frac {f^{2}}{Nc}}

This formula is exact for the second definition, if H {\displaystyle H} H is measured from a thin lens, or from the front principal plane of a complex lens; it is also exact for the first definition if H is measured from a point that is one focal length in front of the front principal plane. For practical purposes, there is little difference between the first and second definitions.

從其推導

Derivation using geometric optics

The following derivations refer to the accompanying figures. For clarity, half the aperture and circle of confusion are indicated.[2]

Hyperfocal_distance_definitions.svg

Accompanying figures

Definition 1

An object at distance H forms a sharp image at distance x  (blue line). Here, objects at infinity have images with a circle of confusion indicated by the brown ellipse where the upper red ray through the focal point intersects the blue line.

First using similar triangles hatched in green,

{\begin{array}{crcl}&{\dfrac {x-f}{c/2}}&=&{\dfrac {f}{D/2}}\\\therefore &x-f&=&{\dfrac {cf}{D}}\\\therefore &x&=&f+{\dfrac {cf}{D}}\end{array}}

Then using similar triangles dotted in purple,

{\begin{array}{crclcl}&{\dfrac {H}{D/2}}&=&{\dfrac {x}{c/2}}\\\therefore &H&=&{\dfrac {Dx}{c}}&=&{\dfrac {D}{c}}{\Big (}f+{\dfrac {cf}{D}}{\Big )}\\&&=&{\dfrac {Df}{c}}+f&=&{\dfrac {f^{2}}{Nc}}+f\end{array}} as found above.

Definition 2

Objects at infinity form sharp images at the focal length f  (blue line). Here, an object at H forms an image with a circle of confusion indicated by the brown ellipse where the lower red ray converging to its sharp image intersects the blue line.

Using similar triangles shaded in yellow,

{\begin{array}{crclcl}&{\dfrac {H}{D/2}}&=&{\dfrac {f}{c/2}}\\\therefore &H&=&{\dfrac {Df}{c}}&=&{\dfrac {f^{2}}{Nc}}\end{array}}

可知是來自模糊圈的定義。若是對比著上篇所言︰

─── 摘自《光的世界︰【□○閱讀】話眼睛《九》之附錄