WO2023040423A1 - 镜头的调焦方法、装置、计算机设备和存储介质 - Google Patents

镜头的调焦方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2023040423A1
WO2023040423A1 PCT/CN2022/103601 CN2022103601W WO2023040423A1 WO 2023040423 A1 WO2023040423 A1 WO 2023040423A1 CN 2022103601 W CN2022103601 W CN 2022103601W WO 2023040423 A1 WO2023040423 A1 WO 2023040423A1
Authority
WO
WIPO (PCT)
Prior art keywords
transfer function
modulation transfer
lens
function value
frequency modulation
Prior art date
Application number
PCT/CN2022/103601
Other languages
English (en)
French (fr)
Inventor
林凯
王岩
Original Assignee
浙江宇视科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 浙江宇视科技有限公司 filed Critical 浙江宇视科技有限公司
Publication of WO2023040423A1 publication Critical patent/WO2023040423A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image

Definitions

  • the embodiments of the present application relate to the technical field of image processing, for example, to a lens focusing method, device, computer equipment, and storage medium.
  • the gradient value is generally used as an evaluation standard for image clarity, and the larger the gradient value of the image, the clearer the image.
  • the gradient value has no clear upper limit, it is necessary to repeatedly confirm the peak value of the gradient value, which is inefficient.
  • Embodiments of the present application provide a lens focusing method, device, computer equipment, and storage medium.
  • an embodiment of the present application provides a lens focusing method, the method including:
  • the embodiment of the present application also provides a lens focusing device, which includes:
  • the low-frequency modulation transfer function value calculation module is configured to obtain the test image obtained by shooting the reference image with the lens at the current focusing point, and determine the low-frequency modulation transfer function value of the test image;
  • the motion step determination module is configured to determine the high-frequency modulation transfer function value of the test image in response to determining that the low-frequency modulation transfer function value meets the preset value range condition, and determine the motion step according to the high-frequency modulation transfer function value, and control the lens according to Movement step length for movement;
  • the new current focus point determination module is configured to use the next focus point reached by the lens as the new current focus point for one focus adjustment.
  • the embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the computer program, it realizes the The focusing method of the lens described in any one of the embodiments of the application.
  • the embodiment of the present application also provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the lens as described in any one of the embodiments of the present application when executed by a computer processor. focusing method.
  • FIG. 1 is a flow chart of a lens focusing method in Embodiment 1 of the present application.
  • FIG. 2A is a flow chart of a lens focusing method in Embodiment 2 of the present application.
  • Fig. 2B is a schematic diagram of a characteristic pattern in Embodiment 2 of the present application.
  • FIG. 2C is a schematic diagram of a modulation transfer function curve in Embodiment 2 of the present application.
  • FIG. 2D is a schematic diagram of the relationship between a high-frequency modulation transfer function value and a motion step in Embodiment 2 of the present application;
  • FIG. 2E is a schematic diagram of the relationship between a low-frequency modulation transfer function value and a step size in Embodiment 2 of the present application;
  • FIG. 2F is a schematic structural diagram of a lens focusing system in applicable scenario 1 of an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a lens focusing device in Embodiment 3 of the present application.
  • FIG. 4 is a schematic structural diagram of a computer device in Embodiment 4 of the present application.
  • Figure 1 is a flow chart of a lens focusing method provided in Embodiment 1 of the present application.
  • This embodiment can perform corresponding lens focusing on imaging mechanisms such as video cameras and cameras, and this method can be executed by a lens focusing device.
  • the device can be implemented in whole or in part by software or hardware or a combination of software and hardware, and is generally integrated in computer equipment.
  • the device can be used in conjunction with movable video cameras, cameras and other imaging mechanisms that include lenses.
  • the embodiment of the present application includes the following steps:
  • the current focusing point refers to the current position of the lens.
  • a moving mechanism may be provided to be connected to the lens or an imaging mechanism corresponding to the lens, and the moving mechanism drives the lens to move, thereby adjusting the position of the lens.
  • the reference image provides a picture environment for this embodiment, for example, the reference image includes a feature pattern that matches the modulation transfer function algorithm.
  • the test image is the image obtained by shooting the reference image with the lens at the current focusing point.
  • MTF Modulation Transfer Function, modulation transfer function
  • MTF describes the modulation function at different spatial frequencies, and the resolution can be evaluated through the MTF value.
  • the MTF value can be calculated by the ratio of the contrast of the test image to the contrast of the reference image. Indicates that the contrast of the test image is always smaller than that of the reference image. Therefore, the MTF value is between 0 and 1, and the closer the MTF value is to 1, the higher the resolution of the test image and the better the clarity.
  • the low-frequency MTF value is the MTF value corresponding to the low-frequency band spatial frequency in the test image, and represents a comprehensive measure of the contrast of the entire image.
  • the maximum value of the MTF values of the low-frequency spatial frequencies in the test image may be used as the low-frequency MTF value, or the average value of the MTF values of the low-frequency spatial frequencies in the test image may be used as the low-frequency MTF value, or The median value of the MTF values of the low frequency band spatial frequencies in the test image may be used as the low frequency MTF value.
  • the selection of the range of the low-frequency band and the method of determining the low-frequency MTF value should not be limitations on the present application.
  • the lens shoots the reference image at the current focusing point to obtain the test image, and calculates the low-frequency MTF value of the test image.
  • the low-frequency MTF value represents a comprehensive measure of the contrast of the entire image. Therefore, it can be obtained by Low-frequency MTF values quickly locate test images with satisfactory contrast.
  • the low-frequency modulation transfer function value satisfies the preset value range condition, which means that the low-frequency MTF value is greater than or equal to the preset value.
  • the preset value is set to 0.7.
  • the threshold value of the MTF value corresponding to the evaluation of different items can be determined through the deep neural network model. This embodiment does not limit the specific setting and determination method of the preset value.
  • the high-frequency modulation transfer function value is the MTF value corresponding to the high-band spatial frequency in the test image, which represents the measurement of the details such as the edge and contour of the image.
  • one or more of the maximum value, the average value or the median value of the MTF value of the high-band spatial frequency in the test image can be used as the high-frequency modulation transfer function value, the selection of the high-band range in this embodiment, and The manner of determining the high-frequency MTF value is not limited.
  • the motion step refers to the distance that the lens moves from the current focus point to the next focus point.
  • the movement mechanism can be used to control the movement of the lens to move the distance of the motion step to reach the next one. Focus position.
  • the low-frequency MTF value represents a comprehensive measure of the contrast of the entire image
  • the high-frequency MTF value represents a measure of details such as edges and contours of the image.
  • the low-frequency MTF value is calculated and judged on the test image.
  • the motion step is calculated according to the high-frequency MTF value, and the lens is controlled to move in variable steps to evaluate image details.
  • the lens is controlled to move with a variable step length, and the peak of the sharpness of the test image can be determined without repeated climbing, which improves the focusing efficiency.
  • data such as the current focus position, low-frequency MTF value, and high-frequency MTF value can be saved to the database, so as to facilitate subsequent problem tracing and assist in adjusting multiple thresholds.
  • the reference image is captured by the lens at the current focusing point to obtain a test image
  • the high-frequency modulation transfer function value of the test image is calculated in response to the low-frequency modulation transfer function value of the test image meeting the preset value range condition
  • the motion step is determined according to the high-frequency modulation transfer function value
  • the lens moves to the next focus point according to the motion step
  • the next focus point is used as the new current focus point.
  • the focus adjustment method in the related technology needs to repeatedly climb uphill to find the peak of the gradient value, and the problem of low efficiency is solved, and a fast and efficient lens focus adjustment is realized.
  • FIG. 2A is a flow chart of a lens focusing method provided in Embodiment 2 of the present application.
  • the embodiment of the present application includes the process of obtaining a test image, calculating the low-frequency modulation transfer function value of the test image and The process of high-frequency modulation transfer function value and the process of determining the motion step size according to the high-frequency modulation transfer function value are described. It also adds that when the low-frequency modulation transfer function value does not meet the preset value range conditions, it moves according to the initial step size to The next step to adjust the focus position.
  • the embodiment of this application includes the following steps:
  • the initial step size is larger than the motion step size.
  • a larger initial step is used to move the lens.
  • the high-frequency MTF value of the test image is calculated, and the movement step is determined according to the high-frequency MTF value. , to control the movement of the lens with variable step length.
  • determining a large initial step size can make the lens move with a large step size, so that the contrast of the test image can quickly meet the requirement, thereby improving the focusing efficiency.
  • the reference image contains feature graphics, and the feature graphics must meet the requirements for calculating the MTF value.
  • the setting of characteristic graphics can refer to the standard resolution test chart.
  • FIG. 2B provides a schematic diagram of a characteristic graphic. As shown in FIG. 2B , the characteristic graphic may be a left black and right white graphic containing a slanted line, but this embodiment does not limit the setting of the characteristic graphic.
  • the edge or contour information of the feature graphics in the captured image will be enhanced, affecting the clarity of the captured image, thereby affecting the accuracy of the MTF value calculation. Therefore, for the captured image, before determining the MTF value, de-sharpening of the captured image may be performed, so as to ensure the accuracy of later calculation of the MTF value of the test image.
  • the feature graphics contained in the captured image are used to calculate the MTF algorithm. Therefore, for the captured image, in order to ensure the accuracy of the calculation of the MTF value, for the captured image after de-sharpening processing, the interference outside the feature image is removed, and the obtained test image is You can directly locate the feature graph and calculate the MTF value.
  • the characteristic graph can be expressed as a region of interest (region of interest, ROI), which can be an edge graph for calculating the MTF curve, and other graphs except the edge graph can be recorded as interference graphs.
  • ROI region of interest
  • edge graph for calculating the MTF curve
  • other graphs except the edge graph can be recorded as interference graphs.
  • edge black block there may be other types of characteristic graphics (such as blank areas, mark (mark) points, etc.) in the edge chart.
  • the interference outside the characteristic image can be understood as the interference caused by other images that are not the characteristic image.
  • the process of removing the interference outside the feature image may be expressed as ROI positioning. For example, locate the center of the edge chart (Chart) according to the specific pixel coordinates, and then combine the edge size to obtain the required target feature graph.
  • ROI positioning For example, locate the center of the edge chart (Chart) according to the specific pixel coordinates, and then combine the edge size to obtain the required target feature graph.
  • generating the modulation transfer function curve of the test image may include: locating and obtaining the characteristic pattern in the test image, calculating the modulation transfer function values of different spatial frequencies of the characteristic pattern, and generating the modulation transfer function according to at least one modulation transfer function value function curve.
  • the MTF algorithm can be used to locate the characteristic pattern in the test image, and calculate the MTF values of different spatial frequencies of the characteristic pattern, so as to generate the MTF curve. It is also possible to use the SFR (Spatial frequency response) algorithm to locate the feature pattern in the test image, extract a two-tone continuous black and white oblique line based on the feature image, and then obtain the rate of change of this oblique line, and then pass Fourier The leaf transformation obtains the MTF values at different spatial frequencies, thereby generating the MTF curve. This embodiment does not limit the specific manner of generating the MTF curve.
  • SFR spatial frequency response
  • Figure 2C provides a schematic diagram of a modulation transfer function curve, as shown in Figure 2C, the abscissa of the modulation transfer function curve is the spatial frequency (Freq), and the spatial frequency is used to represent the number of line pairs corresponding to each millimeter of width in the image, and the space The value of frequency is 0-1.
  • the ordinate of the modulation transfer function curve is the MTF value, and the modulation transfer function curve represents the change of the MTF value from low frequency to high frequency.
  • the MTF curve may be generated by an MTF algorithm, so as to facilitate the determination of the low-frequency MTF value and the high-frequency MTF value.
  • the low-frequency range can be set in advance. For example, it can be set as the low-frequency range of spatial frequency 0-0.5, or the low-frequency range of spatial frequency 0-0.4. This embodiment does not limit the value of the low-frequency range .
  • the maximum value of the MTF value in the low-frequency range can be used as the low-frequency MTF value, or the average value of the MTF value in the low-frequency range can be used as the low-frequency MTF value, or the MTF in the low-frequency range can be used
  • the median value of the values is used as the low-frequency MTF value, which is not limited in this embodiment.
  • the high-frequency MTF value is calculated to determine the motion step, and the lens moves with variable step length.
  • the lens When the low-frequency MTF value is less than the preset value, and the low-frequency MTF value is smaller than the preset low-frequency step conversion value, the lens will still move at the initial step size.
  • the low-frequency MTF value is greater than or equal to the preset low-frequency step conversion value
  • the transformation step can be determined according to the low-frequency MTF value, and the lens can be controlled to move at a variable step, so that the contrast of the test image can quickly reach the specified threshold or threshold range.
  • the high-frequency range can be set in advance, and this embodiment does not limit the value of the high-frequency range and the method of determining the high-frequency MTF value according to the MTF curve and the high-frequency range.
  • the spatial frequency is the number of lines per millimeter (lp/mm), which refers to the number of times the image function changes in a unit length. It should be noted that, in this embodiment, the ranges of the low frequency and the high frequency are not limited. During implementation, any value in the high frequency range is greater than any value in the low frequency range to meet the implementation requirements.
  • the low frequency can generally be 20 or 30lp/mm, and the high frequency can be determined according to the limit frequency of the corresponding sensor (sensor). Generally, it can be defined as 120lp/mm or 140lp/mm, which can be Determined in conjunction with specific projects.
  • S280 Determine the high frequency modulation transfer function value range in which the high frequency modulation transfer function value is located, and determine the motion step size matching the high frequency modulation transfer function value according to the mapping relationship between the high frequency modulation transfer function value range and the motion step size.
  • the mapping relationship between the high-frequency modulation transfer function value interval and the motion step size can be set in advance, so that different high-frequency modulation transfer function value intervals correspond to different motion step lengths, for example, it can be set to high frequency
  • the motion step size must be smaller than the initial step size.
  • Figure 2D provides a schematic diagram of the relationship between the high-frequency modulation transfer function value and the motion step size.
  • the corresponding motion step size is 2x, where x is Unit step length
  • the corresponding motion step size is 1.5x
  • the corresponding motion step size is x
  • the corresponding motion step is x/2.
  • a variable-step motion may be performed to reach the next focusing point and complete a focusing process. It is also possible to continue to use the next focusing point as the new current focusing point, repeat the above process, and continuously move the lens with a variable step length, thereby realizing focusing.
  • the low-frequency step-size conversion condition means that although the low-frequency modulation transfer function value is smaller than the preset value, it is greater than or equal to the preset low-frequency step-size conversion value. At this time, although there is no need to calculate the high-frequency modulation transfer function value, the step size is still reduced , to perform variable step length motion.
  • the preset value should be greater than the preset low-frequency step-size conversion value.
  • a matching conversion step-size is determined according to the low-frequency MTF value, and the lens is controlled to perform variable-step-size movement according to the conversion step size.
  • the initial step size should be greater than the transformation step size, but this embodiment does not limit the size of the transformation step size and the motion step size.
  • Figure 2E provides a schematic diagram of the relationship between the low-frequency modulation transfer function value and the step size, as shown in Figure 2E, the preset low-frequency step-size transformation value can be 0.5, and the preset value can be 0.8, when the low-frequency MTF value is less than When 0.5, the initial step size can be set to 3x. When the low frequency MTF value is greater than or equal to 0.5 and less than 0.8, the transformation step size can be set to x. When the low frequency MTF value is greater than 0.8, the high frequency MTF value is calculated according to High frequency MTF values for variable step size motion.
  • the low-frequency MTF value when the low-frequency MTF value is less than the preset low-frequency step conversion value, the large-step movement with the initial step is maintained; when the low-frequency MTF value is greater than or equal to the preset
  • the low-frequency step change value is less than the preset value, adjust the lens step to the change step, so that the contrast of the test image can quickly reach the required effect.
  • the low-frequency MTF value is greater than or equal to the preset value, determine the high-frequency MTF value, and determine the motion step size according to the high-frequency MTF value, and perform variable-step motion, so that the details such as the edges and contours of the test image can quickly achieve the required effect .
  • the lens is used to shoot the reference image at the current focusing point, and the captured image is desharpened and processed to remove the interference outside the characteristic image to obtain the test image, and the modulation transfer function curve of the test image is generated, and according to The modulation transfer function curve calculates the low-frequency modulation transfer function value.
  • the high-frequency modulation transfer function value is calculated according to the modulation transfer function curve, and the motion step is determined according to the high-frequency modulation transfer function value.
  • the lens moves to the next focus position according to the movement step, and the next focus position is used as the new current focus position.
  • the lens is controlled to move according to the initial step. , take the next focus position reached by the lens as the new current focus position, and when the low-frequency modulation transfer function value does not meet the preset value range condition but meets the low-frequency step conversion condition, the conversion step size is determined according to the low-frequency modulation transfer function value , to control the lens to move according to the transformation step, and use the next focus point reached by the lens as the new current focus point.
  • the focus adjustment method in the related technology needs to climb repeatedly to find the peak value of the gradient value, and the problem of low efficiency is realized, and the lens focus can be adjusted quickly and efficiently without repeated climbing.
  • Fig. 2F is a schematic structural diagram of a lens focusing system provided in the applicable scenario 1 of an embodiment of the present application.
  • the lens focusing system includes a reference image, computer equipment, a movement mechanism, a lens, an imaging mechanism, and a power supply . in:
  • the reference image provides an image environment for the lens focusing system, and the reference image includes characteristic graphics that can be used for MTF value calculation.
  • the computer equipment is used to acquire and record relevant data, and perform image processing and analysis, and the movement mechanism is used to drive the lens to move according to the movement commands sent by the computer equipment.
  • the lens is connected with the imaging mechanism, and the power supply is used for powering up the imaging mechanism.
  • the computer device may be a high-performance computer, for example, an industrial computer.
  • the motion mechanism can be a high-precision angular displacement slide table.
  • the movement mechanism drives the lens to move, and after the lens captures the test image, the imaging mechanism sends the test image to the computer device, and the computer device calculates the low-frequency MTF value of the test image to evaluate the contrast of the entire image.
  • the computer device sends instructions to the motion mechanism to control the camera to move in large steps.
  • the low-frequency MTF value is greater than or equal to the preset value, calculate the high-frequency MTF value of the test image, determine the corresponding small step size according to the high-frequency MTF value, and send instructions to the movement mechanism to drive the lens to move with a small step size. Focusing is achieved by switching the step size for lens movement.
  • the computer equipment can store the data during the focusing process into the database for problem backtracking and algorithm tuning.
  • the reference image is captured by the lens at the current focusing point to obtain a test image. If the low-frequency modulation transfer function value of the test image satisfies the preset value range condition, the high-frequency modulation transfer function value of the test image is calculated. The value of the frequency modulation transfer function determines the movement step, and the lens moves to the next adjustment point according to the movement step, and the next adjustment point is used as the new current adjustment point.
  • the focus adjustment method in the related technology needs to repeatedly climb uphill to find the peak of the gradient value, and the problem of low efficiency is solved, and a fast and efficient lens focus adjustment is realized.
  • Fig. 3 is a schematic structural diagram of a lens focusing device provided in Embodiment 3 of the present application, the device includes: a low-frequency modulation transfer function value calculation module 310, a motion step determination module 320, and a new current focusing point determination module 330, in:
  • the low-frequency modulation transfer function value calculation module 310 is configured to obtain a test image obtained by shooting the reference image with the lens at the current focusing point, and determine the low-frequency modulation transfer function value of the test image;
  • the motion step determination module 320 is configured to determine the high-frequency modulation transfer function value of the test image in response to determining that the low-frequency modulation transfer function value satisfies the preset value range condition, and determine the motion step size according to the high-frequency modulation transfer function value, and control the lens Exercise according to the motion step length;
  • the new current focus point determination module 330 is configured to use the next focus point reached by the lens as the new current focus point for one focus adjustment.
  • the reference image is captured by the lens at the current focusing point to obtain a test image
  • the high-frequency modulation transfer function value of the test image is calculated in response to the low-frequency modulation transfer function value of the test image meeting the preset value range condition, according to
  • the high-frequency modulation transfer function value determines the movement step, and the lens moves to the next focus point according to the movement step, and the next focus point is used as the new current focus point.
  • the focus adjustment method in the related technology needs to repeatedly climb uphill to find the peak of the gradient value, and the problem of low efficiency is solved, and a fast and efficient lens focus adjustment is realized.
  • the device further includes:
  • the initial step size is larger than the motion step size.
  • the device further includes:
  • the lens motion module is configured to respond to determining that the low-frequency modulation transfer function value does not meet the preset value range condition but meets the low-frequency step size conversion condition, determine the conversion step size according to the low-frequency modulation transfer function value, and control the lens to move according to the conversion step size.
  • the next focus point reached by the lens is used as the new current focus point.
  • the reference image includes characteristic graphics
  • Low frequency modulation transfer function value calculation module 310 including:
  • the de-sharpening unit is configured to obtain a photographed image obtained by photographing the reference image with the lens at the current focusing point, and perform de-sharpening processing on the photographed image;
  • the unit for removing interference from the characteristic image is configured to remove the interference from the characteristic image on the captured image after the de-sharpening process to obtain a test image.
  • the low frequency modulation transfer function value calculation module 310 includes:
  • the low-frequency modulation transfer function value calculation unit is configured to generate the modulation transfer function curve of the test image, and determine the low-frequency modulation transfer function value according to the modulation transfer function curve and the low-frequency range of the spatial frequency;
  • the motion step size determination module 320 includes:
  • the high-frequency modulation transfer function value calculation unit is configured to determine the high-frequency modulation transfer function value according to the modulation transfer function curve and the high-frequency range of the spatial frequency.
  • the low frequency modulation transfer function value calculation module 310 includes:
  • the modulation transfer function curve generation unit is configured to locate and obtain the characteristic graph in the test image, calculate the modulation transfer function values of different spatial frequencies of the characteristic graph, and generate the modulation transfer function curve according to the modulation transfer function value.
  • the motion step determination module 320 includes:
  • the motion step size determination unit is set to determine the high frequency modulation transfer function value interval where the high frequency modulation transfer function value is located, and determines the high frequency modulation transfer function value according to the mapping relationship between the high frequency modulation transfer function value interval and the motion step length Matching motion steps.
  • the lens focusing device provided in the embodiment of the present application can execute the lens focusing method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.
  • Fig. 4 is a schematic structural diagram of a computer device provided in Embodiment 4 of the present application.
  • the computer device includes a processor 70, a memory 71, an input device 72, and an output device 73;
  • the quantity can be one or more, and a processor 70 is taken as an example in Fig. 4;
  • the processor 70, the memory 71, the input device 72 and the output device 73 in the computer equipment can be connected by bus or other ways, and in Fig. 4 by Take the bus connection as an example.
  • the memory 71 can be used to store software programs, computer-executable programs and modules, such as modules corresponding to the lens focusing method in the embodiment of the present application (for example, the low-frequency Modulation transfer function value calculation module 310, motion step size determination module 320, and new current focusing point determination module 330).
  • the processor 70 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 71 , that is, implements the above lens focusing method.
  • the method includes:
  • the memory 71 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function; the data storage area may store data created according to the use of the terminal, and the like.
  • the memory 71 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices.
  • the memory 71 may further include memory located remotely relative to the processor 70, and these remote memories may be connected to the computer device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 72 can be used to receive input numbers or character information, and generate key signal input related to user settings and function control of the computer equipment.
  • the output device 73 may include a display device such as a display screen.
  • the computer device may include a processor, a memory, and may not include an input device and an output device.
  • Embodiment 5 of the present application also provides a storage medium containing computer-executable instructions, the computer-executable instructions are used to execute a lens focusing method when executed by a computer processor, and the method includes:
  • a storage medium containing computer-executable instructions provided in an embodiment of the present application the computer-executable instructions are not limited to the method operations described above, and can also perform the method of focusing the lens provided in any embodiment of the present application. related operations.
  • the embodiment of the present application can be implemented by means of software and necessary general-purpose hardware, or can be implemented by hardware, but in many cases the former is a better implementation Way.
  • the essence of the embodiment of the present application or the part that contributes to the related technology can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as computer floppy disks, Read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc., including several instructions to make a computer device (which can be a personal computer, A server, or a network device, etc.) executes the methods described in various embodiments of the present application.
  • a computer device which can be a personal computer, A server, or a network device, etc.
  • the units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition , the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)

Abstract

本申请实施例公开了一种镜头的调焦方法、装置、计算机设备和存储介质。该方法包括:获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并确定测试图像的低频调制传递函数值;响应于确定低频调制传递函数值满足预设数值范围条件,确定测试图像的高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动;将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。

Description

镜头的调焦方法、装置、计算机设备和存储介质
本申请要求在2021年09月18日提交中国专利局、申请号为202111096405.6的中国专利申请的优先权,以上申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及图像处理技术领域,例如涉及一种镜头的调焦方法、装置、计算机设备和存储介质。
背景技术
在相关技术的镜头调焦方案中,通常以梯度值作为图像清晰度的评价标准,图像的梯度值越大,表示图像越清晰。但由于梯度值没有明确的上限值,因此需要多次反复确认梯度值的峰值,效率不佳。
发明内容
本申请实施例提供一种镜头的调焦方法、装置、计算机设备和存储介质。
第一方面,本申请实施例提供了一种镜头的调焦方法,该方法包括:
获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并确定测试图像的低频调制传递函数值;
响应于确定低频调制传递函数值满足预设数值范围条件,确定测试图像的高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动;
将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。
第二方面,本申请实施例还提供了一种镜头的调焦装置,该装置包括:
低频调制传递函数值计算模块,设置为获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并确定测试图像的低频调制传递函数值;
运动步长确定模块,设置为响应于确定低频调制传递函数值满足预设数值范围条件,确定测试图像的高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动;
新当前调焦点位确定模块,设置为将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。
第三方面,本申请实施例还提供了一种计算机设备,包括存储器、处理器 及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如本申请实施例中任一所述的镜头的调焦方法。
第四方面,本申请实施例还提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如本申请实施例中任一所述的镜头的调焦方法。
附图说明
图1是本申请实施例一中的一种镜头的调焦方法的流程图;
图2A是本申请实施例二中的一种镜头的调焦方法的流程图;
图2B是本申请实施例二中的一种特征图形的示意图;
图2C是本申请实施例二中的一种调制传递函数曲线的示意图;
图2D是本申请实施例二中的一种高频调制传递函数值与运动步长关系的示意图;
图2E是本申请实施例二中的一种低频调制传递函数值与步长之间的关系的示意图;
图2F是本申请一实施例的适用场景一中的一种镜头调焦系统的结构示意图;
图3是本申请实施例三中的一种镜头的调焦装置的结构示意图;
图4是本申请实施例四中的一种计算机设备的结构示意图。
具体实施方式
下面结合附图和实施例对本申请进行说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。
实施例一
图1是本申请实施例一提供的一种镜头的调焦方法的流程图,本实施例可对摄像机、照相机等成像机构进行相应镜头的调焦,该方法可以由镜头的调焦装置来执行,该装置可以全部或部分通过软件或硬件或软件与硬件的组合来实现,并一般集成在计算机设备中,例如,该装置可与可移动的摄像机、照相机等包含镜头的成像机构配合使用。
如图1所示,本申请实施例,包括如下步骤:
S110、获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并 计算测试图像的低频调制传递函数值。
其中,当前调焦点位是指镜头当前所在的位置。例如,可以通过设置一个运动机构与镜头或者镜头对应的成像机构相连接,通过运动机构带动镜头运动,从而调整镜头的位置。
在本实施例中,参考图像为本实施例提供图片环境,例如,参考图像中包含与调制传递函数算法匹配的特征图形。测试图像是镜头在当前调焦点位对参考图像进行拍摄得到的图像。
针对低频MTF(Modulation Transfer Function,调制传递函数)值,MTF描述不同空间频率下的调制函数,可以通过MTF值进行分辨率的评价,MTF值可以用测试图像的对比度与参考图像的对比度的比值来表示,测试图像的对比度总是小于参考图像的对比度,因此,MTF值处于0-1之间,MTF值越接近1,表示测试图像的分辨率越高,清晰度越好。其中,低频MTF值是测试图像中低频段空间频率对应的MTF值,代表对整幅图像的对比度的综合度量。
在一实施例中,可以将测试图像中低频段空间频率的MTF值中的最大值,作为低频MTF值,也可以将测试图像中低频段空间频率的MTF值的平均值作为低频MTF值,还可以将测试图像中低频段空间频率的MTF值的中位值作为低频MTF值。对低频段范围的选取,以及低频MTF值的确定方式不应成为对于本申请的限制。
在本申请实施例中,镜头在当前调焦点位对参考图像进行拍摄,得到测试图像,并计算测试图像的低频MTF值,低频MTF值代表对整幅图像的对比度的综合度量,因此,可以通过低频MTF值快速定位对比度符合要求的测试图像。
S120、响应于确定低频调制传递函数值满足预设数值范围条件,计算测试图像的高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动。
低频调制传递函数值满足预设数值范围条件,是指低频MTF值大于或者等于预设数值。示例性的,MTF值大于0.9代表图像清晰度程度非常优秀,MTF值0.7-0.9为优秀,MTF值0.5-0.7为普通,MTF值低于0.5则认为清晰度较差,因此,可以将预设数值设置为0.7。同时,可以通过深度神经网络模型,确定MTF值对应不同项评价的阈值。本实施例对预设数值的具体设定以及确定方式不进行限制。
高频调制传递函数值是测试图像中高频段空间频率对应的MTF值,代表对 图像的边缘与轮廓等细节部分的度量。同样的,可以将测试图像中高频段空间频率的MTF值的最大值、平均值或者中位值中的一个或多个作为高频调制传递函数值,本实施例对高频段范围的选取,以及高频MTF值的确定方式不进行限制。
运动步长是指镜头从当前调焦点位运动到下一调焦点位的距离,根据高频MTF值确定运动步长之后,可以通过运动机构,控制镜头运动移动运动步长的距离,到达下一调焦点位。
在本申请实施例中,低频MTF值代表对整幅图像的对比度的综合度量,高频MTF值代表对图像的边缘与轮廓等细节部分的度量。通过对低频MTF值进行预设数值范围的判断,快速定位满足对比度要求的测试图像,再根据高频MTF值控制镜头改变步长进行运动,从而评测图像细节,实现调焦。
S130、将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。
在本申请实施例中,对测试图像进行低频MTF值的计算和判断,在图像的对比度达到要求时,再根据高频MTF值计算运动步长,控制镜头变步长运动以评测图像细节。通过重复上述运动过程,控制镜头进行变步长运动,无需反复进行爬坡,即可确定测试图像清晰度的峰值,提高了调焦效率。
在一实施例中,可以在实现一次调焦之后,将当前调焦点位、低频MTF值以及高频MTF值等数据保存至数据库,从而便于后续问题回溯,以及辅助调整多项阈值。
在本实施例中,通过镜头在当前调焦点位对参考图像进行拍摄,得到测试图像,响应于测试图像的低频调制传递函数值满足预设数值范围条件,计算测试图像的高频调制传递函数值,根据高频调制传递函数值确定运动步长,镜头根据运动步长移动到下一调焦点位,将下一调焦点位作为新的当前调焦点位。解决了相关技术中的调焦方式,需要多次反复爬坡寻找梯度值峰值,效率较低的问题,实现了快速高效的进行镜头调焦。
实施例二
图2A是本申请实施例二提供的一种镜头的调焦方法的流程图,本申请实施例在上述实施例的基础上,对获取测试图像的过程、计算测试图像的低频调制传递函数值和高频调制传递函数值的过程,以及根据高频调制传递函数值确定运动步长的过程进行了描述,还加入了低频调制传递函数值不满足预设数值范围条件时,按照初始步长运动到下一调焦点位的步骤。
如图2A所示,本申请实施例,包括如下步骤:
S210、获取初始步长,并将初始调焦点位作为首个当前调焦点位。
其中,初始步长大于运动步长。
在前期的调焦过程中,采用较大的初始步长进行镜头的运动,当测试图像的低频MTF值达到要求时,再计算测试图像的高频MTF值,根据高频MTF值确定运动步长,控制镜头变步长运动。
在本申请实施例中,确定一个较大的初始步长,可以使镜头以大步长运动,使测试图像的对比度快速达到要求,从而提高调焦效率。
S220、获取镜头在当前调焦点位对参考图像进行拍摄得到的拍摄图像,并对拍摄图像进行去锐化处理。
所述参考图像中包含特征图形,并且特征图形需符合MTF值计算的需求。例如,特征图形的设置可以参考标准分辨率测试卡。示例性的,图2B提供了一种特征图形的示意图,如图2B所示,特征图形可以是包含一条斜线的左黑右白图形,但本实施例对特征图形的设置不进行限制。
如果拍摄图像经过了锐化处理,则拍摄图像中特征图形的边缘或者轮廓信息会增强,影响拍摄图像的清晰程度,从而影响MTF值计算的准确度。因此,对拍摄得到的图像,可以在确定MTF值之前,进行对于拍摄得到的图像的去锐化的处理,以保证后期对测试图像进行MTF值计算的准确性。
S230、对去锐化处理后的拍摄图像进行去除特征图像外干扰的处理,得到测试图像。
拍摄图像中包含的特征图形用于进行MTF算法的计算,因此对于拍摄图像,为保证MTF值计算的准确性,对于去锐化处理后的拍摄图像,去除特征图像外的干扰,得到的测试图像就可以直接定位特征图形,进行MTF值的计算。
在一实施例中,特征图形可表现为感兴趣区域(region of interest,ROI),可为计算MTF曲线的刃边图,除刃边图外的其他图形可记为干扰图形。刃边图(Chart)中除刃边黑块外,还可存在其他类型的特征图形(例如留白区域、mark(标记)点等)。
特征图像外干扰可理解为,非特征图像的其他图像造成的干扰。
在一实施例中,去除特征图像外干扰的处理,可表现为,ROI定位。例如,根据具体像素坐标定位到刃边图(Chart)的中心位置,再结合刃边尺寸得到需要的目标特征图形。
S240、生成测试图像的调制传递函数曲线。
在一实施例中,生成测试图像的调制传递函数曲线,可以包括:定位得到测试图像中的特征图形,计算特征图形的不同空间频率的调制传递函数值,根据至少一个调制传递函数值生成调制传递函数曲线。
例如,可以通过MTF算法定位测试图像中的特征图形,计算特征图形的不同空间频率的MTF值,从而生成MTF曲线。还可以通过SFR(Spatial frequency response,空间频率响应)算法,定位测试图像中的特征图形,基于特征图形提取一条双色调连续的黑白斜线,再得到这条斜线的变化率,然后经过傅里叶变换得到不同空间频率下的MTF值,从而生成MTF曲线。本实施例对生成MTF曲线的具体方式不进行限制。
图2C提供了一种调制传递函数曲线的示意图,如图2C所示,调制传递函数曲线的横坐标为空间频率(Freq),空间频率用于表示图像中每毫米宽度对应的线对数量,空间频率的取值为0-1。调制传递函数曲线的纵坐标为MTF值,调制传递函数曲线代表从低频到高频的MTF值变化。
在本申请实施例中,可以通过MTF算法生成MTF曲线,从而便于进行低频MTF值和高频MTF值的确定。
S250、根据调制传递函数曲线以及空间频率的低频段范围,确定低频调制传递函数值。
低频段范围可以预先进行设定,示例性的,可以设置为空间频率0-0.5为低频段范围,或者空间频率0-0.4为低频段范围,本实施例对低频段范围的取值不进行限制。
获取MTF曲线和低频段范围之后,可以将低频段范围的MTF值的最大值作为低频MTF值,也可以将低频段范围的MTF值的平均值作为低频MTF值,还可以将低频段范围的MTF值的中位数值作为低频MTF值,本实施例对此不进行限制。
S260、判断低频调制传递函数值是否满足预设数值范围条件,当低频调制传递函数值满足预设数值范围条件时,则执行S270,当低频调制传递函数值不满足预设数值范围条件时,执行S2100。
当低频MTF值大于或者等于预设数值时,进行高频MTF值的计算,确定运动步长,镜头进行变步长运动。
当低频MTF值小于预设数值,且低频MTF值小于预设低频步长变换数值时,仍保持镜头以初始步长的大步长运动,当低频MTF值大于或者等于预设低频步长变换数值时,可以根据低频MTF值确定变换步长,控制镜头变步长运 动,以实现测试图像的对比度快速达到指定阈值或阈值范围。
S270、根据调制传递函数曲线以及空间频率的高频段范围,确定高频调制传递函数值。
在本申请实施例中,高频段范围可以预先进行设定,本实施例对高频段范围的取值,以及根据MTF曲线和高频段范围确定高频MTF值的方式不进行限制。
空间频率即每毫米线对数(lp/mm),指的是图像函数在单位长度中变化的次数。需要说明的是,本实施例中不限制低频与高频的范围,在实现时,高频段范围的任一数值大于低频段范围的任一数值即可满足实现需求。
在一实施例中,在安防行业中,低频一般可为20或30lp/mm,高频可根据对应传感器(sensor)的极限频率而定,一般情况可定义为120lp/mm或140lp/mm,可结合具体项目具体确定。
S280、确定高频调制传递函数值所处的高频调制传递函数值区间,根据高频调制传递函数值区间与运动步长的映射关系,确定与高频调制传递函数值匹配的运动步长。
在本申请实施例中,可以预先设置高频调制传递函数值区间与运动步长的映射关系,使得不同的高频调制传递函数值区间,对应不同的运动步长,例如,可以设置为高频调制传递函数值越大,运动步长越小。同时,需要进行说明的是,运动步长需小于初始步长。
图2D提供了一种高频调制传递函数值与运动步长关系的示意图,如图2D所示,当高频MTF值位于0-0.2区间时,对应的运动步长为2x,其中,x为单位步长,当高频MTF值位于0.2-0.5区间时,对应的运动步长为1.5x,当高频MTF值位于0.5-0.7区间时,对应的运动步长为x,当高频MTF值位于0.7-1区间时,对应的运动步长为x/2。
S290、控制镜头根据运动步长进行运动,将镜头到达的下一调焦点位作为新的当前调焦点位。
在本申请实施例中,在根据高频MTF值确定运动步长之后,可以进行变步长运动,以到达下一调焦点位,完成一次调焦过程。也可以继续以下一调焦点位作为新的当前调焦点位,重复上述过程,不断进行镜头的变步长运动,从而实现调焦。
S2100、判断低频调制传递函数值是否满足低频步长变换条件,当低频调制传递函数值满足低频步长变换条件时,则执行S2110,当低频调制传递函数 值不满足低频步长变换条件时,则执行S2120。
其中,低频步长变换条件是指,低频调制传递函数值虽然小于预设数值,但是大于或者等于预设低频步长变换数值,此时虽然无需计算高频调制传递函数值,但仍减少步长,进行变步长运动。
需要进行说明的是,预设数值应大于预设低频步长变换数值。
S2110、根据低频调制传递函数值确定变换步长,控制镜头根据变换步长进行运动,将镜头到达的下一调焦点位作为新的当前调焦点位。
在低频调制传递函数值大于或者等于预设低频步长变换数值,并且小于预设数值时,根据低频MTF值确定匹配的变换步长,控制镜头根据变换步长进行变步长运动。
需要进行说明的是,初始步长应大于变换步长,但本实施例对变换步长和运动步长的大小不进行限制。
图2E提供了一种低频调制传递函数值与步长之间的关系的示意图,如图2E所示,预设低频步长变换数值可以为0.5,预设数值可以为0.8,当低频MTF值小于0.5时,初始步长可以被设置为3x,当低频MTF值大于或者等于0.5,且小于0.8时,变换步长可以被设置为x,当低频MTF值大于0.8时,计算高频MTF值,根据高频MTF值进行变步长运动。
S2120、控制镜头根据初始步长进行运动,将镜头到达的下一调焦点位作为新的当前调焦点位。
在本申请实施例中,在初期调焦过程中,当低频MTF值小于预设低频步长变换数值时,则保持以初始步长进行的大步长运动,当低频MTF值大于或等于预设低频步长变换数值,但小于预设数值时,调整镜头的步长为变换步长,从而使测试图像的对比度快速达到要求的效果。当低频MTF值大于或等于预设数值时,确定高频MTF值,并根据高频MTF值确定运动步长,进行变步长运动,从而使测试图像的边缘与轮廓等细节快速达到要求的效果。
本实施例,通过镜头在当前调焦点位对参考图像进行拍摄,对拍摄得到的图像进行去锐化和去除特征图像外干扰的处理,得到测试图像,生成测试图像的调制传递函数曲线,并根据调制传递函数曲线计算低频调制传递函数值,当低频调制传递函数值满足预设数值范围条件,则根据调制传递函数曲线计算高频调制传递函数值,根据高频调制传递函数值确定运动步长,镜头根据运动步长移动到下一调焦点位,将下一调焦点位作为新的当前调焦点位,当低频调制传递函数值不满足低频步长变换条件,则控制镜头根据初始步长进行运动,将 镜头到达的下一调焦点位作为新的当前调焦点位,当低频调制传递函数值不满足预设数值范围条件但满足低频步长变换条件,则根据低频调制传递函数值确定变换步长,控制镜头根据变换步长进行运动,将镜头到达的下一调焦点位作为新的当前调焦点位。解决了相关技术中的调焦方式,需要多次反复爬坡寻找梯度值峰值,效率较低的问题,实现了快速高效的进行镜头调焦,无需反复爬坡。
适用场景一
图2F是本申请一实施例的适用场景一提供的一种镜头调焦系统的结构示意图,如图2F所示,镜头调焦系统包括参考图像、计算机设备、运动机构、镜头、成像机构以及电源。其中:
参考图像为镜头调焦系统提供图像环境,参考图像中包括可以进行MTF值计算的特征图形。计算机设备用于获取和记录相关数据,并进行图像处理和分析,运动机构用于根据计算机设备发送的运动命令,带动镜头运动。镜头与成像机构相连,电源为成像机构进行上电。
在一实施例中,计算机设备可为高性能计算机,例如,可为工控机。
在一实施例中,运动机构可为高精密角位移滑台。
在本申请实施例中,运动机构带动镜头运动,镜头拍摄得到测试图像之后,成像机构将测试图像发送至计算机设备,计算机设备对测试图像进行低频MTF值的计算,评估整幅图像的对比度,当低频MTF值小于预设数值时,计算机设备向运动机构发送指令,控制相机按照大步长进行运动。当低频MTF值大于或者等于预设数值时,计算测试图像的高频MTF值,根据高频MTF值确定对应的小步长,向运动机构发送指令,带动镜头进行小步长的运动。通过切换步长进行镜头运动,实现调焦。同时,计算机设备可以将调焦过程中的数据存储到数据库中,以便进行问题回溯和算法调优。
本实施例,通过镜头在当前调焦点位对参考图像进行拍摄,得到测试图像,如果测试图像的低频调制传递函数值满足预设数值范围条件,计算测试图像的高频调制传递函数值,根据高频调制传递函数值确定运动步长,镜头根据运动步长移动到下一调焦点位,将下一调焦点位作为新的当前调焦点位。解决了相关技术中的调焦方式,需要多次反复爬坡寻找梯度值峰值,效率较低的问题,实现了快速高效的进行镜头调焦。
实施例三
图3是本申请实施例三提供的一种镜头的调焦装置的结构示意图,该装置 包括:低频调制传递函数值计算模块310、运动步长确定模块320以及新当前调焦点位确定模块330,其中:
低频调制传递函数值计算模块310,设置为获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并确定测试图像的低频调制传递函数值;
运动步长确定模块320,设置为响应于确定低频调制传递函数值满足预设数值范围条件,确定测试图像的高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动;
新当前调焦点位确定模块330,设置为将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。
本实施例,通过镜头在当前调焦点位对参考图像进行拍摄,得到测试图像,响应于测试图像的低频调制传递函数值满足预设数值范围条件,计算测试图像的高频调制传递函数值,根据高频调制传递函数值确定运动步长,镜头根据运动步长移动到下一调焦点位,将下一调焦点位作为新的当前调焦点位。解决了相关技术中的调焦方式,需要多次反复爬坡寻找梯度值峰值,效率较低的问题,实现了快速高效的进行镜头调焦。
在一实施例中,在上述实施例的基础上,所述装置,还包括:
初始化模块,设置为获取初始步长,并将初始调焦点位作为首个当前调焦点位;
其中,初始步长大于运动步长。
在一实施例中,在上述实施例的基础上,所述装置,还包括:
镜头运动模块,设置为响应于确定低频调制传递函数值不满足预设数值范围条件但满足低频步长变换条件,根据低频调制传递函数值确定变换步长,控制镜头根据变换步长进行运动,将镜头到达的下一调焦点位作为新的当前调焦点位。
在一实施例中,在上述实施例的基础上,所述参考图像中包含特征图形;
低频调制传递函数值计算模块310,包括:
去锐化单元,设置为获取镜头在当前调焦点位对参考图像进行拍摄得到的拍摄图像,并对拍摄图像进行去锐化处理;
去除特征图像外干扰单元,设置为对去锐化处理后的拍摄图像进行去除特征图像外干扰的处理,得到测试图像。
在一实施例中,在上述实施例的基础上,低频调制传递函数值计算模块310,包括:
低频调制传递函数值计算单元,设置为生成测试图像的调制传递函数曲线,并根据调制传递函数曲线以及空间频率的低频段范围,确定低频调制传递函数值;
运动步长确定模块320,包括:
高频调制传递函数值计算单元,设置为根据调制传递函数曲线以及空间频率的高频段范围,确定高频调制传递函数值。
在一实施例中,在上述实施例的基础上,低频调制传递函数值计算模块310,包括:
调制传递函数曲线生成单元,设置为定位得到测试图像中的特征图形,计算特征图形的不同空间频率的调制传递函数值,根据调制传递函数值生成调制传递函数曲线。
在一实施例中,在上述实施例的基础上,运动步长确定模块320,包括:
运动步长确定单元,设置为确定高频调制传递函数值所处的高频调制传递函数值区间,根据高频调制传递函数值区间与运动步长的映射关系,确定与高频调制传递函数值匹配的运动步长。
本申请实施例所提供的镜头的调焦装置可执行本申请任意实施例所提供的镜头的调焦方法,具备执行方法相应的功能模块和有益效果。
实施例四
图4为本申请实施例四提供的一种计算机设备的结构示意图,如图4所示,该计算机设备包括处理器70、存储器71、输入装置72和输出装置73;计算机设备中处理器70的数量可以是一个或多个,图4中以一个处理器70为例;计算机设备中的处理器70、存储器71、输入装置72和输出装置73可以通过总线或其他方式连接,图4中以通过总线连接为例。
存储器71作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本申请实施例中的镜头的调焦方法对应的模块(例如,镜头的调焦装置中的低频调制传递函数值计算模块310、运动步长确定模块320以及新当前调焦点位确定模块330)。处理器70通过运行存储在存储器71中的软件程序、指令以及模块,从而执行计算机设备的各种功能应用以及数据处理,即实现上述的镜头的调焦方法。该方法包括:
获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并确定测试图像的低频调制传递函数值;
响应于确定低频调制传递函数值满足预设数值范围条件,确定测试图像的 高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动;
将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。
存储器71可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端的使用所创建的数据等。此外,存储器71可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器71可进一步包括相对于处理器70远程设置的存储器,这些远程存储器可以通过网络连接至计算机设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置72可用于接收输入的数字或字符信息,以及产生与计算机设备的用户设置以及功能控制有关的键信号输入。输出装置73可包括显示屏等显示设备。
在一实施例中,该计算机设备可以包括处理器、存储器,可以不包括输入装置和输出装置。
实施例五
本申请实施例五还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种镜头的调焦方法,该方法包括:
获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并确定测试图像的低频调制传递函数值;
响应于确定低频调制传递函数值满足预设数值范围条件,确定测试图像的高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动;
将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。
本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本申请任意实施例所提供的镜头的调焦方法中的相关操作。
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本申请实施例可借助软件及必需的通用硬件来实现,也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的实施例本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机 软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
值得注意的是,上述镜头的调焦装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。
上述仅为本申请的一些实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。

Claims (11)

  1. 一种镜头的调焦方法,包括:
    获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并确定测试图像的低频调制传递函数值;
    响应于确定低频调制传递函数值满足预设数值范围条件,确定测试图像的高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动;
    将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。
  2. 根据权利要求1所述的方法,在获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像之前,还包括:
    获取初始步长,并将初始调焦点位作为首个当前调焦点位;
    其中,初始步长大于运动步长。
  3. 根据权利要求1或2所述的方法,所述方法,还包括:
    响应于确定低频调制传递函数值不满足预设数值范围条件但满足低频步长变换条件,根据低频调制传递函数值确定变换步长,控制镜头根据变换步长进行运动,将镜头到达的下一调焦点位作为新的当前调焦点位。
  4. 根据权利要求1所述的方法,其中,所述参考图像中包含特征图形;
    获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,包括:
    获取镜头在当前调焦点位对参考图像进行拍摄得到的拍摄图像,并对拍摄图像进行去锐化处理;
    对去锐化处理后的拍摄图像进行去除特征图像外干扰的处理,得到测试图像。
  5. 根据权利要求1所述的方法,其中,确定测试图像的低频调制传递函数值,包括:
    生成测试图像的调制传递函数曲线,并根据调制传递函数曲线以及空间频率的低频段范围,确定低频调制传递函数值。
  6. 根据权利要求1或5所述的方法,其中,确定测试图像的高频调制传递函数值,包括:
    根据调制传递函数曲线以及空间频率的高频段范围,确定高频调制传递函数值。
  7. 根据权利要求6所述的方法,其中,生成测试图像的调制传递函数曲线,包括:
    定位得到测试图像中的特征图形,计算特征图形的不同空间频率的调制传 递函数值,根据调制传递函数值生成调制传递函数曲线。
  8. 根据权利要求1所述的方法,其中,根据高频调制传递函数值确定运动步长,包括:
    确定高频调制传递函数值所处的高频调制传递函数值区间,根据高频调制传递函数值区间与运动步长的映射关系,确定与高频调制传递函数值匹配的运动步长。
  9. 一种镜头的调焦装置,包括:
    低频调制传递函数值计算模块,设置为获取镜头在当前调焦点位对参考图像进行拍摄得到的测试图像,并确定测试图像的低频调制传递函数值;
    运动步长确定模块,设置为响应于确定低频调制传递函数值满足预设数值范围条件,确定测试图像的高频调制传递函数值,并根据高频调制传递函数值确定运动步长,控制镜头根据运动步长进行运动;
    新当前调焦点位确定模块,设置为将镜头到达的下一调焦点位作为新的当前调焦点位,以进行一次调焦。
  10. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1-8中任一所述的镜头的调焦方法。
  11. 一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如权利要求1-8中任一所述的镜头的调焦方法。
PCT/CN2022/103601 2021-09-18 2022-07-04 镜头的调焦方法、装置、计算机设备和存储介质 WO2023040423A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111096405.6 2021-09-18
CN202111096405.6A CN113556470B (zh) 2021-09-18 2021-09-18 一种镜头的调焦方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2023040423A1 true WO2023040423A1 (zh) 2023-03-23

Family

ID=78134659

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/103601 WO2023040423A1 (zh) 2021-09-18 2022-07-04 镜头的调焦方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN113556470B (zh)
WO (1) WO2023040423A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556470B (zh) * 2021-09-18 2021-12-31 浙江宇视科技有限公司 一种镜头的调焦方法、装置、计算机设备和存储介质
CN114018552B (zh) * 2022-01-04 2022-04-15 广东省傲来科技有限公司 基于逆投影mtf检测的镜头组装方法、装置及系统
CN116261044B (zh) * 2023-03-17 2024-04-02 北京拙河科技有限公司 一种亿级相机的智能调焦方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008233389A (ja) * 2007-03-19 2008-10-02 Nikon Corp 焦点判定方法、焦点判定装置、および焦点判定プログラム
CN203882012U (zh) * 2014-03-20 2014-10-15 中国科学院西安光学精密机械研究所 相位掩膜板及波前编码系统
CN105093480A (zh) * 2015-04-17 2015-11-25 江苏正桥影像科技股份有限公司 一种提高光学镜头对焦精确度的方法
US20200389598A1 (en) * 2019-06-05 2020-12-10 Canon Kabushiki Kaisha Image capturing apparatus, method of controlling the same, camera system, and storage medium
CN113556470A (zh) * 2021-09-18 2021-10-26 浙江宇视科技有限公司 一种镜头的调焦方法、装置、计算机设备和存储介质

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03182710A (ja) * 1989-12-12 1991-08-08 Olympus Optical Co Ltd 焦点検出装置
US7125121B2 (en) * 2002-02-25 2006-10-24 Ricoh Company, Ltd. Image display apparatus
JP2007150541A (ja) * 2005-11-25 2007-06-14 Brother Ind Ltd 画像読取装置およびその製造方法
CN101718620A (zh) * 2009-11-06 2010-06-02 北京理工大学 多光谱动态调制传递函数测量方法与装置
EP2628046B1 (en) * 2010-09-09 2019-05-01 Red.Com, Llc Apparatus and method for reducing or preventing temporal aliasing in motion picture cameras
CN102510444B (zh) * 2011-11-23 2013-12-18 青岛市光电工程技术研究院 光学成像相机的中高频mtf在线补偿与增强方法
CN103809348B (zh) * 2012-11-14 2016-07-13 光宝电子(广州)有限公司 应用于相机模块的自动调焦方法
JP6239862B2 (ja) * 2013-05-20 2017-11-29 キヤノン株式会社 焦点調節装置、焦点調節方法およびプログラム、並びに撮像装置
GB2516221A (en) * 2013-07-01 2015-01-21 Barco Nv Method and processor for streaming video processing
CN104917970B (zh) * 2015-06-18 2018-11-23 中国工程物理研究院激光聚变研究中心 一种自动调焦方法
CN105182498A (zh) * 2015-09-08 2015-12-23 四川双利合谱科技有限公司 一种摆扫型光谱成像仪的调焦方法
CN106210520B (zh) * 2015-11-05 2019-03-19 杭州舜立光电科技有限公司 一种自动调焦电子目镜及系统
CN105430277B (zh) * 2015-12-23 2019-08-20 北京奇虎科技有限公司 自动聚焦控制方法和装置
CN107333123A (zh) * 2016-04-28 2017-11-07 和硕联合科技股份有限公司 对焦检测系统及对焦检测方法
CN109521547B (zh) * 2018-12-21 2021-03-26 广州医软智能科技有限公司 一种变步长的自动调焦方法及系统
JP7240261B2 (ja) * 2019-06-05 2023-03-15 キヤノン株式会社 撮像装置及びその制御方法、プログラム、記憶媒体
CN112312028B (zh) * 2020-11-20 2022-02-22 歌尔光学科技有限公司 摄像头模组调焦方法、装置及计算机可读存储介质
CN113114947B (zh) * 2021-04-20 2022-11-01 重庆紫光华山智安科技有限公司 对焦调节方法和装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008233389A (ja) * 2007-03-19 2008-10-02 Nikon Corp 焦点判定方法、焦点判定装置、および焦点判定プログラム
CN203882012U (zh) * 2014-03-20 2014-10-15 中国科学院西安光学精密机械研究所 相位掩膜板及波前编码系统
CN105093480A (zh) * 2015-04-17 2015-11-25 江苏正桥影像科技股份有限公司 一种提高光学镜头对焦精确度的方法
US20200389598A1 (en) * 2019-06-05 2020-12-10 Canon Kabushiki Kaisha Image capturing apparatus, method of controlling the same, camera system, and storage medium
CN113556470A (zh) * 2021-09-18 2021-10-26 浙江宇视科技有限公司 一种镜头的调焦方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CN113556470A (zh) 2021-10-26
CN113556470B (zh) 2021-12-31

Similar Documents

Publication Publication Date Title
WO2023040423A1 (zh) 镜头的调焦方法、装置、计算机设备和存储介质
CN109792478B (zh) 基于焦点目标信息调整焦点的装置和方法
WO2020034896A1 (en) Method and apparatus for image processing, and mobile terminal
US10516877B2 (en) Light field collection control methods and apparatuses, light field collection devices
CN109671106B (zh) 一种图像处理方法、装置与设备
WO2019105154A1 (en) Image processing method, apparatus and device
JP6953311B2 (ja) 画素データに対して演算を実行するためのシステムおよび方法
CN108076278B (zh) 一种自动对焦方法、装置及电子设备
WO2021004245A1 (en) Depth image processing method and apparatus, and electronic device
JP2009522591A (ja) 関心領域を追跡することによってビデオカメラの自動焦点を制御するための方法および装置
CN110245641A (zh) 一种目标追踪拍摄方法、装置、电子设备
US11523056B2 (en) Panoramic photographing method and device, camera and mobile terminal
CN112449117B (zh) 一种聚焦步长确定方法、装置、存储介质及电子装置
CN106713740A (zh) 定位跟踪摄像方法与系统
CN105611158A (zh) 一种自动跟焦方法和装置、用户设备
CN105072348A (zh) 一种快速对焦人脸的方法、装置及终端
KR20220024255A (ko) 스테레오-시간적 이미지 시퀀스들로부터 향상된 3-d 데이터 재구성을 위한 방법들 및 장치
WO2017101292A1 (zh) 自动对焦的方法、装置和系统
CN110008892A (zh) 一种基于四连指指纹图像采集的指纹核验方法及装置
CN113099135A (zh) 一种红外图像聚焦、终端设备以及计算机可读存储介质
CN108040244B (zh) 基于光场视频流的抓拍方法及装置、存储介质
CN108357193B (zh) 丝印检测方法、装置、终端设备
CN116363238A (zh) 视差图生成方法、装置、设备及计算机可读存储介质
CN108376394B (zh) 一种基于频域直方图分析的摄像头自动对焦方法和系统
CN109727193B (zh) 图像虚化方法、装置及电子设备

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 2022868800

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022868800

Country of ref document: EP

Effective date: 20240315

NENP Non-entry into the national phase

Ref country code: DE