Distance measurement using a lens with the eccentric pin hole

There are various methods of distance measurement. Method using image information is one of them. The advantage of image based method is that it can be handled relatively easily because there is no need for an extra special device as compared to other methods. It also obtains merits that people can determine what object exists in the image, and furthermore, the measurement can be performed after the picture was taken. The disadvantage is the little inferior of accuracy and speed when compared to other methods. Distance measurement using the image information can be broadly classified into a stereo method and multi-view method and monocular single viewpoint method. In this study, a new distance measurement method using the symmetrical designed multi eccentric pin holes mask is proposed. Proposed method puts the mask into the imaging path of a normal single focus camera. It takes the ease of shooting like the monocular single viewpoint method, and obtains the measurement accuracy as same level as stereo method and multi-view method.


Introduction
In the field of distance measurement, variety of ways by using a sensor and radar have been studied.There is a method of using image information as one of them.An advantage of the distance measuring method using image information is relatively easy to handle because it does not require special equipment such as lasers and sensors.
In addition, there is an advantage that people can determine what the data at a glance.The disadvantage is that the accuracy and the speed is a little less than other methods.It has been made discussed in various quarters about the distance measurement using image information.When you classify roughly the current method, it can be classified into a stereo method and multi-view method and monocular single viewpoint method.The stereo method, and calculates the distance to the object by triangulation using the parallax resulting from the plurality of images photographed at the site of different cameras.Meanwhile, multi-view method is a method of measuring a distance to an object using a plurality of images taken by changing the conditions such as the angle of the focal length and camera by a single camera.Further, monocular single viewpoint method is a way of measuring the distance to an object using the one image taken by one camera.Measuring the distance to the object from the relationship between defocus amount and the distance, estimating a focus blur amount from the image.However, these accuracy is not so good.Therefore, in this study in order to overcome the shortage of the above methods, we propose a distance measurement method using an eccentric pin hole.Although the proposed method is the shooting of monocular single viewpoint, to obtain a plurality of images as stereo method, multi-view method.In the future, if the operation to change the eccentric pin hole is automated, this approach will be a new method that was blessed with accuracy and ease of shooting.

Basic of lens
Lens is one that has been used such as glasses or a camera or a telescope, is intended to scale the image.By utilizing the difference in refractive index between glass and air, to refract light rays and is converged-diverging.In order to reproduce well the image, the shape of the side surface of the lens is made in a spherical.The lens there is a convex lens and a concave lens.(a) Focus The line that passes through the center of the lens is the optical axis.As shown in Figure 1, shed light rays vertical to the convex lens from infinity, rays refracted by the lens, passes through a point on the optical axis.This point "F" is called the focal point of the convex lens.The "f" is distance from the center of the lens.The "f" is called focal length.
(b)The nature of the basic imaging The light emitted from an object is imaged by the following law (Figure 2).
• The light input in parallel to the optical axis pass through the rear focal point.

•
Light that has passed through the center goes straight.

•
Light passing through the focal point of the front outputs in parallel to the optical axis.Three light of the above-mentioned gather in one point.Also, all the other light passing through a point of the lens gathered in this respect.Real image obtained by inverting the top and bottom, the right and left of the subject is finished.

Occurrence of focus blur
When taken in a state deviated from the focal length, the rise of the luminance of the edge portion becomes gentle, and become the defocus image which the contour line is widened thin.Defocusing is produced by the lens witch is an optical filter.Originally, the original image light corresponding to the point light source is condensed by the lens system and focused on the mapping surface.However, if the focal length of the lens system is out, it will be imaged before and after the mapping surface, the mapping surface is not converge.For this reason, in the form of a non-convergent light are overlapped, the blurred image generation (Figure 3).Here think in frequency dimension the generation of the abovementioned focus blurred image.As shown in equation ( 1), the spectrum G(u,v) of defocusing the image is known to be expressed by the product of the original image spectrum F(u,v) and the lens system of the frequency pass characteristic H(u,v).
Given this characteristic by inverse Fourier transform in the time signal dimension is given by the following equation.
Focus blur signal g(x,y), are to be understood as expressed in the form of the impulse response characteristics h(x-x',y-y') was convolution integral of the lens system, which acts as an original image signal f(x,y) and filter.

g(x, y) = ∬ h(x-x', y-y')f(x, y) dxdy (2)
Where h(x-x',y-y') is defined as the point spread function of the lens system.Because when the focus is only the amplitude value of 1 at the origin, the convolution integral value does not change.g(x,y) and f(x,y) are equal, but as out of focus length, the width of the point spread function is increased, will produce a defocusing image.

Eccentric pin hole
The eccentric pin hole is that of pinholes does not pass through the optical axis.Figure 3(a) is an image where the focus is correct.Light source "a" is imaged on the image "b".In this case a, b are the same size.When the light source a to Δd move, is as shown in figure 3(b).Image is larger by a point spread function is changed.When the photographed in this situation, image is defocusing.Figure 4 is obtained by sticking a black mask that is opened pinhole on the imaging surface side of the lens in Figure 3.In this case, it is not necessary to collect light because only the light passing the

Relationship between the distance and the pixel
In this method, using the eccentric pin hole.Carry out the shooting in the state in which to paste the eccentric pin hole between the lens and the imaging element.As shown in 2.2, Shift in the imaging occurs when perform imaging while the eccentric pin hole is sandwiched between the lens and the imaging device.When taken with two photos with different eccentric pin holes, two images having different focusing deviation is obtained.Using the background subtraction of these two images, find out how many pixels imaged deviation for each distance.In order to limit the imaging shift only in the horizontal direction, paste the cardboard spaced two pin hole in the back of the lens, as shown in Figure 5, it was taken in a state of blocking the pin hole one by one.Eccentric pin hole was drilled at a position shifted to the left or right from the center by 2mm.

Acquisition of the image
The camera settings at the time of the shooting are shown below.
• F-number・・・1.8 Image size・・・5184×3456 In order to facilitate understanding of the imaging shift, a test pattern as an object became a cross (Figure 6).Adjust the focus when there is an object in the position of 36cm from the lens.

Detection of imaging shift
The background subtraction the two images that has imaging deviation of each distance.Then the difference between the two images appear as a gray scale image.If this image is binarized, the difference of the imaging deviation becomes the white area.Thus it was counted the width of the white area (Figure 7).Pixel value is the average value of the width of two lines.

The distance measurement experiment
Ranging distance of 40 cm ~ 220 cm from the camera, were distance measurement for each 10 cm.The average of relative error of respectively measurement results (Table 1).

Consideration
Quadratic function, cubic function, with quartic function, it is measured with a relatively small error in the short distance is made, the error was greater in long distance.It seems to be this is because as becomes far, the ratio of the object in the entire image is decreases.In this result, the variation of error was seen overall.This seems to be because main spindle of the camera is displaced.When changing the eccentric pin holes because has been performed manually.Also, slightly blurred focus on the photographed image is considered to be because occurred because the using eccentric pin holes is Simplified.

Conclusions
In this study, we proposed a new distance measurement method using an eccentric pin hole.Since there was a variation in error, it did not become an ideal outcome.However, distance measurement utilizing a relationship between the imaging displacement and distance is found to be possible.This has performed an experiment in a simple environment, room for improving the stability and accuracy are sufficiently left.We're going to proceed the research with an emphasis on such as improvement of stability and accuracy in the future.In addition, dealing with the imaging shift as pixels.The future has many things to be verified.These are our future challenges.

Table 1 .
Relative error average