• Non ci sono risultati.

Development of an autofocus system for bio-inspired optical lenses

N/A
N/A
Protected

Academic year: 2021

Condividi "Development of an autofocus system for bio-inspired optical lenses"

Copied!
84
0
0

Testo completo

(1)

Development of an Autofocus system

for bio-inspired optical lenses

Università di Pisa

Facoltà di Ingegneria

Corso di Laurea Magistrale in Ingegneria Biomedica

RELATORI:

Prof. Danilo E. De Rossi

Prof. Federico Carpi

CANDIDATA:

Barbara Bertelli

(2)
(3)

Table of Contents

Table of Contents ... 3

Introduction ... 5

Chapter 1 ... 8

1.1 Focusing systems ... 8

1.2 Mechanically focusing lenses ... 10

1.3 Focusing in the Human Eye ... 13

1.31 The Structure of the Eye ... 13

1.32 Accommodation of the Eye ... 16

1.4 Focus Tunable lenses ... 17

1.5 Bibliography ... 18

Chapter 2 ... 19

2.1 Image Formation ... 20

2.11 The simple lens ... 20

2.12 Systems of two lenses ... 21

2.13 Focal length ... 22

2.14 Depth of field ... 23

2.15 Defocus effects on image quality ... 24

2.16 Modulation transfer function ... 25

2.2 Commercial Auto-focus systems ... 27

2.21 Active AF systems ... 27

2.22 Passive AF ... 27

2.3 Focus measure algorithms ... 29

2.4 Image Noise ... 34 2.41 Classification of noise ... 34 2.42 Signal-to-noise ratio ... 35 2.43 Denoising methods ... 36 2.5 Search algorithms ... 38 2.51 Methods Overview ... 38 2.52 Window Selection ... 39 2.6 Bibliography ... 39 Chapter 3 ... 41 3.1 Camera ... 42

3.2 Commercial Optotune Lens ... 44

3.21 Lens Overview ... 44

3.22 Lens Actuation ... 48

3.3 Bio-inspired lens prototype ... 51

3.31 Lens Overview ... 51

(4)

... 66

3.5 Experimental Evaluation of AF Algorithms ... 72

3.6 Bibliography ... 78

(5)

Introduction

The thesis activity concerns the development of an autofocus system for bio-inspired optical lenses.

This is accomplished in two steps:

1. Implementation of a Graphical User Interface (GUI) to easy control the focal length of tunable lenses, applying an electrical signal.

2. Testing of autofocus algorithms in order to assess which one is more suitable regarding tunable lens applications.

Nowadays, autofocus is a fundamental features of a lot of devices for different field of application. It finds implementation in consumer electronics (cameras, mobile phones, surveillance systems, etc.), in medical diagnostics (video endoscopes and other optical instrumentation, etc.) and optical communications (optical fiber components). Traditional optical systems physically shift the mechanical part to achieve the right focus position. This process may be slow and not easy to miniaturize, in contrast with the actual need of quick response systems in small device.

Although widely used for over a century, mechanical autofocus systems, sharply

contradicts the biological methods of focusing found in nature. The human eye changes the shape of its elastic lens in order to maintain a sharp image even when the object distance varies.

By developing methods that take inspiration from nature, manufacturers and research groups are now implementing different types of lens that can be tuned over various focal distances .

Tunable lenses are shape-changing lenses. This is accomplished often with less lenses and with no translational movements. As a result there is no more need for expensive

mechanical actuators and a less power consumption. The response time of such optical systems can be low and the housing more compact.

This lenses can be classified according to their technology of actuation that can be hydraulic or

pneumatic, electrical, magnetic or electromagnetic, optical, thermal, chemical or electrochemical. In this work of thesis both a commercial lens and a bio-inspired lens prototype can be controlled by the developed autofocus system.

EL-10-30-C lens is a tunable lens commercialized by Optotune. It is based on a container

which is

(6)

Driver. The lens has an electro-magnetic motor, which is driven by the current. The lens driver is connected to a computer by an USB port and supplies the correct amount of current and polarity for the actuation.

The Bio-inspired lens prototype used for testing the AF system is an electrically tunable lens made of dielectric elastomers. The lens actuation belongs to the class of artificial muscle materials and is known as dielectric elastomer (DE) actuation [1]. After that a voltage is applied to the electrodes, the DE membranes tend to be squeezed in thickness and expanded in surface, at a constant volume. So the lens diameter increases and both the radius of curvature and the focal length of the lens are reduced. In order to actuate the Bio-inspired lens prototype, an high voltage is required (0-4 kV), so a specific system is employed. This system is made up of an Arduino Uno Board, an High Voltage multiplier, a buffer and an high Voltage Resistor.

The control system, configured to continuously focusing the scene, is made up of the following parts:

• Camera • Tunable Lens • Lens Driver

• Graphical User Interface • Autofocus Algorithm

Each part plays an important role in the system as a whole, and needs to be chosen

carefully according to the system requirements. In fact, an auto focus system has to be fast in order to catch a rapidly changing scene or moving subjects and to show an high

capacity of achieving the proper focus. Furthermore, as every system that need a physical implementation, the available budget is not a negligible aspect for its feasibility.

To gain the best performance from the optical system, a suitable focusing method for tunable lenses needs to be adopted. This aim is achieved by an experimental evaluation of some of the most used algorithms in literature, using the implemented Graphical User Interface. The tunabe lens is configured to continuously change its curvature in response to an electrical input signal. The signal is generated by the lens driver in such a way that the lens performs a continuous scan of its optical power. The camera sensor acquires the image and conveys this information to the software which has been developed on purpose for this project. The system computes the focus function and then instructs the lens driver to adjust the electrical signal accordingly.

The feedback loop of acquiring images, generating focus measures and inducing optical power variation in the lens, is iterated until the solution converges to the maximum of the function. In this way focus condition is finally reached.

The Graphical User Interface has been implemented in C# programming language, using Visual Studio 2013, an integrated development environment (IDE) from Microsoft.In order to record live video directly to the computer, the Imaging Source DFK 23GM021 digital

camera has been employed. The Imaging Source provides a set of useful tools, libraries

and extension, which can be freely downloaded from the web site of the company. One of them is the Imaging Control .Net Library, an API that covers all aspects related to

(7)

processing, Emgu CV has been used. It is a .Net wrapper to the OpenCV image processing library, which is mainly aimed at real-time computer vision and real-time analysis.

The second aim of this work of thesis is to assess which focus measure is more suitable in tunable lens application .

Many autofocus algorithms have been proposed and compared in literature. All of them are based on the application of a criterion function to a set of images, acquired with different focal length.

This type of function ideally presents a maximum corresponding to the point of optimum focus and then monotonically decreases on both sides (unimodal functions). Computation time is another feature to be considered in autofocus systems. In fact, it is important to reduce the time required for focusing in order to increase the efficiency of the system. Focusing task has to be repeated a large number of times, so a less expensive function in terms of time, may have a significant impact on the total processing time. This work describes a systematic evaluation of autofocus functions used in combination with tunable lenses. Six functions have been evaluated using qualitative and quantitative methods. The evaluation of the algorithms takes into account five important features of the focusing function.

Accuracy: distance between the best focus position and the maximum of the focus curve

expressed as number of steps (1 step = 1mA).

Range: distance between two near local minima around the global maximum

expressed as number of steps.

Number of local maxima: number of maxima in a focus curve, excluding the global

maximum.

Width: width of a curve at 50% of its height expressed as number of steps .

Score: is found by summing the individual ranks for the four criteria. The best method has

a score of 1, the next best 2, and so on.

(8)

Chapter 1

A

RTIFICIAL AND

N

ATURAL FOCUSING

OF LIGHT

1.1 Focusing systems

The focusing process is aimed at setting the appropriate distance of a lens to the subject, in order to have a sharp picture.

The simpler cameras provide no way to adjust the focus that is set at the time of manufacture, and remains fixed (fixed focus).

Fixed-focus lens relies on sufficient depth of field and in most cases relatively small aperture to produce acceptably sharp images.

The advantage of this design is that it can be produced very inexpensively, more than autofocus or manual focus systems which require electronics, moving parts, and power.

Although lenses can be used sufficiently without altering focus, this is not usually feasible with lenses of large aperture, long focal length or for close-up work.

Therefore, to ensure that the most important part of the subject is in sharp focus, it is necessary to have some form of focusing system, as well as an indication of the state of focus.

This may be accomplished in several ways. In traditional mechanically based lens systems the optical elements are translated within the lens against each other.

Although widely used for over a century, mechanical lens motion sharply contradicts the biological methods of focusing found in nature. The human eye changes the shape of the elastic lens in order to maintain a clear image when the object distance varies, via a quick and instinctive response.

By developing methods that take inspiration from nature, manufacturers are now

developing different types of tunable lenses that can be tuned over various focal distances. Because these lens systems can be miniaturized relatively easily, they may find

(9)
(10)

1.2 Mechanically focusing lenses

We present an overview of different focusing methods dedicated to the optical systems which require to physically move one or more parts to adjust the focus

Unit focusing

The simplest method of focusing is by movement of the entire lens or optical unit (figure 1.1a). The lens elements are held in a fixed configuration. Movement is achieved in various ways. Technical cameras of the baseboard type employ a rack-and-pinion or friction device to move the lens on a panel for focusing by coupled range-finder or ground-glass screen. The monorail type is focused by moving either the lens or the back of the camera. This can be useful in applications such as copying, because rear

focusing alters the focus only, whereas front focusing alters the size of the image as well as the focus. Other cameras have the lens unit installed in a lens barrel or focusing mount. Rotation of a ring on the lens barrel moves the lens in an axial direction. A helical focusing mount causes the lens to rotate during focusing, instead a rectilinear mount does not. A special double helicoid arrangement is used to provide macro lenses with the extended movement necessary to allow continuous focus to magnifications of 0.5 or more. The focusing action may be coupled to a rangefinder or to an autofocus system, or it may be viewed on a screen. The focusing distance may also be set by a scale on the baseboard.

Figure 1.1: Focusing a lens. There are four principal methods of focusing: (a) by extending the whole lens

by a distance x; (b) by front-cell focusing, a smaller extension is needed; (c) by adding a close-up lens L, no extension is needed; (d) by internal focusing; no extension is needed.

(11)

Front-cell focusing

In simple cameras the front optical group moves forward on focusing closer. Focusing is possible by varying the focal length of the lens and not by varying the lens-to-sensor distance. This is achieved by mounting the front element in a cell with a coarse-pitch screw thread.

Rotation of this cell alters the separation of the front element from the other groups (Figure 1.1b).

A slight increase in this distance makes the focal length decrease, giving a useful focusing range. Lens aberrations occur in close focusing less than one metre, affecting performance negatively. Many zoom lenses also use a (well-corrected) movable front group for focusing. That rotation of the front element is in contrast with the use of polarizing filters and other direction-sensitive attachments such as graduated filters because they are sensitive to orientation.

Close-up lenses

Another positive lens can be placed in front of almost any lens to give a fixed close-up focusing range (Figure 1.1c). In this condition the camera lens receives parallel light, so it gives a sharp image at its infinity focus setting. By varying the focus setting on the camera lens, a limited close-up range is given.

The design of the added lens is important. The curvatures of its surfaces determine its effect upon the aberration correction of the other lens. Usually a positive meniscus shape is used, with its convex side to the subject. This simple lens may fit perfectly the purpose when used at small apertures but in order to achieve better performance an achromatic cemented doublet design with anti-reflection coatings is preferable.

The effect of the supplementary lens is to reduce slightly the focal length of the optical system. No exposure correction is necessary with supplementary lenses, and the aperture scale and the entrance pupil diameter remain unchanged.

Single-lens reflex cameras pose no problem for close-up focusing and framing. Other types usually require an additional prismatic device to correct the viewfinder image for parallax errors due to the proximity of the subject.

Internal focusing

Internal focusing (Figure 1.1d) is a focusing method in which only the inner lens group or groups are moved along the optical axis. The external dimensions of the lens does not change during focus and the front of the lens does not rotate. By this means an extensive focusing range is provided with only a small movement of few mechanical parts. This is particularly useful for large lenses because keep the system more compact, or with filters

(12)

involved mean that internal focusing is particularly suitable for autofocus lenses. Close-focusing is provided without reduction of image quality.

Extension tubes and bellows

Many lenses can only be focused close enough to provide a magnification of about 0.1 or less. Most standard lenses have a minimum focusing distance of 0.3 to 1.0 metres. If the lens is removable, the use of extension tubes and bellows extensions between the lens and camera body provide the additional lens-to-image distance needed to give greater magnification. An extension tube has fittings for attaching the lens to one end and the camera body to the other. Tubes of various lengths are available for use singly or in

combination. Variable-length tubes are also available. Together with the focusing movement on the lens mount, an extension tube gives a limited close-focusing range. At long extensions, a narrow-diameter tube may cause vignetting. For these reasons, an extension bellows is preferable as this permits a full and continuous focusing range, and allows lenses of long focal length to be used. Some lenses may be produced in a short-mount bellows-unit-only version.

Extension tubes and bellows are most useful with SLR cameras, due to the ease of focusing. A table is usually available listing increases in exposure for the various magnifications, but TTL metering avoids the necessity for this.

(13)

1.3 Focusing in the Human Eye

The human eye has been likened to a camera in many descriptions.

It is a light-tight sphere with a lens system positioned which can focus light on to a photosensitive layer, the retina, located at the back of the eyeball.

Beyond this basic description, the structure is much more complicated than the most sophisticated cameras available at present. It controls proficiently focusing, exposure, and white balance. It is a scanning system, capable of compression and can respond to lighting conditions that can vary by up to six orders of magnitude.

Therefore understanding the basic functioning of the eye may lead to better design and operation of imaging systems and inspires many further advances in numerous areas.

1.31 The Structure of the Eye

The eyeball is a tough shell filled with a jellylike substance under sufficient pressure to maintain its shape. It rides in a bony socket of the skull on pads of flesh and fat. It is held in place and rotated by six muscles (Figure 1.2). The outer shell (sclera) is white and opaque except for the cornea, which is clear. The cornea supplies most (about two-thirds) of the refractive power of the eye. Behind the cornea is the aqueous humor, which is a watery fluid. The iris, which gives the eye its colour, is capable of expanding or

contracting to control the amount of light admitted to the eye. The pupil formed by the iris can range in diameter from 8 mm in very dim light to less than 2 mm under very bright conditions. The lens of the eye is a flexible capsule suspended by a multitude of fibers, or ligaments, around its periphery. The eye is focused by changing the shape of the lens. When the sphincter muscles to which the suspensory ligaments are connected are relaxed,

Figure 1.2 Schematic horizontal section of the eyeball

(14)

muscles contract, the lens bulges, so that its radii are shorter and the eye is focused for nearby objects. This process is called accommodation.

Behind the lens is the vitreous humor, a material with the consistency of thin jelly. All of the optical elements of the eye are largely water in fact, a reasonable simulation of the optics of the eye can be made by considering the eye as a single refracting surface of water.

The following table lists typical values for the radii, thicknesses, and indices of the optical surfaces of the eye. These, of course, vary from individual to individual.

The principal points are located 1.5 and 1.8 mm behind the cornea, and the nodal points are 7.1 and 7.4 mm behind the cornea. The first focal point is 15.6 mm outside the eye; the second is, of course, at the retina. The distance from the second nodal point to the retina is 17.1 mm; thus the retinal size of an image can be found by multiplying the

angular subtense of the object (from the first nodal point) by this distance. When the eye accommodates (focuses), the lens becomes nearly equiconvex with radii of about 5.3 mm, and the nodal points move a few millimeters toward the retina. The center of rotation of the eyeball is 13 to 16 mm behind the cornea.

The commonly accepted eye data tabulated above gives just an approximation of the quality of the visual system.

First, the surfaces of the eye are not spherical. In fact the surface curvature generally decreases toward the margin of the surface.

Second, the index of the lens is not uniform, but is higher in the central part of the lens. This sort of index gradient produces convergent refracting power in and of itself. The surface refracting power at the margin of the lens is also reduced. The gradient index and the surface asphericities introduce overcorrected spherical aberration, which offsets the undercorrected spherical of the outer surface of the cornea.

The retina contains blood vessels, nerve fibers, the light-sensitive rod and cone cells, and a pigment layer. The optic nerve and the associated blind spot are located where the nerve fibers leave the eyeball and proceed to the brain.

Slightly (about 5°) to the temporal (outer) side of the optical axis of the eye is the macula; the centre of the macula is the fovea. At the fovea, the structure of the retina thins out and, in the central 0.3-mm diameter, only cones are present. The fovea is the center of sharp vision. Outside this area rods begin to appear; further away only rods are present.

(15)

There are about 7 million cones in the retina, about 125 million rods, and only about 1 million nerve fibers. The cones of the fovea are 1 to 1.5 µm in diameter and are about 2 to 2.5 µm apart. The rods are about 2 µm in diameter. In the outer portions of the retina, the sensitive cells are more widely spaced and are multiply connected to nerve fibers (several hundred to a fiber), accounting for the less distinct vision in this area of the retina. In the fovea, however, for some cones there is one cone cell per fiber; but there are 7 million cones and only one million nerve fibers.

The field of vision of an eye approximates an ellipse about 130° high by about 160° wide. The binocular field of vision, seen by both eyes simultaneously, is approximately circular and about 120° in diameter.

Figure 1.2 (a) Focusing on a distance object, the lens flattens. (b) The lens becomes more rounded when

focusing on near objects. (c) Hyperopia, or commonly far-sightedness, may be corrected by adding a positive power lens in front of the eye. (d) Myopia, or near-sightedness as it is known, may be corrected by the addition of a negative power lens to the front of the eye.

(16)

1.32 Accommodation of the Eye

Focusing of the eye is called accommodation. The crystalline lens is suspended behind the iris by the zonules of Zinn.The zonules are ligaments, made of collagen, which attach to the circular ciliary muscle. An out of-focus retinal image triggers the parasympathetic system which contracts and relaxes the ciliary muscle. As the ciliary muscle is relaxed the zonules become taught, placing tension on the crystalline lens and it is flattened. When the ciliary muscle tightens the zonules relax and the lens becomes rounded. To maintain focus on distance objects, the curvature of the lens is reduced, the lens is flattened and the focal length is increased. Conversely, to focus on close objects, the curvature is increased, the lens fattened and the focal length reduced (Figure 1.3). Focusing in other animals can include moving the lens rather than changing its optical power in the manner above. As the eye ages the crystalline lens becomes thicker and stiffer because its proteins continue to grow. This causes it to harden, diminishing its ability to change shape and therefore focus. Known as presbyopia, this generally starts to occur after age 40 and makes it more difficult to focus at a near distances. If the cornea has too little curvature ( flatter than it needs to be) the optical power of the crystalline lens is unable to compensate for this and images are brought to a focus behind the retina. Hyperopia, or far-sightedness as it is commonly known, occurs in approximately 1 in 4 people and causes near objects to be out of focus. The condition may also occur if the eyeball is too short. Adding a positive power lens in front of the eye can correct this . Myopia, or near-sightedness as it is known, is the

complementary condition, again affecting approximately 1 in 4 people. Images are focused in front of the retina either because the power of the cornea is too great or because the eyeball is too long (axial myopia). The addition of a negative power lens to the front of the eye may correct this.

Astigmatism is an unsymmetrical curvature of the cornea or crystalline lens. The affected surface curves more in one direction than another, somewhat similar to a rugby ball. If a number of cross-sections are taken each will exhibit a different optical power or focal length.The effect of this on focusing is interesting and causes those

affected to be able to focus on a structure in a single direction more strongly. For example, it is possible that somebody may be able to focus on horizontal lines but not vertical lines at the same time. Astigmatism, occurring in isolation, may be corrected using a cylindrical lens.

(17)

1.4 Focus Tunable lenses

Nowadays, optical focalization is a fundamental features of a lot of devices for different field of application, such as consumer electronics (e.g. cameras, mobile phones, surveillance systems, etc.), medical diagnostics (e.g. video endoscopes and other optical instrumentation, lab-on-a-chip units, etc.), and optical communications (e.g. optical fiber components). Traditional optical systems physically shift the mechanical part to achieve the right focus position. This process may be slow and not easy to miniaturize, in contrast with the actual need of quick response systems in small device. In order to overcome such drawbacks, tunable lenses have been developed and new focusing technologies have been studied.

Tunable lenses are shape-changing lenses. A change in lens radius of several micrometers can have the same optical effect as moving the entire lens several centimeters.

This is accomplished often with less lenses and with no translational movements.

As a result there is no more need for expensive mechanical actuators and a less power consumption. The response time of such systems can be very low, in the order of milliseconds. The housing of this devices is more compact, without moving parts and completely closed so that the dust cannot enter.

To summarize, these are the five main advantages of focus tunable lenses over traditional optics:

• Compact design • Less mechanics • Fast response • Low power

• Less tolerance sensitivity

The working principles of this type of lens are different and depend on the technology employed.

The principle of actuation may be:

• Hydraulic or pneumatic • Electrical

• Magnetic or electromagnetic • Optical

(18)

• Electrochemical

Hydraulically or pneumatically driven lenses are composed of an external pump which pressurizes a fluid into a lens-shaped flexible chamber. They are recently employed in an electronic eye camera system consisting of a tunable lens and an array of photodetectors on an elastomeric membrane. Hydraulics can changes not only the form of the lens but also the detector-supporting membrane, yielding to improved image quality.

Electrical driven lenses allow the variation of focus through an electrical stimulus. Examples include lenses integrated with shape memory alloys (SMA), liquid-crystal lenses, and liquid lenses. Electrowetting-based liquid lenses exploit electro-capillarity to change the contact angle between two immiscible liquids.

Lenses with electromagnetic are driven with an electromagnetic field and may be filled with ferrofluids that are displaced by electromagnetic fields, as well as magnetic-responsive membranes that pump inert fluids into flexible chambers.

Photo-activated lenses can be made with photo-sensitive polymer membranes that bend under irradiation of light.

Thermally or pH driven lenses have been demonstrated by exploiting volume changes of either a liquid in a chamber, or an hydrogel changing the volume and shape of a liquid droplet.

Electro-thermal activation has also been reported with SMA driven lenses. In electrochemically tunable lenses, the shape of a liquid droplet is varied by modifying its surface tension through red-ox processes. Focal length changes are obtained in liquid-crystal lenses by varying the refractive index with an applied electric field.

1.5 Bibliography

[1] Ralph E. Jacobson, Norman Axford, Sidney Ray, and Geoffrey G. Attridge.

2001. Manual of Photography: Photographic and Digital Imaging (9th ed.). Butterworth-Heinemann, Newton, USA.

[2] Smith, W. J. 2007. Modern optical engineering (4th ed.). McGraw-Hill, MA, New York, USA.

[3] Carpi, Federico, et al. 2011. Bioinspired Tunable Lens with Muscle‐Like Electroactive

Elastomers. Advanced Functional Materials 21.21. 4152-4158.

(19)

Chapter 2

A

UTO

-

FOCUS

S

YSTEMS

The act of auto-focusing is a process that humans do quickly and instinctively. The brain is usually not consciously involved. Behind this appearance of simplicity a complex

mechanism is hidden.

Many studies have been carried out in order to understand the human eye hardware but a complete explanation is still far. The most sophisticated camera or machine vision system cannot even imagine to compete with the perfection of human body in terms of efficiency and quality.

Although such high performance may be difficult to achieve, we have to take it into account during the implementation of an autofocus system.

We can define the main characteristics of the desired system:

 Quick system response

 High precision

 High accuracy

 High sensitivity

 Enough coverage area

 Low cost

A quick response is required. In fact a slow system cannot catch a rapidly changing scene or moving subjects.

Accuracy is the system capacity of achieving the proper focus, how close the quantity you get is to the true value.

Precision is related to the reproducibility of the result. It is the degree to which repeated measurements of the focus value under unchanged conditions show the same quantity. Sensitivity of auto-focusing is a measure of how well the system responds even in bad lighting conditions.

Coverage area is the image part analysed during the focusing process. It is another important factor that influences the speed of autofocus algorithms and accuracy. In fact a less extended area results in a quicker system but the price of that is paid in system

(20)

As every system that need a physical implementation, the available budget is not a negligible aspect for its feasibility.

The information about the surrounding real world passes through a visual system. Out of focus images contain a low level of information, less than the sharply focused one. Therefore adapting the focus target to the needs of the subject is an essential task for communication as well as science and industry.

Autofocus systems are highly spread in every field of application. They are implemented in common devices such as cameras, smart phones, surveillance systems etc., but also in high technology devices such as video endoscopes, optical instrumentation, optical fiber components, etc.

Therefore an extensive study of autofocus methods suitable for tunable lenses may open up new horizons in every field of technology that requires compact and efficient artificial vision system.

2.1 Image Formation

For a better understanding of autofocus systems is important to know the process leading to image formation.

To produce an image, light from the subject must be collected by a light-sensor. The outcome of this process is an optical image, that is a two-dimensional replication of the subject.

How the optical image is faithful to the original one will depend on the optical system employed. In particular it will be influenced by the lens used and the relation of the lens to the sensitive surface.

2.11 The simple lens

Image formation in camera lenses is in first approximation similar to what happens in simple lenses, regardless of the configuration of elements.

A simple lens consists of a single element with two surfaces. One surface may be flat. A curved surface may be concave, convex or possibly aspheric. The focal length, f, and power, P,

of a lens with refractive index n are given by the lens makers’ formula:

(2.1)

where r1 and r2 are the radii of curvature of the surfaces, being positive measured to the right of the vertex of the surface and negative measured to the left. Depending on the values for r1 and r2, focal length can be positive or negative. In terms of image formation, a positive or converging lens refracts parallel incident light to deviate it from its original path and direct it towards the optical axis. At the end of this process the real image can be focused or projected on a screen.

(21)

A negative or diverging lens deviates parallel light away from the axis and a virtual image is formed, which can be seen or can act as a virtual object for another lens but cannot itself be focused on a screen. The location, size and orientation of the image may be determined by simple

calculations. The object and image distances from the lens are termed conjugate distances and commonly denoted by the letters u and v respectively (Figure 2.1).

2.12 Systems of two lenses

A simple thin lens is normally unsuitable as a camera lens due to aberrations. A practical lens consists of a number of separated elements or groups of elements, the physical length of which is a significant fraction of its focal length. This is a compound, thick or complex lens. The term equivalent focal length (EFL) is often used to denote the composite focal length of such

a system.

For two thin lenses of focal lengths f1 and f2, the EFL, f, is given by:

Figure 2.1 Image formation by a positive lens (a, b) and a negative lens (c, d). (a) For a distant subject. F is the

rear principal focal plane. (b) For a near subject. Focusing extension E= (v- f); I is an inverted image. (c) For a distant subject ‘ O:F ’ is the front principal focal plane. ‘ I’ is virtual, upright image. (d) For a near subject.

(22)

(2.2)

where d is their axial separation.

Thin lens formulae can be used with thick lenses if conjugate measurements are made from two specific planes perpendicular to the optical axis. These are the first and second

principal planes that are planes of unit transverse magnification.

For thin lenses in air the two planes are coincident.

For thick lenses in air the principal planes are separated and coincident with two other planes, the first and second nodal planes (N1 and N2) (Figure 2.2). An oblique ray incident at N1 emerges undeviated on a parallel path from N2. The terms principal and nodal are used interchangeably but when the surrounding optical medium is different for object and image spaces, such as an under-

water lens with water in contact with its front element, then the two pairs of planes are not coincident. Focal length is measured from the rear nodal point. For a symmetrical

lens, the nodal planes are located approximately one-third of the way in from the front and rear surfaces. Depending on lens design and configuration they may or may not be crossed over or even located in front of or behind the lens.

2.13 Focal length

The focal length of an optical system is a measure of how strongly the system converges or diverges light.

A thin, positive lens converges parallel incident light to the rear principal focus, F2, on axis. The distance from this point to the optical centre of the lens is the focal length, f. For a thick lens, focal length is measured from N2. Parallel light from off-axis points is also brought to an off-axis focus at

Figure 2.2 Image formation by a compound lens. F1,F2

front and rear principal foci; FP, image focal plane; FP1, EP2, first and second principal focal planes; N1,N2, first and second nodal planes (also principal planes).

(23)

the rear principal focal plane. As light is reversible in an optical system there is also a front principal focus, F1. The closest to a lens an image can be formed is at F2. An object inside F1 gives a virtual image, as formed by a simple microscope, magnifier or loupe. As

u decreases from infinity the focus recedes from the lens so, in practical terms, the lens is

shifted away from the film plane to focus on close objects. The focal length f is then given by the lens conjugate equation:

(2.3)

where u is the distance between the light source and the lens, and v is the distance between the lens and the screen.

A Cartesian sign convention is often suitable with the lens taken as the origin so distances measured to the right are positive and to the left are negative.

Focal length can be specified also as dioptric power, P, of the lens, where, for f in millimetres:

(2.4)

Normal sign convention is applicable. A photographic lens of focal length 100 mm has a power of +10 D and one of 50 mm a power of +20 D. Powers are additive, so two thin lenses of powers +1 and +2 D placed in contact give a combined power of +3 D.

2.14 Depth of field

Any subject can be considered as made up of a large number of points.

An ideal lens would image each of these as a point image by refracting and converging the cone of light from the subject point to a focus. The purpose of focusing the camera is to adjust the image conjugate in order to satisfy the lens equation.

Unfortunately, objects in practice do not usually lie in a plane, and so the image also does not lie in a single plane. Consider two different points that lie in two different planes. Each point can be focused in turn but both cannot be rendered sharp simultaneously. When the image of one is in focus the other is represented by a blur circle.

These circles of confusion are cross-sections of the cone of light coming to a focus behind or in front of the surface of the sensor.

This purely geometrical approach suggests that when photographing an object with depth, only one plane can be in sharp focus and all other planes are out of focus. The range in focus is called depth of field and it is calculated by using the following formula:

(24)

(2.5) (2.6) (2.7)

F = F number; H = hyper focal distance; f = focal length; B = object distance (measured from image sensor); T1 = near limit; T2 = far limit;

C = circle of least confusion (1/2 format = 0.015 mm; 1/3 format = 0.011mm; 1/4 format = 0.008 mm)

The depth of field increases when the focal length decreases, the F-number is longer (F/1.4<F/5.6) and the object distance is longer.

So a large f/number results in a smaller or narrower aperture size and therefore a deeper depth of field. Where there is a large depth-of-field, it is relatively easy to focus as there are several indistinguishable (to the human eye) focus positions.

2.15 Defocus effects on image quality

In order to understand the focusing process is useful to assess the effect and the cause of defocusing on image quality.

In an acquisition process the image formed by an optical system presented a loss of detail that depends on both the amount of defocus and lens aberration.

For the sake simplicity, we employ classical geometric optics to explain the fist-order approximation of defocusing effects and characterize optical system performance. A defocused image, Id , can be modelled by the convolution of the real image, I, the

focused one, with a blurring function h:

(2.8)

Function h is called Point Spread Function (PSF) and describes the response of an imaging system to a point source. It is a function of two orthogonal variables (x, y) usually taken in the same directions as the image plane variables. If the system is isotropic (it has the same physical properties in all directions), the PSF will be rotationally symmetrical and can be simplified as a Gaussian:

(

) (2.9)

(25)

Accordingly to (2.3), we can move the point source, varying its distance u, until a sharp image is formed on the camera sensor. The further we move the target from its ideal position, the more blurred the image become and the Gaussian parameter σ increases . In the spatial frequency (Fourier) domain this convolution is equivalent to the

multiplication of the image frequency spectrum with an optical transfer function. Since the Fourier transform of a Gaussian is another Gaussian, the convolution with a Gaussian has the effect of reducing the image's high-frequency components, acting as a low pass filter.

2.16 Modulation transfer function

A method of evaluating lens performance is the measurements of the optical spread function, which is the light-intensity profile of the optical image of a point or line subject and then to derive the optical transfer function (OTF). The OTF is a graph of the relative contrast in the image of a sinusoidal intensity profile test target plotted against the spatial frequency of the image of the target. The transfer function may be derived mathematically from the spread function.

The OTF contains both modulation (intensity changes) and phase (spatial changes) information but the modulation transfer function (MTF) is of more use in practice. In general terms, the optical transfer function can be described as:

(2.10)

A test object ( ) or pattern, ideally with sinusoidal variation in intensity ( ) or

luminance ( ) from maximum ( ) to minimum ( ) value, has a modulation ( defined by:

(2.11)

A similar formula for gives the corresponding contrast of the image ( ).

Compering several object having differing spatial frequencies, both image modulation and phase shifts vary as a function of spatial frequency.

The change of image contrast at a given spatial frequency ( ) is given as the ratio of image to object modulations. The modulation transfer function is defined by the equation:

(26)

The number of lines per unit interval in an object is referred to as the spatial frequency. A common reference unit for spatial frequency is the number of line pairs per millimetre. By convention, the modulation transfer function is normalized to unity at zero spatial

(27)

2.2 Commercial Auto-focus systems

Autofocus systems (AF) are optical systems that are made up of one or more sensors, an optical element and a control system. The focusing process may be automatic or manual, depending on the technology degree of the device.

Most of the cameras on the market, automatically focus their lens on a subject when the shutter release button is at the half-pressed position.

Commercial autofocus methods can be mainly divided in two categories:

 Active autofocus

 Passive autofocus

In this work more attention is dedicated to those AF algorithms that measure the focus performance using only image information (passive autofocus).

In fact, avoiding the requirement of special hardware, makes the solution applicable to general purpose cameras, widely used in computer vision and robotics.

2.21 Active AF systems

Active AF systems measure distance to the subject independently of the optical system and subsequently adjust the system parameters in order to achieve the correct focus.

This task can be executed by various techniques, such as ultra sound waves and infrared light.

In the first case, sound waves are emitted from the camera, and by measuring the delay in their reflection, distance to the subject is calculated.

In the other case, infrared light is usually used to triangulate the distance to the subject. A major advantage with many active autofocus systems is that they can focus without much external light, some without light at all. Instead passive systems will fail when the signal-to-noise ratio (SNR) in the image is too low.

Since this type of AF systems required special hardware, they are not taken into account in this thesis project.

2.22 Passive AF

Passive AF systems determine correct focus by performing passive analysis of the image entering the optical system. They generally do not direct any energy, such as ultrasonic sound or infrared light waves, toward the subject.

(28)

The phase detection method is used in most single-lens reflex . This system employed one or more linear CCD arrays and no moving parts.

The CCD array is located in the mirror chamber beyond an equivalent focal plane and behind a pair of small lenses that act in a similar manner to a prismatic split-image range finder,

Divergent pencils of rays beyond the correct focus position are refracted to refocus upon the array,

and the separation (or phase ) of these focus positions relative to a reference signal is a measure of the focus condition of the camera lens. The lens position is changed

accordingly with this information.

The focusing process is extreme fast and works well even in the dark if used in combination with an infrared radiation source.

On the other hand, the drawbacks are the necessity of dedicated components in the camera and the need of a carful system calibration that is lens dependent.

This aspect makes this solution not suitable for our aims.

On the other hand, the autofocus of compact cameras is achieved by the contrast detection

method.

This system computes the intensity difference between adjacent pixels of the sensor. This value increases with correct focusing and is high in sharp images.

The image information provides by the system is analysed directly without the requirement of supplementary devices and no distance measure is involved.

Since the system ignores in advance the position of the subject, it takes a longer time to achieve focusing than phase detection system.

Another drawback is a less reliable solution when tracking moving subjects. In this case the loss of contrast gives no information about the direction of motion towards or away from the camera.

Since it does not use a separate sensor, contrast detection can be more flexible.

This method is widely used in video cameras and digital cameras that lack shutters and reflex mirrors.

(29)

2.3 Focus measure algorithms

Besides the most used commercial autofocus methods employed in movable lens systems (which require to physically move one or more parts to adjust the focus), other algorithms can be investigated. This work describes a systematic evaluation of several autofocus function for tunable lens applications and assesses the performance of the focus procedure. In order to decide which focus measure best fits our needs, a sequence of algorithms are presented and then tested in the project implementation.

As put in evidence in the previous section, focus quality is related to high-frequency content in the image and a general idea behind focusing may be the maximization of it. In this section different methods to achieve this are presented and investigated.

Fourier Transform

The Fourier transform of an image provides its spatial-frequency distribution.

Since sharp edges have high spatial-frequencies, computing FFT is obviously the best way to maximize high-frequency content and achieve focus.

In theory, this could be a good measure. It is information-preserving and is directly computable.

In practice, it suffers from several problems. First, the computational complexity of the FFT is O(nlogn) with a large constant, and it is not negligible in a real time control system . This could be improved by computing 1D FFT. In any case, without special-purpose hardware, a real-time analysis cannot be made.

Second, the frequency spectrum contains information that remains not used; magnitude and phase data for each frequency band is not required to simply improve focus quality. For these reasons other focusing methods need to be evaluated and adopted.

Tenengrad

Since the quality of focus affects edge characteristics, it is natural to use an edge detector for

computing the quality of focus. Therefore a popular focus measure is based on the magnitude of image gradient defined as:

where and are the X and Y image gradients computed by convolving the given image

A with the Sobel operators.

(30)

Tenengrad Variance

This operator uses the variance of the image gradient as a focus measure.

Energy of Laplacian

The energy of the second derivative of the image has been used as a focus measure for autofocus:

where ΔI is the image Laplacian obtained by convolving I with the Laplacian mask:

Variance of Laplacian

This measure utilizes the variance of the image Laplacian as a focus measure for autofocus, this measure can be defined as:

where is the mean value of the image Laplacian within Ω(x,y).

(2.14)

(2.15)

(2.16)

(2.17)

(31)

Gray-level variance

The variance of image gray-levels is one of the most popular methods to compute the focus measure of an image.

where µ is the mean gray-level of pixels within Ω(x,y).

Normalized gray-level variance

The gray-level variance can be compensated for differences in the average image

brightness among different images by normalizing the value by the mean gray-level value

µ.

Eigenvalues-based

A sharpness measure of an image proposed in is obtained from the trace of the matrix of eigenvalues, Λ, of the image covariance S. Thus, the variances of the principal components of the image are used as a focus measure:

where the trace of is the sum of the first k diagonal elements of Λ. k has been set to 5 in this work.

The image covariance S is :

Where I is the image and M×N is the size of the pixel’s neighbourhood. The trace of is the sum of its first k diagonal elements.

The computational cost is high due to the normalization procedure that is iterated for every pixel’s neighbourhood Ω(x,y).

Gradient energy

(2.19)

(2.20)

(32)

The sum of squares of the first derivative in the x and y directions has also been proposed as a focus measure:

Histogram entropy

Since a focused image is expected to have a higher information content, the entropy and range of the image histogram can be used to compute the focus measure. The histogram entropy

operator is defined as:

where is the relative frequency of the k-th gray-level. In order to compute a focus value for a pixel at coordinates (x,y), the image histogram is obtained from the gray-level values within Ω(x, y).

Histogram Range

The histogram range has been used as a focus measure for autofocus:

The histogram H is computed within every Ω(x,y).

DCT energy ratio

The discrete cosine transform (DCT) is now part of many image and video encoding systems. The sum of the AC components of the DCT is equal to the variance of the image intensity, the DC / AC ratio can be used as a focus measure. Let be the DCT of an M×N sub-block of the image (typically, M = N = 8). The focus measure associated with this sub-block, , can be computed as:

(2.22)

(2.23)

(2.24)

(33)

Sum of Wavelet coefficients

Wavelet-based focus measure operators are mostly based on the statistical properties of the discrete wavelet transform (DWT) coefficients. In the first level DWT, the image is

decomposed into 4 sub-images, where , , and denote the three detail sub-bands and the coarse approximation sub-band, respectively. For a higher level DWT, the coarse approximation is successively decomposed into detail and coarse sub-bands. The information of the detail and coarse sub-bands is then used to compute the focus measure.

where is the corresponding window of Ω in the DWT sub-bands. The focus measure of all the wavelet-based operators is usually computed using the coefficients of the over-complete wavelet transform, thus avoiding the need for computing the corresponding neighbourhood within each sub-band. Thus, is simply the same as Ω.

2-level DWT and Daubechies-10 filters or 1-level DWT with Daubechies-6 filters is usually used have for focus measure.

Variance of Wavelet coefficients

The variance of the wavelet coefficients within can also be used to compute the focus measure:

where , and denote the mean value of the respective DWT sub-bands within

(2.26)

(34)

2.4 Image Noise

Noise is one of the most important limitations affecting any imaging system without distinctions.

It is the result of errors in the image acquisition process that lead to pixel values not reflecting the true intensities of the scene.

The image corruption can be a random variation of the pixel intensity or a structural pattern such as

sinusoidal interference patterns (sometimes referred to as coherent noise) and fixed pattern noise associated with charge-coupled devices (CCDs).

The random noise, although unpredictable, can be defined with mean value, standard variation or probability distribution. Examples of useful information about noise are the autocorrelation function and the power spectrum.

2.41 Classification of noise

There are a range of different type of noise:

 Gaussian noise  Salt-and-pepper noise  Shot noise  Quantization noise  Film grain Gaussian noise

In digital images this type of noise is caused by bad condition of acquisition such as poor illumination and/or high temperature, and/or transmission problems or by electronic circuit noise.

A typical model of image noise is Gaussian, additive, independent at each pixel, and independent of the signal intensity (thermal noise).

The major part of noise is due to the amplifier noise

At higher exposures, however, image sensor noise is dominated by shot noise, which is not Gaussian and not independent of signal intensity.

Salt-and-pepper noise

(35)

An image containing it will have dark pixels in bright regions and bright pixels in dark regions.

This type of noise can be caused by analog-to-digital converter errors, bit errors in transmission, etc. It can be mostly eliminated by using dark frame subtraction and interpolating around dark/bright pixels. It can be produced by dead pixels in an LCD monitor.

Shot noise

In shot noise according to the way the light arrives at the sensor, there will be a random deviation from the mean level and the image pixel intensity will change. It is dominant in the lighter part of an image and follows a Poisson distribution. The variance of a nominally uniform patch containing N quanta will be given by √ .

There can be additional shot noise from the dark leakage current in the image sensor. This noise is sometimes known as dark shot noise or dark-current shot noise.

Quantization noise

The noise caused by quantizing the pixels to a number of discrete levels is known as quantization noise. It has an approximately uniform distribution (uniform noise).

Film grain

The grain of photographic film is a signal-dependent noise, with similar statistical

distribution to shot noise. If film grains are uniformly distributed (equal number per area), and if each grain has an equal and independent probability of developing to a dark silver grain after absorbing photons, then the number of such dark grains in an area will be random with a binomial distribution. In areas where the probability is low, this distribution will be close to the classic Poisson distribution of shot noise. A simple Gaussian

distribution is often used as an adequately accurate model.

Film grain is usually regarded as a nearly isotropic (non-oriented) noise source.

Structured noise

Structured noise is a type of noise without random nature and concentrated in a particular area of the image. There are many causes of structured noise, such as device malfunctions or interference between electronic components.

2.42 Signal-to-noise ratio

In communication theory, the signal-to-noise ratio ( ) is the ratio of the information carrying signal to the noise that corrupted it.

(36)

In general digital images the signal-to-noise ratio can be calculated by evaluating the total variance of the image and the variance of a nominally uniform portion of the image (the noise). The variance of the signal is then the difference (assuming the noise is uncorrelated with the signal). The signal-to-noise ratio is then:

√ √

2.43 Denoising methods

Since the focus functions section 2.3 are employed in a process of maximization or minimization, noise reduction may be required in order to achieve the correct focus distance.

Below the main noise reduction techniques are explained.

Linear smoothing filters

One method is by convolving the original image with a mask that represents a low-pass filter or smoothing operation. Random noise appears as sudden fluctuations in pixel values compared to their neighbours and is most visible in uniform areas of the image.

For example, the Gaussian mask comprises elements determined by a Gaussian function. In general, a smoothing filter sets each pixel to the average value, or a weighted average, of itself and its nearby neighbors; the Gaussian filter is just one possible set of weights. By averaging the pixel values, these sudden discontinuities are reduced, maintaining values in homogeneous regions.

A larger mask increases the degree of blurring of the image, as a larger number of values are

used in computing the .

Because of this blurring effect, linear filters are seldom used in practice for noise

reduction; they are, however, often used as the basis for nonlinear noise reduction filters.

Nonlinear filters

A median filter is an example of a non-linear filter and, if properly designed, is aimed at preserving image detail.

To run a median filter:

 consider each pixel in the image

 sort the neighbouring pixels into order based upon their intensities (2.28)

(37)

 replace the original value of the pixel with the median value from the list The median is much less sensitive than the mean to extreme values (called outliers). Median filtering is therefore better able to remove these outliers without reducing the sharpness of the image.

Temporal averaging

If we have a slowly varying scene, it is possible to take more than one snapshot and average the acquired images.

In this technique each pixel is replaced by the averaged intensity of the same pixel location, in the

previous N images:

The longer we extend the averaging process, the larger the reduction in noise becomes. Since the noise is primarily due to shot noise, it can be safely assumed to be additive and Gaussian with zero mean, so the expected reduction in noise variance is .

In fact we have: [ ] [[ ∑ ] ] [ ]

The cross terms, disappear because the observations of the noise process are assumed to be independent.

As long as the image is stationary, temporal averaging is a more desirable method for achieving noise reduction than standard spatial averaging. This is because temporal averaging avoids the blurring effects inherent in spatial averaging. Automatic focusing programs do well to avoid filtering algorithms which blur the image.

(2.29)

(38)

2.5 Search algorithms

The optimal focus is found by searching for the focus location that yields an image with the highest sharpness measure.

The desired focus function is an unimodal function, in other words it has a maximum or minimum at the point of best focus and is monotonic on both sides. In practice the sharpness function may be affected by noise in the image or presented more than a peak, a suitable solution has to take into account these conditions.

2.51 Methods Overview

Various search strategies are proposed and investigated:

 Global search method

 Fibonacci search method

 Hill-climbing search method

Global search method

In the global search method, for each possible focal length of the device, the sharpness of the acquired image is calculated. After that all the possible range is investigated, the searching algorithm moves back to the condition where the best image was obtained. The main advantage of this method is that it generally guarantees that a global maximum will be found even in presence of local maxima. The drawback is that this accuracy is paid in terms of system speed. In order to make the algorithm quicker, instead of performing a full sweep to find the highest peak, it can easily be modified to stop early after the

maximum is achieved. This is possible under the assumption of unimodality (a single peak over the interval) but unfortunately often a noise signal is superimposed.

In this case a proportional threshold needs to be set in order to be sure to have found a global maximum.

Fibonacci search method

The Fibonacci search technique is a method of searching using a divide and conquer

algorithm that successively narrows the search interval until its size equals a given fraction of the initial search range.

For the initial search interval, the criterion function is evaluated at two points and selected as a function of the Fibonacci sequence. If the initial search interval is [ ], and then the next search interval will be [ ] excluding the interval (x2,b]. For each subsequent interval, the focus measure function f is evaluated at a single point determined by the Fibonacci sequence, and its value is used to determine the next search interval. Fibonacci search has a complexity of O(logn).

(39)

Hill-climbing search method

It is an iterative algorithm that starts with an arbitrary solution to a problem, then attempts to find a better solution by incrementally changing a single element of the solution. If the change produces a better solution, an incremental change is made to the new solution, repeating until no further improvements can be found. A drawback of this technique is that is good for finding a local optimum it is not guaranteed to find the best possible solution (the global optimum) out of all possible solutions (the search space).

2.52 Window Selection

In order to focus on a region of the full image scene, one has to reduce the input into

a focus window. This region has to be small enough in order to give focus on the relevant area only, while large enough to provide sufficient data for the focus algorithm to operate on. It is necessary to select evaluation windows containing features and not empty spaces. On contrary, if the window contains the projection of two or more object points lying at different distances, then the focus measure function will in general have more than one peak. In this case the sharpness search algorithm may find a local maximum. As the focusing distance changes, the magnification of the lens also changes slightly, causing the image coordinates of an object point to change.

The evaluation window must be large enough so that in the course of changing the focusing distance the point does not travel outside the window, or the window must be adjusted. Usually the central area or an important feature of the image is chosen as analysed focusing window.

Such sub-windowing method is always used to reduce the computation and the complexity of an auto-focus system.

2.6 Bibliography

[1] Ralph E. Jacobson, Norman Axford, Sidney Ray, and Geoffrey G. Attridge.

2001. Manual of Photography: Photographic and Digital Imaging (9th ed.). Butterworth-Heinemann, Newton, USA.

[2] Smith, W. J. 2007. Modern optical engineering (4th ed.). McGraw-Hill, MA, New York, USA.

[3] Krotko Eric. 1988. Focusing. Kluwer Academic Publishers, International Journal of Computer Vision.

(40)

[4] Said Pertuz, Domenec Puig,Miguel Angel Garcia. 2013 Analysis of focus measure

operators for shape-from-focus. Pattern Recognition, ISSN 0031-3203

[5] Batten, CF and Holburn, DM and Breton, BC and Caldwell, NHM. 2001 Sharpness

search algorithms for automatic focusing in the scanning electron microscope. Scanning,

ISSN 0161-0457.

[6] John F. Schlag , Arthur C. S , Charles P. Neuman , Francis C. Wimberly. 1983.

Implementation of automatic focusing algorithms for a computer vision system with camera control. Carnegie-Mellon University, Pittsburgh, Pennsylvania.

(41)

Chapter 3

M

ATERIALS AND METHODS

The thesis activity concerns the development of an application which allows the user to adjust the optical power of both a commercial lens and a bio-inspired lens prototype. The curvature of these types of lenses can be changed applying an electrical signal so a focus condition can be quickly achieved.

For this purpose, an autofocus system has been implemented and different algorithms have been tested.

The control system, configured to continuously focusing the scene, is made up of the following parts:

 Camera

 Tunable Lens

 Lens Driver

 Autofocus Algorithm

Each part plays an important role in the system as a whole and needs to be chosen carefully according to the required specifications.

To gain the best performance from the optical system, the most suitable focusing method for tunable lenses is adopted. This aim is achieved by an experimental evaluation of some of the most used algorithms in literature, using the implemented Graphical User Interface. The lens is configured to continuously change its curvature in response to an electrical input signal. A lens driver generates the signal in such a way that the tunable lens performs a continuous scan of its optical power. The camera sensor acquires the image and conveys this information to the software which has been developed on purpose for this project. The system processes this information and analyses the image pixels computing the focus function. Then it instructs the lens driver to adjust the electrical signal accordingly. The feedback loop of acquiring images, generating focus measures and inducing optical power variation in the lens, is iterated until the solution converges to the maximum of the function. In this way focus condition is finally reached.

(42)

3.1 Camera

The camera employed in the system is The Imaging Source DFK 23GM021 color camera. The camera ships with the sensitive 1 /3 " Aptina CMOS MT9M021 sensor. With up to 60 images per second, the DFK 23GM021 is a low cost, yet highly versatile imaging solution. The camera includes a C to CS mount adapter, making it compatible to C and CS mount lenses.

The color camera can be connected to a computer through a GigE interface and is the perfect solution for the integration into a software application.

In fact The Imaging Source provides a set of useful tools, libraries and extension, which can be freely downloaded from the web site of the company. The camera parameters can be easily controlled and programmed by computer and the video output can be embedded in a standalone application. Further, a pool of experts are always available for technical support and suggestions .

All these reasons make the DFK 23GM021 camera a good choice for the development of an autofocus system for tunable lenses.

CMOS sensor

In the DFK 23GM021 camera a complementary metal oxide semiconductor (CMOS) sensor is present.

CMOS is a relatively new class of image sensor that has been developed in recent years and it is a more mature technology than Charge-coupled device (CCD).

Although both silicon-based technologies, CMOS sensors differ from CCDs in that the charge is amplified and analogue-to-digital (AD) converted at the pixel site.

Digital data are then transported off the chip. The advantage of this is that each pixel can be read off the chip individually. CMOS sensors are also cheaper than CCDs to

manufacture, less likely to contain defects and consume less power, which is of particular

Figura

Figure 1.1: Focusing a lens. There are four principal methods of focusing: (a) by extending the whole lens  by a distance x; (b) by front-cell focusing, a smaller extension is needed; (c) by adding a close-up lens L,  no extension is needed; (d) by interna
Figure 1.2 Schematic horizontal section of the eyeball  (from above, the nose is to the left of the figure).
Figure 1.2 (a) Focusing on a distance object, the lens flattens. (b) The lens becomes more rounded when  focusing on near objects
Figure 2.1  Image formation by a positive lens (a, b) and a negative lens (c, d). (a) For a distant subject
+7

Riferimenti

Documenti correlati

un'acqua bicarbonato solfato sodica in soggetti con sindrome dispeptico - dolorosa da disordini funzionali dell'apparato biliare extraepatico e da gastroenteropatie

In this Thesis, the backstepping based boundary stabilization, state observation, and output feedback boundary control problems are addressed and solved with reference to a class of

The internals we decided to test are Flexipac 2X-S, manufactured by Koch-Glitsch and SuperPak 250Y, manufactured by Raschig-Jaeger; additional experiments on bubble column

I can work with web engineers to resolve technical issues and implement technical enhancements, work with the development department to implement design and functional enhancements,

We postulate that physical objects must expose in a formal specification the set of operations they can perform and the data they can exchange with a precise

a) A state transition occurs once per major computa- tion and can have useful mathematical properties. State transitions are not involved in the tiniest details of a

Materiale conservato presso: Centro Musei delle Scienze Naturali dell'Università di Napoli, Museo di Geologia e Paleontologia dell’Università di Padova, Museo

Here, considering the higher percentage of sulfur of the com- pounds obtained with this deposition sequence, we dis- tinguished between the deposits ending with S (Figure 5a) and