An automatic focusing method based on dual-light photoelectric pod

By adopting the dual-photo-electronic pod autofocus method in the camera, using real-time image processing and binocular ranging technology of FPGA and DSP, the problems of slow light change response and inaccurate focus in the existing technology are solved, and a fast and accurate autofocus effect is achieved.

CN110536065BActive Publication Date: 2025-05-16JIANGSU LAISSE OPTOELECTRONICS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910728481.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-08
Publication Date
2025-05-16
Estimated Expiration
2039-08-08

AI Technical Summary

Technical Problem

The existing camera autofocus method responds slowly when the light changes, making it difficult to adjust to the optimal clear state, and is greatly affected by the motor rotation characteristics and signal transmission delay.

Method used

The automatic focus method based on the dual-photo-electronic pod is adopted, through the collaborative work of FPGA and DSP, image data is collected in real time and edge extraction and coarse focus algorithm calculations are performed. Combined with binocular ranging and inertial measurement units, the target distance is accurately calculated and the camera focal length is adjusted to achieve fast automatic focus.

Benefits of technology

It realizes rapid response and adjustment to the optimal clear state when light changes, avoiding inaccurate focus problems caused by motor rotation and signal transmission delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110536065B_ABST
    Figure CN110536065B_ABST
Patent Text Reader

Abstract

The invention relates to the field of cameras, and in particular to an automatic focusing method based on a dual-light photoelectric pod. Based on the binocular principle, a camera is tested at different distances to describe different focal lengths of the camera at different distances, as well as the speed and corresponding time from initialization to adjustment to this stage, and a time library for precise focusing is established. By comparing the corresponding relationship between the actual distance and the precise focusing library, a corresponding focusing operation is performed according to a function curve. The method can realize automatic focusing and reduce the error of manual focusing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cameras, and particularly to an automatic focusing method based on a dual-optical electro-optical pod. Background Art

[0002] Existing Method 1: It includes the following steps: Initialize the search boundaries L = InitL, R = InitR, and at the same time obtain the resolutions f(L), f(R) of the search boundaries, where f(x) is the resolution value when searching to the x position; Set the focus points x1, x2 using the golden section method, and obtain f(x1), f(x2); Determine whether f(x1) is greater than f(x2); When f(x1) < f(x2), move the boundary in the direction close to the R point; When f(x1) > f(x2), move the boundary in the direction close to the L point; When L ≠ InitL and R ≠ InitR hold, obtain the focus points L, x1, x2 and R, and the resolutions of each focus point; Estimate the current value where the best focus point is located according to the focus points L, x1, x2 and R, and the resolutions of each focus point. The automatic focusing method can accurately search for the best focus point.

[0003] Existing Method 2: The device includes a lens, a stepping motor, a calculation module and a control module. The automatic focusing method includes: The control module determines the moving interval L of the stepping motor; The lens obtains an image P1 when the stepping motor is at the first end point of the two end points of L; The lens obtains an image P2 when the stepping motor is at the first inner point in L; The lens obtains an image P3 when the stepping motor is at the second inner point in L; The calculation module calculates the sharpness evaluation values M1, M2 and M3 of P1, P2 and P3; When the control module determines that L is greater than the first threshold, determine a new moving interval of the stepping motor according to M1, M2 and M3, and repeat the above steps; When the control module determines that L is less than or equal to the first threshold, determine the target position of the stepping motor according to M1, M2 and M3. The technical solution can complete automatic focusing faster.

[0004] Existing Method 3: The automatic focusing device includes: a lens, a lens driving component and a focusing control module. Based on the light guiding of the lens to the object, a raw image can be generated; The focusing control module is adapted to obtain the frequency response result of the pixel points of interest in the raw image, and the lens driving component is adapted to drive the lens to obtain the expected frequency response result, and use the lens position when reaching the expected frequency response result as the focusing position to drive the lens. It can improve the focusing accuracy and focusing speed of the object in the case of low-contrast weak texture and low light.

[0005] The defects of the existing method are: 1. It is greatly affected by light; 2. It is not sensitive to light changes and cannot make changes in a timely and effective manner; 3. When focusing, due to the rotation characteristics of the motor itself and the delay of signal transmission, it is difficult to adjust to the optimal clarity state.

[0006] Therefore, in order to solve the above problems, an automatic focusing method based on a dual-light photoelectric pod is provided. Summary of the invention

[0007] In view of this, the purpose of the present invention is to overcome the defects in the prior art and provide an automatic focusing method based on a dual-light photoelectric pod, which can better achieve pod focusing.

[0008] The present invention provides an automatic focusing method based on a dual-light photoelectric pod, and its implementation process includes the following steps:

[0009] Step 1: The system starts, collects image data through FPGA and transfers it to the central processor, and transmits the image to DSP through SRIO;

[0010] Step 2: extract the edge of the image, calculate the standard deviation through the coarse focus algorithm, and iterate based on the standard deviation value and the threshold comparison, calculate the distance between the camera and the target object, and transmit the corresponding command to the servo motor to achieve camera focus;

[0011] Step 3: Perform offline measurement on the camera, test the camera at different distances, describe the different focal lengths of the camera at different distances, as well as the speed and corresponding time from initialization to adjustment to this stage, and establish a time library for accurate focus;

[0012] Step 4: After the rough alignment, the camera can see the target more clearly. The basic principle of binocular ranging is used to measure the target and calculate the distance between the camera and the target object. At the same time, the camera attitude is calculated through the inertial measurement unit.

[0013] Step 5: Based on the target distance calculated in step 4 and the computer posture, accurately calculate the actual distance of the target object;

[0014] Step 6: Perform offline measurement of the camera. Test the camera at different distances to describe the different focal lengths of the camera at different distances, as well as the speed and corresponding time from initialization to adjustment to this stage, and establish a time library for accurate focus.

[0015] Step 7: Based on the correspondence between the actual distance and the precise focus library, perform the corresponding focusing operation according to the function curve.

[0016] Furthermore, the algorithm of the auto-focus coarse focus includes:

[0017] a: Calculate the quality description value of the image;

[0018] Define the pixels of the image as x*y

[0019]

[0020] mean=sum(grad) (2)

[0021] quality=sqrt(∑(I(x,y)-mean) 2 ) (3)

[0022] The clarity of the image is determined by the quality value. The larger the value, the clearer the image, and the smaller the value, the lower the clarity of the image.

[0023] b: According to the basic principle of binocular ranging, the distance (depth) z of the spatial point P from the camera is obtained;

[0024] c: According to the relationship between the simulation distance and the focusing speed and time, determine the adjustment speed, and then calculate the adjustment time. According to the internal clock of the DSP, adjust to the optimal state.

[0025] The beneficial effect of the present invention is that the dual-light photoelectric pod autofocus method disclosed by the present invention can make timely and effective changes according to the changes in light and transmit signals in time, so that the pod can quickly autofocus and adjust to the best clear state. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0027] Figure 1 is an overall flow chart of the automatic focusing of the present invention;

[0028] Figure 2 It is a basic flow chart of the rough focusing of the camera of the present invention;

[0029] Figure 3 It is the basic principle diagram of binocular ranging of the present invention. DETAILED DESCRIPTION

[0030] Figure 1 is an overall flow chart of the automatic focusing of the present invention; Figure 2 is a basic flow chart of the rough focusing of the camera of the present invention; Figure 3 It is the basic principle diagram of binocular ranging of the present invention.

[0031] As shown in the figure, in this embodiment, a dual-light optoelectronic pod auto-focus method is provided, and the hardware system for implementing the method includes:

[0032] Infrared zoom camera: an industrial camera that produces high-resolution infrared images. The focal length can be adjusted according to instructions to achieve target locking and tracking during the day and at night.

[0033] Visible light automatic zoom camera: an industrial camera that produces high-resolution images in the visible light band. The focal length can be adjusted according to instructions. It is used to achieve daytime target locking and tracking, and to expand the observation angle of infrared cameras.

[0034] Central Processing Unit: Based on the overall architecture of FPGA plus DSP C6678, FPGA and DSP can work independently or in coordination as a whole.

[0035] IMU (Inertial Measurement Unit): It consists of an accelerometer and a gyroscope. The gyroscope provides angle information and the accelerometer provides acceleration information. Together, they can measure attitude, position, and speed.

[0036] The servo motor of the infrared camera is powered and realizes the focus adjustment of the infrared camera by rotating. In the present invention, the focus adjustment of the infrared camera is realized by receiving instructions through the serial port.

[0037] In this embodiment, a dual-light photoelectric pod auto-focus method mainly includes the following steps:

[0038] Step 1: The system starts, collects image data through FPGA and transfers it to the central processor, and transmits the image to DSP through SRIO;

[0039] Step 2: extract the edge of the image, calculate the standard deviation through the coarse focus algorithm, and iterate based on the standard deviation value and the threshold comparison, calculate the distance between the camera and the target object, and transmit the corresponding command to the servo motor to achieve camera focus;

[0040] Step 3: Perform offline measurement on the camera, test the camera at different distances, describe the different focal lengths of the camera at different distances, as well as the speed and corresponding time from initialization to adjustment to this stage, and establish a time library for accurate focus;

[0041] Step 4: After the rough alignment, the camera can see the target more clearly. The basic principle of binocular ranging is used to measure the target and calculate the distance between the camera and the target object. At the same time, the camera attitude is calculated through the inertial measurement unit.

[0042] Step 5: Based on the target distance calculated in step 4 and the computer posture, accurately calculate the actual distance of the target object;

[0043] Step 6: Perform offline measurement of the camera. Test the camera at different distances to describe the different focal lengths of the camera at different distances, as well as the speed and corresponding time from initialization to adjustment to this stage, and establish a time library for accurate focus.

[0044] Step 7: Based on the correspondence between the actual distance and the precise focus library, perform the corresponding focusing operation according to the function curve.

[0045] According to the difference in image clarity, the image quality is determined, and a focus command is sent to the camera's motor. After focusing, a determination is made to determine the quality of the two images before and after focusing. If the quality after focusing is higher than the quality before focusing, the focusing direction is correct and the focusing can continue. When the quality of the next frame is lower than the quality of the previous frame, a stop focus command is sent to the motor to stop focusing. The specific algorithm is as follows Figure 3 shown.

[0046] The algorithms of the autofocus coarse focus algorithm include:

[0047] a: Image quality description value

[0048] Define the pixels of the image as x*y

[0049] Assuming a 640*512 image, its quality description value is calculated as follows:

[0050]

[0051] mean=sum(grad) (2)

[0052] quality=sqrt(∑(I(x,y)-mean) 2 ) (3)

[0053] The clarity of the image is determined by the value of quality. The larger the value, the more obvious the image outline is and the clearer the image is. The smaller the value, the more blurred the image outline is and the less clear the image is.

[0054] In addition, the focusing command is sent to the image motor through the serial port to perform the focusing operation.

[0055] b: Basic principle of binocular ranging

[0056] By calculating the parallax of the two images, the distance to the scene ahead (the range captured by the image) can be directly measured without judging what type of obstacle is ahead. Therefore, for any type of obstacle, necessary warnings or braking can be made according to the change in distance information. The principle of binocular cameras is similar to that of human eyes. The human eye can perceive the distance of an object because the two eyes present different images of the same object, also known as "parallax". The farther the object is, the smaller the parallax; conversely, the larger the parallax.

[0057] The specific calculation method is as follows:

[0058] According to the triangle similarity law:

[0059]

[0060] Solving equation 4 yields:

[0061]

[0062] z=b*f / d,x=z*x H / d,y=z*y / f (6)

[0063] According to the above derivation, to obtain the distance (depth) z of the spatial point P from the camera, we must know:

[0064] 1. Camera focal length f, left and right camera baselines b (can be obtained through prior information or camera calibration).

[0065] 2. Parallax: d = xH-xL, that is, the relationship between the pixel point (xH, yH) of the upper camera and the corresponding point (xL, yL) of the lower camera.

[0066] c: Relationship between simulation distance, focusing speed and time

[0067] Before the camera performs autofocus, it needs to be initialized. That is to say, the camera starts focusing from the same position each time before autofocusing. Therefore, the distance of the target and the distance that the camera needs to adjust satisfy a linear function relationship, that is:

[0068] d' (distance to be adjusted for the camera) = kd (actual distance of the target) (7)

[0069] The camera's adjustment distance is a function of the adjustment speed and adjustment time, and the relationship is as follows:

[0070] d' (distance to be adjusted for the camera) = vt (8)

[0071] According to these two formulas (i.e., the relationship between the adjustment distance and the actual distance, and the relationship between the distance to be adjusted and the adjustment speed and time), the parameter k can be determined offline, and when choosing to send the instruction, the adjustment speed can be determined, so as to calculate the adjustment time, and adjust to the optimal state according to the internal clock of the DSP.

[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

Claims

1. An automatic focusing method based on a dual-light photoelectric pod, characterized in that: The steps include: Step 1: The system starts, collects image data through FPGA and transfers it to the central processor, and transmits the image to DSP through SRIO; Step 2: extract the edge of the image, calculate the standard deviation through the coarse focus algorithm, and iterate based on the standard deviation value and the threshold comparison, calculate the distance between the camera and the target object, and transmit the corresponding command to the servo motor to achieve camera focus; Step 3: Perform offline measurement on the camera, test the camera at different distances, describe the different focal lengths of the camera at different distances, as well as the speed and corresponding time from initialization to adjustment to the corresponding distance, and establish a time library for accurate focus; Step 4: After the rough alignment, the camera can see the target more clearly. The basic principle of binocular ranging is used to measure the target and calculate the distance between the camera and the target object. At the same time, the camera attitude is calculated through the inertial measurement unit. Step 5: Based on the target distance calculated in step 4 and the computer posture, accurately calculate the actual distance of the target object; Step 6: Perform offline measurement on the camera. Test the camera at different distances to describe the different focal lengths of the camera at different distances, as well as the speed and time from initialization to adjustment to the corresponding distance, and establish a time library for accurate focus. Step 7: Based on the correspondence between the actual distance and the precise focus library, perform the corresponding focusing operation according to the function curve.

2. The automatic focusing method based on a dual-light photoelectric pod according to claim 1, characterized in that: The coarse focus algorithm includes: a: Calculate the quality description value of the image; Define the pixels of the image as x*y mean=sum(grad) (2) quality=sqrt(∑(I(x,y)-mean) 2 ) (3) The clarity of the image is determined by the quality value. The larger the value, the clearer the image, and the smaller the value, the lower the clarity of the image. b: According to the basic principle of binocular ranging, the distance (depth) z of the spatial point P from the camera is obtained; c: According to the relationship between the simulation distance and the focusing speed and time, determine the adjustment speed, and then calculate the adjustment time. According to the internal clock of the DSP, adjust to the optimal state.

Citation Information

Patent Citations

  • Internet-of-things binocular vision zoom dynamic target tracking test system platform and Internet-of-things binocular vision zoom dynamic target tracking ranging method

    CN104880154A

  • Bionic visual rapid focusing method based on liquid lens

    CN106249325A