Event-assisted high-speed automatic focusing method

By combining event cameras with image sensors, the laplacian product and evaluation function are used to quickly find the quasi-focus position, which solves the shortcomings of traditional focusing methods in low-light environments and speeds, and achieves efficient and accurate autofocus, reducing the 'loose bellows' effect.

CN119211720AActive Publication Date: 2024-12-27ZHEJIANG UNIV

Patent Information

Application Number
CN202411324300.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-27
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

The traditional phase focusing method performs poorly in low-light environments, the traditional contrast focusing method is slow, and the event rate and event polarity change method of event cameras have a ‘bendbox’ effect, affecting the user experience.

Method used

The event camera is combined with the image sensor, and the spatial second-order derivative matrix of the event frame and the image frame is calculated through the laplacian operator, multiply and add the points, and the quasi-focus position is judged by the event laplacian product sum, and the causal window adaptive filter is combined to quickly Find the quasi-focus position accurately.

Benefits of technology

Improve focus robustness in dark environments, realize event frame acquisition and quasi-focus judgment with high frame rate, avoid multiple image analysis, significantly improve focus speed and accuracy, reduce the 'blowbox' effect, and provide focus prediction function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211720A_ABST
    Figure CN119211720A_ABST
Patent Text Reader

Abstract

The invention provides an event-assisted high-speed automatic focusing method, and belongs to the field of computer vision automatic focusing algorithms. According to the method, an event camera and a traditional image sensor are combined, the high time resolution characteristic of the event camera is utilized, event frames with the frame rate exceeding 10 times of the image frame rate are collected, and a focusing evaluation function is constructed through the product sum of the second-order space derivative of the image frames and the event frames. By capturing the abrupt change of the focusing evaluation function, the focusing position can be accurately detected, the'air pulling box 'effect in a traditional focusing method is avoided, and the focusing speed and precision are improved. In addition, the method shows good robustness in a dark light environment, interference caused by scene movement in the focusing process can be processed through a causal window adaptive filter, and the focusing accuracy and stability are further improved. Compared with the prior art, the method does not need a long-time focusing scanning process, can quickly and accurately complete automatic focusing, and is suitable for small terminal equipment such as a smart phone and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision auto-focusing algorithms, and in particular to an event-assisted high-speed auto-focusing method. Background Art

[0002] Camera focus technology is a key link in photography and video shooting, affecting image quality and user experience. With the advancement of science and technology, traditional focus methods are gradually supplemented and improved by emerging technologies. As a new type of image sensor, event camera demonstrates its advantages in capturing scene changes with high temporal resolution, bringing new ideas to the development of autofocus technology.

[0003] The focusing methods of traditional cameras mainly include phase focus and contrast focus. Phase focus is a commonly used autofocus technology, mainly used in SLR cameras and high-end mirrorless cameras. This method divides the incoming light into two parts through optical separation, and measures the phase difference between the two beams of light to determine the focus position. The advantage of phase focus is that it responds quickly and is suitable for shooting moving objects, but it performs relatively poorly in low-light environments. Contrast focus determines the focus position by analyzing the contrast of the image. The camera will take multiple images at different focal lengths and find the image with the highest contrast for focusing. Although this method performs better in low-light environments, it is slower, especially in shooting fast-moving objects.

[0004] An event camera is a new type of image sensor that can obtain information about brightness changes on the sensor surface with extremely high temporal resolution, and it performs well in extremely dark environments. An event camera generates events in real time by capturing changes in light intensity for each pixel. This high temporal resolution enables event cameras to perform well in fast-motion scenes. Some people use event cameras to achieve faster autofocus from the perspectives of event rate and event polarity changes. However, these methods usually require a long focus scan to find the quasi-focus position, and then move to the quasi-focus position, which will reflect a "bellows" effect in the focus perception and affect the user experience.

[0005] With the gradual maturity and commercialization of event cameras in recent years, they are expected to be integrated into small terminal devices such as smartphones to assist traditional image sensors and complete tasks that cannot be achieved by traditional image sensors alone. From a physical principle, traditional image sensors are temporally sparse sampling of spatiotemporal light fields, which is reflected as low frame rate but spatially dense grayscale images; while event cameras are spatially sparse sampling of spatiotemporal light fields, which is reflected as high frame rate but spatially sparse brightness change information. Therefore, combining the two is the key to achieving tasks such as faster autofocus. Summary of the invention

[0006] In order to overcome the problems of weak low-light adaptability of traditional phase focusing methods, slow focusing speed of contrast focusing methods, event rate of event cameras and "bellows" of event polarity focusing methods, the present invention proposes an event-assisted high-speed automatic focusing method.

[0007] The technical solution of the present invention is as follows:

[0008] The present invention first provides an event-assisted high-speed autofocus method, which comprises the following steps:

[0009] Step 1: using an event camera and an image sensor to collect time-synchronized and spatially aligned event frames and image frames during the focusing motion;

[0010] Step 2: using the laplacian operator to calculate the spatial second-order derivative matrix of each image frame;

[0011] Step 3: multiply the event frame by the spatial second-order derivative matrix of the image frame at the closest moment before it, add up all the results and take the negative sign to obtain the event laplacian product sum corresponding to the event frame;

[0012] Step 4: During the focusing movement, each time an event frame is acquired, the corresponding event Laplacian product sum is calculated to determine whether its value is positive; when the event Laplacian product sum becomes a negative value, it means that the focusing movement has passed the quasi-focus position and moved toward the defocus direction. At this time, the movement direction is switched and the image plane is moved to the middle position where the Laplacian product sum switches between positive and negative values, that is, the quasi-focus position is reached.

[0013] The present invention also provides an event-assisted high-speed autofocus system for implementing the method, comprising:

[0014] A hybrid device based on an event camera and an image sensor for acquiring time-synchronized, spatially aligned event and image frames during focus motion;

[0015] A first processing unit, configured to calculate a spatial second-order derivative matrix for each of the image frames;

[0016] The second processing unit is used to multiply the event frame by the spatial second-order derivative matrix of the image frame at the most recent moment before the event frame, add up all the results and take the negative sign to obtain the event laplacian product sum corresponding to the event frame;

[0017] A causal window adaptive filter is used to filter the event laplacian product sum obtained by the second processing unit to obtain a filtered current event laplacian product sum filter_elp;

[0018] The focusing module is used to determine whether the event laplacian product and filter_elp corresponding to each event frame are positive during the focusing movement; when the event laplacian product and filter_elp become negative, it means that the focusing movement has passed the quasi-focus position and moved towards the defocus direction. At this time, the movement direction is switched and the image plane is moved to the middle position where the positive and negative values ​​of the laplacian product and filter_elp switch, that is, the quasi-focus position is reached.

[0019] Compared with the prior art, the present invention has the following beneficial effects:

[0020] The high-speed autofocus method proposed in the present invention is compared with the traditional phase focusing method. Since the event camera can simultaneously cover the illumination environment of 0.1 to 10 klux, its robustness in dark environments is guaranteed; compared with the traditional contrast focusing method, the present method, on the one hand, utilizes the high time resolution characteristics of the event camera to achieve event frame acquisition and focus evaluation judgment that exceeds 10 times the image frame rate; on the other hand, by utilizing the event laplacian product and evaluation function that is extremely sensitive to the focus position, the quasi-focus position can be quickly and accurately found by detecting the mutation position of the evaluation function, thereby avoiding multiple acquisitions of images near the quasi-focus position to analyze the contrast to find the quasi-focus position, greatly improving the speed and accuracy of focusing. Compared with the autofocus method based on the change of event rate or event polarity, the present invention does not need to go through a long focus judgment journey from defocus to quasi-focus and then to defocus, and finally move to the quasi-focus position, but directly detects the mutation position of the evaluation function, moves to the vicinity of the quasi-focus position and brakes in time, thereby avoiding a significant bellows effect. Most importantly, the event laplacian product and evaluation function provided by the present invention can directly determine whether it is moving toward the quasi-focus position by whether its value is positive or negative, and will not cause the situation of "going in the opposite direction" during the focusing process, thus playing a certain focusing prediction function. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is an overlay of image frames and event frames collected at different positions during the focus movement.

[0022] Figure 2 It is a graph of the change of the event laplacian product and the evaluation function over time in the static case.

[0023] Figure 3 It is a graph of the change of the event laplacian product and the evaluation function over time in the case of motion.

[0024] Figure 4 It is a graph showing the change of the laplacian product of events and the evaluation function over time in the case of intense exercise. DETAILED DESCRIPTION

[0025] The present invention is further described and illustrated below in conjunction with specific embodiments. The embodiments are merely exemplary of the present disclosure and do not define the scope of limitation. The technical features of each embodiment of the present invention may be combined accordingly without conflicting with each other.

[0026] The method of the present invention is implemented by relying on an event camera and a traditional image sensor, and can be implemented by using a hybrid device of an event camera and a traditional image sensor, such as the product DAVIS346 of the Swiss inivation company. The present invention requires event cameras and traditional image sensors to be able to output spatially corresponding (spatially aligned) event frames and image frames, and the frame rate of event frames should be more than 10 times that of image frames. The following methods can be used to achieve spatial correspondence: 1. Each pixel of the event camera and the traditional image sensor shares the same physical imaging unit, such as the implementation method of the product DAVIS346 of the inivation company; 2. The event camera and the traditional image sensor form a coaxial optical path through a spectroscopic device, and after spatial calibration, establish a spatial correspondence between event frame pixels and image frame pixels; 3. The event camera and the traditional image sensor are arranged in parallel to form a paraxial optical path with parallax, and through spatial calibration, establish a spatial correspondence between event frame pixels and image frame pixels within a certain distance range.

[0027] The event-assisted high-speed auto-focusing method provided by the present invention can be implemented according to the following steps:

[0028] Step 1: Use an event camera and an image sensor to collect time-synchronized and spatially aligned event frames and image frames during the focusing motion.

[0029] Step 2: Use the laplacian operator to calculate the spatial second-order derivative matrix of each image frame.

[0030] Step 3: multiply the event frame by the spatial second-order derivative matrix of the image frame at the most recent moment before it, and add up all the results and take the negative sign to obtain the event laplacian product sum corresponding to the event frame.

[0031] Step 4: During the focusing movement, each time an event frame is acquired, the corresponding event laplacian product sum is calculated to determine whether its value is positive. When the event laplacian product sum becomes a negative value, it means that the focusing movement has passed the quasi-focus position and moved towards the defocus direction. At this time, the movement direction is switched and the image plane is moved to the middle position where the laplacian product sum switches between positive and negative values, that is, the quasi-focus position is reached.

[0032] In some embodiments of the present invention, the interference of the scene movement during the focusing movement is considered. Therefore, before judging whether the event Laplacian product sum is positive in step 4, it also includes the step of establishing a causal window adaptive filter, and using the causal window adaptive filter to filter the calculated event Laplacian product sum. This step includes: establishing a causal window adaptive filter, filtering the current event Laplacian product sum by comprehensively analyzing the past event Laplacian product sum, and then replacing the current event Laplacian product and elp before filtering with the current event Laplacian product and filter_elp output by the causal window adaptive filter to make a positive or negative judgment. In a specific implementation scheme of the present invention, the specific content of step one is:

[0033] 1.1) Taking DAVIS346 used in the embodiment of the present invention as an example, it can collect image frames at a frame rate of 40 to 50 FPS according to the setting, and assign a timestamp in microseconds to each image frame, indicating the moment when the image frame starts to be exposed; it can also collect brightness change information in microseconds, that is, events, and the timestamp of each event is time-synchronized with the timestamp of the image frame. Since the event camera of DAVIS346 and the traditional image sensor pixels share the physical imaging unit, its events and image frames are naturally spatially aligned.

[0034] 1.2) The events between the timestamps of two temporally adjacent image frames are divided into 10 event slices with the same time span and temporally adjacent to each other. Each event slice contains all events that occurred within its time span. Events represent brightness change information and include two types: positive events representing brightness brightening beyond a threshold and negative events representing brightness dimming beyond a threshold. Events also contain the timestamp of their occurrence and spatial pixel location information.

[0035] 1.3) For any event slice, convert it to an event frame. Create an all-zero matrix with the same shape as the image frame. Then, for each event, if it is positive, add one to the matrix value of the position where it is generated, and if it is negative, subtract one from the matrix value of the position where it is generated. After this step, an event frame with a frame rate 10 times that of the image frame is obtained. Each event frame is an integer matrix, and the value of each pixel position represents the brightness change of the pixel within the time span of the event frame. Figure 1 The image frames and event frames collected at different positions during the focusing movement are shown in a superposition. The red dots in the figure represent mostly positive events, and the blue dots represent mostly negative events. For ease of observation, the numerical values ​​of the event frames are not reflected, that is, as long as the value is positive, it is marked in red, and the value is negative, it is marked in blue.

[0036] In a specific embodiment of the present invention, the specific content of step 2 is:

[0037] 2.1) Perform median filtering with a kernel size of 5 on each captured image frame to filter out salt and pepper noise in the image frame.

[0038] 2.2) The laplacian operator is used to calculate the second-order spatial derivative of the image frame to obtain the spatial second-order derivative matrix of the image frame.

[0039] In a specific embodiment of the present invention, the specific content of step three is:

[0040] 3.1) For each event frame, find the image frame captured at the most recent moment before it, dot-multiply the spatial second-order derivative matrix of the image frame, sum all the values ​​of the result matrix, and take the negative sign to obtain the event Laplacian product sum. The event Laplacian product sum is the focus evaluation function given by the present invention. Its characteristics are: when the focus movement is toward the quasi-focus position, the value of the event Laplacian product sum is positive, and the closer to the quasi-focus position, the larger the absolute value; when the focus movement passes the quasi-focus position and moves toward the defocus direction, the value of the event Laplacian product sum will immediately become negative, and its absolute value is very large, and the absolute value gradually decreases as the focus gradually defocuses. Figure 2 The change of the event laplacian product sum during the entire focusing process from defocus to quasi-focus and then to defocus is shown. It can be found that it undergoes a mutation at the quasi-focus position, and the value suddenly changes from a large positive value to a small negative value. Figure 2 The medium blue vertical line indicates the position of the true in-focus value.

[0041] 3.2) It can be theoretically proved that the event laplacian product sum is an excellent focus evaluation function. f(t,x) is a time-varying clear scene, k(t,x) is a time-varying Gaussian function, where the variance of the Gaussian function is 2 Over time, g(t,x) is the image on the image plane of the hybrid device sensor. The image g(t,x) is the convolution of the scene f(t,x) and the Gaussian function k(t,x):

[0042] g(t,x)=(f*k)(t,x)=∫f(t,xu)k(t,u)du.#(1)

[0043] During the focusing movement, the brightness of each position of g(t,x) will change. Taking the first-order derivative of g(t,x) with respect to time t, we can get:

[0044]

[0045] The first term can be considered as the brightness change caused by the scene change, and the second term is the brightness change caused by the focusing process. Assuming that the scene remains unchanged during the focusing process, So ignore the first item for now and focus only on the second.

[0046] The focusing motion process can be regarded as the variance of the time-varying Gaussian function k(t,x) decreasing over time to close to 0, and then gradually increasing; it is reflected in the image g(t,x) from blurry to clear and then to blurry again.

[0047] For the Gaussian function The variance changes over time α is the Gaussian variance change rate, which is negative in the process from defocus to quasi-focus and positive in the process from quasi-focus to defocus.

[0048] Formula (2) It can be obtained as:

[0049]

[0050] And taking the spatial second-order derivative of the image g(t,x) at time t, we get:

[0051]

[0052] in

[0053]

[0054] By observing formula (3) and formula (5), we can find that:

[0055]

[0056] When x 2 ≠σ(t) 2 When , the ratio of the time first-order derivative and the space second-order derivative of the time-varying Gaussian function k(t,x) is the Gaussian variance change rate α. Therefore, when the scene f(t,x) remains stationary, the time first-order derivative and the space second-order derivative of g(t,x) also have the above relationship.

[0057] Since the event camera can perceive the brightness change information at the microsecond level, it can be regarded as a discrete sampling of the time first-order derivative of g(t,x); while the traditional image sensor can perceive the brightness information, but the frame rate is low, so it can be regarded as a sparse sampling of time like g(t,x). The event laplacian product sum multiplies the time first-order derivative of g(t,x) with the spatial second-order derivative and adds them together. The positive and negative signs of its value reflect the direction of change of the Gaussian variance, which will change suddenly when crossing the quasi-focus position. In addition, according to the experimental results, when approaching the quasi-focus position, the absolute value of the maximum value of the spatial second-order derivative matrix of the image frame will increase and approach the gradient maximum value area in the scene. At the same time, the event frame will be sharper, and the events will be concentrated in the gradient maximum value area in the scene. Therefore, the absolute value of the product sum of the spatial second-order derivative matrix of the image frame and the event frame will be very large when approaching the quasi-focus position. The above two factors together lead to the sudden change of the event laplacian product sum at the quasi-focus position.

[0058] In a specific implementation of the present invention, a causal window adaptive filter is established, and the calculated event laplacian product sum is filtered using the causal window adaptive filter, and the specific content is:

[0059] a) In the derivation of step 3.2), the brightness change caused by the scene change, that is, the event caused by motion, is ignored. In actual situations, jitter during the focusing process is inevitable, and the resulting motion events will cause certain interference to the event frame. Figure 3 The black solid line shows the change of the event laplacian product sum with the image plane position movement during the whole focusing process under the condition of constant motion of (15, 15) pixel / s and high-frequency jitter with an amplitude of 0.15 pixel and a frequency equal to the event frame rate. The constant motion vector will cause the mismatch between the low-frame-rate image frame and the subsequent high-frame-rate event frame, and the high-frequency jitter will cause the local high-frequency change of brightness, so that the event laplacian product sum will fluctuate during the focusing process. In order to reduce the influence of the fluctuation caused by this motion on the focus position judgment, the present invention introduces a causal window adaptive filter.

[0060] b) The input of the causal window adaptive filter F is the event laplacian product and elp corresponding to the current event frame and the stored past event laplacian product and value sequence elp_seq, and the output is the filtered current event laplacian product and filter_elp; the preset parameters of the causal window adaptive filter F are the window length w, the threshold thd and the smoothing factor smooth.

[0061] The form of the filter function is: filter_elp=F(elp,elp_seq,w=5,thd=500,smooth=0.2), wherein w=5,thd=500,smooth=0.2 are preset parameter values.

[0062] c) The specific process of the causal window adaptive filter F is: 1. Calculate the average value avg_elp_seq of the last w values ​​of elp_seq; 2. Determine whether the absolute value of the difference between the average value and elp exceeds thd. If not, output elp. If exceeded, output the filtered value smooth*elp+(1-smooth)*avg_elp_seq.

[0063] d) The w in the preset parameters is used to control the visible range of the filter, and its value cannot exceed the quotient of the event frame rate divided by the image frame rate. In this embodiment, w is taken as half of the quotient of the event frame rate and the image frame rate 5. The threshold thd is the judgment condition for determining whether to perform filtering. It is recommended to be 0.8 times the size of the laplacian product and the sudden change of the event at the quasi-focus position under general conditions. This value is related to the imaging quality of the focusing system. The higher the sharpness that the focusing system can achieve at the quasi-focus position, the larger the size of the laplacian product and the sudden change of the event. Through the threshold thd, the filter can adaptively determine whether the input has fluctuated or has a sudden change at the quasi-focus position, thereby not affecting the accuracy of determining the sudden change position. The smoothing factor smooth controls the degree of smoothing. The smooth range is [0,1]. The smaller the value, the higher the degree of smoothing.

[0064] Figure 3 The red solid line in the figure shows the change of the filtered event laplacian product sum as the image plane moves during the entire focusing process. After filtering by the causal window adaptive filter, the fluctuation of the event laplacian product sum caused by scene changes is reduced, and the accuracy of the mutation position is maintained. The blue dotted line represents the true value of the quasi-focus position, and the green realization represents the quasi-focus position found by the present invention. The difference in the Gaussian kernel size σ corresponding to the quasi-focus position error is 0.03, and the blur it brings is less than one pixel, which meets the requirement of clear focus. Figure 3 The change of the event laplacian product sum with the image plane position from defocus to quasi-focus and then to defocus is shown only to demonstrate the principle, and does not mean that the method needs to actually go through such a long process to obtain the quasi-focus position. As mentioned above, the present invention only needs to detect the sudden change of the filtered event laplacian product sum from positive to negative to determine the quasi-focus position.

[0065] Figure 4The effect of the causal window adaptive filter in more extreme jitter conditions is demonstrated. Through the causal window adaptive filter, a large-scale event laplacian product and fluctuation near the 0.4 position are filtered out, which improves the robustness of the focusing method. The blue dotted line represents the true value of the quasi-focus position, and the green realization represents the quasi-focus position found by the present invention. The difference in the Gaussian kernel size σ corresponding to the quasi-focus position error is 0.05, and the blur it brings is less than one pixel, which also meets the requirement of clear focus.

[0066] Based on the above method, this embodiment provides an event-assisted high-speed autofocus system implementing the above method, which includes:

[0067] A hybrid device based on an event camera and an image sensor for acquiring time-synchronized, spatially aligned event and image frames during focus motion;

[0068] A first processing unit, configured to calculate a spatial second-order derivative matrix for each of the image frames;

[0069] The second processing unit is used to multiply the event frame by the spatial second-order derivative matrix of the image frame at the most recent moment before the event frame, add up all the results and take the negative sign to obtain the event laplacian product sum corresponding to the event frame;

[0070] A causal window adaptive filter is used to filter the event laplacian product sum obtained by the second processing unit to obtain a filtered current event laplacian product sum filter_elp;

[0071] The focusing module is used to determine whether the event laplacian product and filter_elp corresponding to each event frame are positive during the focusing movement; when the event laplacian product and filter_elp become negative, it means that the focusing movement has passed the quasi-focus position and moved towards the defocus direction. At this time, the movement direction is switched and the image plane is moved to the middle position where the positive and negative values ​​of the laplacian product and filter_elp switch, that is, the quasi-focus position is reached.

[0072] In summary, the high-speed autofocus method proposed in the present invention is compared with the traditional phase focusing method. Since the event camera can simultaneously cover the illumination environment of 0.1 to 10 klux, its robustness in dark environments is guaranteed; compared with the traditional contrast focusing method, the present method, on the one hand, utilizes the high time resolution characteristics of the event camera to achieve event frame acquisition and focus evaluation judgment that exceeds 10 times the image frame rate; on the other hand, by utilizing the event laplacian product and evaluation function that is extremely sensitive to the focus position, the quasi-focus position can be quickly and accurately found by detecting the mutation position of the evaluation function, thereby avoiding multiple acquisitions of images at the quasi-focus position to analyze the contrast to find the quasi-focus position, greatly improving the speed and accuracy of focusing. Compared with the autofocus method based on the change of event rate or event polarity, the present invention does not need to go through a long focus judgment journey from defocus to quasi-focus and then to defocus, and finally move to the quasi-focus position, but directly detects the mutation position of the evaluation function, moves to the vicinity of the quasi-focus position and brakes in time, thereby avoiding a significant bellows effect. Most importantly, the event laplacian product and evaluation function provided by the present invention can directly determine whether it is moving toward the quasi-focus position by whether its value is positive or negative, and will not cause the situation of "going in the opposite direction" during the focusing process, thus playing a certain focusing prediction function.

Claims

1. An event-assisted high-speed autofocus method, characterized in that The steps include: Step 1: using an event camera and an image sensor to collect time-synchronized and spatially aligned event frames and image frames during the focusing motion; Step 2: using the laplacian operator to calculate the spatial second-order derivative matrix of each image frame; Step 3: multiply the event frame by the spatial second-order derivative matrix of the image frame at the closest moment before it, add up all the results and take the negative sign to obtain the event laplacian product sum corresponding to the event frame; Step 4: During the focusing movement, each time an event frame is acquired, the corresponding event Laplacian product sum is calculated to determine whether its value is positive; when the event Laplacian product sum becomes a negative value, it means that the focusing movement has passed the quasi-focus position and moved toward the defocus direction. At this time, the movement direction is switched and the image plane is moved to the middle position where the Laplacian product sum switches between positive and negative values, that is, the quasi-focus position is reached.

2. The event-assisted high-speed autofocus method according to claim 1, characterized in that: In the step 1, the image sensor acquires image frames, and the event camera is used to acquire focus events; Each image frame is assigned a timestamp, and the events between the timestamps of two time-adjacent image frames are divided into N event slices with the same time span and adjacent to each other. Each event slice contains all events occurring within its time span, where N is an integer and ≥10; For any event slice, convert it into an event frame; establish an all-0 matrix with the same shape as the image frame, and then, for each event, if it is positive, add one to the matrix value of the position where it is generated, and if it is negative, subtract one from the matrix value of the position where it is generated; After this step, an event frame with a frame rate N times that of the image frame is obtained. Each event frame is an integer matrix, and the value of each pixel position represents the brightness change of the pixel within the time span of the event frame.

3. The event-assisted high-speed autofocus method according to claim 1, characterized in that: In step 1, each pixel of the event camera and the image sensor shares the same physical imaging unit; Alternatively, the event camera and the image sensor form a coaxial optical path through a spectrometer, and undergo spatial calibration to establish a spatial correspondence between event frame pixels and image frame pixels; Alternatively, the event camera and the image sensor are arranged in parallel to form a paraxial optical path with parallax, and through spatial calibration, a spatial correspondence between event frame pixels and image frame pixels is established within a certain distance range.

4. The event-assisted high-speed autofocus method according to claim 1, characterized in that: The second step comprises: 2.1) Perform median filtering on each collected image frame to remove salt and pepper noise in the image frame; 2.2) The laplacian operator is used to calculate the second-order spatial derivative of the image frame to obtain the spatial second-order derivative matrix of the image frame.

5. The event-assisted high-speed autofocus method according to claim 1, characterized in that: The step three includes: for each event frame, finding the image frame collected at the most recent moment before it, performing dot multiplication on the spatial second-order derivative matrix of the image frame calculated using the Laplacian operator, and summing all values ​​of the result matrix and taking the negative sign to obtain the event Laplacian product sum.

6. The event-assisted high-speed autofocus method according to claim 1, characterized in that: In the step 4, before determining whether the event laplacian product sum is positive, the step also includes establishing a causal window adaptive filter and using the causal window adaptive filter to filter the calculated event laplacian product sum.

7. The event-assisted high-speed autofocus method according to claim 6, characterized in that: The step of establishing a causal window adaptive filter and filtering the calculated event laplacian product sum using the causal window adaptive filter specifically includes: Construct a causal window adaptive filter F, whose input is the event laplacian product and elp corresponding to the current event frame and the stored past event laplacian product and value sequence elp_seq, and the output is the filtered current event laplacian product and filter_elp; the preset parameters of the causal window adaptive filter F are the window length w, the threshold thd and the smoothing factor smooth; The specific process of the causal window adaptive filter F is: calculate the average value avg_elp_seq of the last w values ​​of elp_seq; determine whether the absolute value of the difference between the average value and elp exceeds thd, if not, output elp, if more, output the filtered value smooth*elp+(1-smooth)*avg_elp_seq; In the step 4, the current event laplacian product and filter_elp output by the causal window adaptive filter are used to replace the current event laplacian product and elp before filtering to make a positive or negative judgment.

8. An event-assisted high-speed autofocus system implementing the method of claim 7, characterized in that: include: A hybrid device based on an event camera and an image sensor for acquiring time-synchronized, spatially aligned event and image frames during focus motion; A first processing unit, configured to calculate a spatial second-order derivative matrix for each of the image frames; The second processing unit is used to multiply the event frame by the spatial second-order derivative matrix of the image frame at the most recent moment before the event frame, add up all the results and take the negative sign to obtain the event laplacian product sum corresponding to the event frame; A causal window adaptive filter is used to filter the event laplacian product sum obtained by the second processing unit to obtain a filtered current event laplacian product sum filter_elp; The focusing module is used to determine whether the event laplacian product and filter_elp corresponding to each event frame are positive during the focusing movement; when the event laplacian product and filter_elp become negative, it means that the focusing movement has passed the quasi-focus position and moved towards the defocus direction. At this time, the movement direction is switched and the image plane is moved to the middle position where the positive and negative values ​​of the laplacian product and filter_elp switch, that is, the quasi-focus position is reached.

Citation Information

Patent Citations

  • Mapping method of event camera not influenced by speed

    CN110428477A

  • Full-focus imaging method and system based on event camera

    CN116347231A

  • Method to detect and overcome degradation image quality impacts

    US20230098949A1

Cited By

  • Event-triggered automatic focusing method and system

    CN121486682A