Positive focus position determination method and device, equipment, medium and product

By extracting the target channel image and focusing evaluation model, and determining the motion control signal of the zoom device with the zoom voltage and focus voltage, the problem of slow zooming speed of the TV sight is solved, and a fast focus and high-efficiency focus process is achieved.

CN119012012AInactive Publication Date: 2024-11-22SUZHOU GAIDE PHOTOELECTRIC TECH CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202410996375.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing TV viewing sights have slow zoom speeds, making it difficult to meet the modern needs of high precision and high efficiency.

Method used

By acquiring the target image generated by the photosensitive device, the target channel image is extracted, and the focus evaluation result is determined based on the preset focus evaluation model. If the focus signal is detected, the zoom voltage and focus voltage at the previous moment are obtained to determine the motion control of the zoom device. If the motion control signal is a target control signal, the focus evaluation result of the target channel image in three consecutive frames will be obtained, and the forward focus position will be determined based on the focus evaluation result.

Benefits of technology

Fast focus is achieved, focusing time is shortened, and focusing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119012012A_ABST
    Figure CN119012012A_ABST
Patent Text Reader

Abstract

The invention discloses a positive focus position determination method and device, electronic equipment, a storage medium and a program product. The method comprises the following steps: acquiring a target image generated by a photosensitive device, and extracting a target channel image from the target image; determining a focusing evaluation result of the target channel image based on a preset focusing evaluation model; if the focusing signal is detected, acquiring a zoom voltage at a previous moment and a focusing voltage at the previous moment, and determining a motion control signal of a zoom device according to the zoom voltage and the focusing voltage; and if the motion control signal is a target control signal, acquiring a focusing evaluation result of three continuous frames of target channel images, and determining a positive focus position according to the focusing evaluation result. According to the technical scheme, the problem that the zooming speed of the television sighting telescope is low is solved, rapid focusing is achieved through multi-layer zooming adjustment, the focusing time is shortened, and the focusing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of optical imaging technology, and in particular to a method, device, electronic device, storage medium and program product for determining a focus position. Background Art

[0002] With the continuous advancement of science and technology, TV sights have been widely used in the fields of military, security and surveillance. Existing TV sights usually rely on manual adjustment of focus and zoom, which is complicated and not precise enough to meet the modern requirements of high precision and high efficiency. Summary of the invention

[0003] The present invention provides a method, device, electronic device, storage medium and program product for determining a positive focus position, so as to solve the problem of slow zoom speed of a television sighting device, realize fast focusing through multi-level zoom adjustment, shorten the focusing time and improve the focusing efficiency.

[0004] According to one aspect of the present invention, a method for determining a focus position is provided, the method comprising:

[0005] Acquire a target image generated by a photosensitive device, and extract a target channel image from the target image; wherein the target channel image is an image generated based on a green channel component of each pixel in the target image;

[0006] Determining a focus evaluation result of the target channel image based on a preset focus evaluation model;

[0007] If a focus signal is detected, the variable magnification voltage and the focus voltage at the last moment are acquired, and a motion control signal of the zoom device is determined according to the variable magnification voltage and the focus voltage;

[0008] If the motion control signal is a target control signal, the focus evaluation results of three consecutive frames of target channel images are obtained, and the focus position is determined according to the focus evaluation results.

[0009] According to another aspect of the present invention, a device for determining a focus position is provided, the device comprising:

[0010] A channel image extraction module, used to obtain a target image generated by a photosensitive device, and extract a target channel image from the target image; wherein the target channel image is an image generated based on a green channel component of each pixel in the target image;

[0011] A focusing evaluation result determination module, used to determine the focusing evaluation result of the target channel image based on a preset focusing evaluation model;

[0012] A motion control signal determination module, for obtaining a variable magnification voltage and a focus voltage at a previous moment if a focus signal is detected, and determining a motion control signal of a zoom device according to the variable magnification voltage and the focus voltage;

[0013] The focus position determination module is used to obtain focus evaluation results of three consecutive frames of target channel images if the motion control signal is a target control signal, and determine the focus position according to the focus evaluation results.

[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] At least one processor; and a memory in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for determining the focus position described in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining the focus position described in any embodiment of the present invention when executed.

[0017] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method for determining the focus position according to any embodiment of the present invention is implemented.

[0018] The technical solution of the embodiment of the present invention is to obtain the target image generated by the photosensitive device and extract the target channel image from the target image; determine the focus evaluation result of the target channel image based on a preset focus evaluation model; if a focus signal is detected, obtain the variable magnification voltage and the focus voltage at the previous moment, and determine the motion control signal of the zoom device according to the variable magnification voltage and the focus voltage; if the motion control signal is a target control signal, obtain the focus evaluation results of three consecutive frames of target channel images, and determine the focus position according to the focus evaluation results. This technical solution solves the problem of slow zoom speed of TV sights, and realizes fast focusing through multi-level zoom adjustment, shortens the focusing time, and improves the focusing efficiency.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a method for determining a focus position according to Embodiment 1 of the present invention;

[0022] Figure 2 is a flow chart of a method for determining a focus position according to Embodiment 2 of the present invention;

[0023] Figure 3 is a schematic structural diagram of a device for determining a positive focus position according to Embodiment 3 of the present invention;

[0024] Figure 4 It is a schematic diagram of the structure of an electronic device for implementing the method for determining the focus position of an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0027] Embodiment 1

[0028] Figure 1A flowchart of a method for determining a focus position is provided for the first embodiment of the present invention. This embodiment is applicable to the search scene of the focus position in a television viewing device. The method can be executed by a device for determining a focus position, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0029] S110, acquiring a target image generated by a photosensitive device, and extracting a target channel image from the target image.

[0030] This solution can be executed by a television sighting device, which may include devices such as photosensitivity, zoom, and control. The photosensitive device can generate a target image, and the television sighting device can obtain the target image generated by the photosensitive device. It can be understood that the target image can be a visible light image, and the pixel value of each pixel in the visible light image is composed of three color components: red, green, and blue. The television sighting device can extract the component value of any of the three channels of red, green, and blue in the target image to obtain a target channel image. Since the wavelength of green light is in the range of 500-570nm, it is the color frequency range that the human eye is most sensitive to and is more easily perceived by the human eye. Therefore, the target channel image is an image generated based on the green channel component of each pixel in the target image.

[0031] S120: Determine a focus evaluation result of the target channel image based on a preset focus evaluation model.

[0032] After obtaining the target channel image, the TV sight can perform focus evaluation on the target channel image according to a preset focus evaluation model to obtain a focus evaluation result. Specifically, the focus evaluation model can be used to evaluate the clarity of the target channel image, and can be a focus evaluation function, such as an evaluation function based on gradient edge, a frequency domain evaluation function, an evaluation function based on information entropy, and an evaluation function based on image statistics. Using the pixel value of each pixel in the target channel image, the TV sight can calculate the focus evaluation result according to the focus evaluation function.

[0033] Before calculating the focus evaluation result, in order to ensure the reliability of the target channel image, the TV sight can perform filtering, denoising and other operations on the target channel image to reduce the impact of errors such as noise on the focus evaluation.

[0034] S130: If a focus signal is detected, obtain the variable power voltage and the focus voltage at the last moment, and determine the motion control signal of the zoom device according to the variable power voltage and the focus voltage.

[0035] In response to the user's focusing operation, the TV sight can generate a focusing signal. If the focusing signal is detected, the TV sight can obtain the variable magnification voltage and the focus voltage at the last moment. It is easy to understand that the variable magnification voltage is the working voltage value of the optical lens of the TV sight when changing the focal length multiple, and the focus voltage is the working voltage value of the optical lens of the TV sight when focusing.

[0036] It can be understood that the TV sight matches a zoom voltage curve under different zoom voltages, and the zoom voltage curve usually satisfies a skew distribution. According to the zoom voltage curve matched by the zoom voltage, the TV sight can determine the mode value of the skew distribution corresponding to the zoom voltage curve. The mode value is used as the mean value, and the standard deviation of the predetermined focus evaluation curve is used as the standard deviation. Based on the 3σ principle, the positive focus position search range is determined.

[0037] By comparing the focus voltage with the endpoint value of the positive focus position search range, the television sight can generate a movement control signal for the zoom device to adjust the zoom device to the positive focus position.

[0038] S140: If the motion control signal is a target control signal, then obtain focus evaluation results of three consecutive frames of target channel images, and determine a focus position according to the focus evaluation results.

[0039] The search for the focus position based on the focus voltage is a coarse-grained search process. If the motion control signal is a target control signal, it means that the current position of the zoom device is within the preset distance range of the focus position, that is, the target control signal can be used to characterize that the current position of the zoom device is within the preset distance range of the focus position. The TV sight can obtain the focus evaluation results of three consecutive frames of target channel images, and search the focus position more finely based on the focus evaluation results.

[0040] The technical solution of the embodiment of the present invention is to obtain the target image generated by the photosensitive device and extract the target channel image from the target image; determine the focus evaluation result of the target channel image based on a preset focus evaluation model; if a focus signal is detected, obtain the variable magnification voltage and the focus voltage at the previous moment, and determine the motion control signal of the zoom device according to the variable magnification voltage and the focus voltage; if the motion control signal is a target control signal, obtain the focus evaluation results of three consecutive frames of target channel images, and determine the focus position according to the focus evaluation results. This technical solution solves the problem of slow zoom speed of TV sights, and realizes fast focusing through multi-level zoom adjustment, shortens the focusing time, and improves the focusing efficiency.

[0041] Embodiment 2

[0042] Figure 2This is a flow chart of a method for determining a focus position provided in Embodiment 2 of the present invention. This embodiment refines the above embodiment. Figure 2 As shown, the method includes:

[0043] S201, acquiring a target image generated by a photosensitive device, and extracting a target channel image from the target image.

[0044] S202: Perform median filtering on the target channel image to determine a filtering result.

[0045] In this scheme, median filtering is used to filter the target channel image to eliminate the noise in the target channel image. Median filtering is a nonlinear smoothing technique that sets the grayscale value of each pixel to the median of all pixel grayscale values ​​in the preset neighborhood window of the point. The size of the neighborhood window can be set to 3×3 or 5×5, and the size is usually an odd number. The calculation formula of median filtering can be expressed as: g(x,y)=med{f(xi,yj),(i,j)∈w}; where g(x,y) represents the grayscale value of the pixel with coordinate position (x,y) after filtering, f(xi,yj) represents the grayscale value of the pixel with coordinate position (xi,yj) before filtering, w represents the neighborhood window, (i,j) represents the coordinate position index in the neighborhood window, and med represents the median operation.

[0046] In a specific example, the size of the neighborhood window is 5×5. In order to speed up the median filtering speed, the TV viewing device may not perform median operation on all pixels in the neighborhood window, but select pixels in odd rows and odd columns in the neighborhood window for median operation. The calculation formula can be expressed as:

[0047] g(x,y)=med{f(x-2,y-2),f(x-2,y),f(x-2,y+2),f(x,y-2),f(x,y),f(x,y+2),f(x+2,y-2),f(x+2,y),f(x+2,y+2)};where x represents the horizontal coordinate of the pixel in the target channel image, y represents the vertical coordinate of the pixel in the target channel image, g(x,y) represents the grayscale value of the pixel with coordinate position (x,y) after filtering, f(x-2,y-2) represents the grayscale value of the pixel in the first row and first column of the 5×5 neighborhood window, f(x-2,y) represents the grayscale value of the pixel in the first row and third column of the 5×5 neighborhood window, and f(x-2, y+2) represents the grayscale value of the pixel at the first row and fifth column position in the 5×5 neighborhood window, f(x,y-2) represents the grayscale value of the pixel at the third row and first column position in the 5×5 neighborhood window, f(x,y) represents the grayscale value of the pixel at the third row and third column position in the 5×5 neighborhood window, f(x,y+2) represents the grayscale value of the pixel at the third row and fifth column position in the 5×5 neighborhood window, f(x+2,y-2) represents the grayscale value of the pixel at the fifth row and first column position in the 5×5 neighborhood window, f(x+2,y) represents the grayscale value of the pixel at the fifth row and third column position in the 5×5 neighborhood window, and f(x+2,y+2) represents the grayscale value of the pixel at the fifth row and fifth column position in the 5×5 neighborhood window.

[0048] S203 . According to the filtering result and based on the gradient evaluation function, determine the forward gradient value matched by each pixel of the target channel image in each direction.

[0049] After filtering the target channel image, the TV sight can calculate the positive gradient values ​​of each pixel of the target channel image in multiple directions according to the filtering result and the gradient evaluation function. The gradient evaluation function can be a Brenner function, which uses the difference between two pixels in the same row with an interval of one pixel to represent the positive gradient value of the current pixel. At the same time, the Brenner function does not describe the vertical gradient, but only calculates the positive gradient value in one direction, which has better real-time performance than other gradient functions.

[0050] In this scheme, the Brenner function is improved and its function expression is expressed as: F pmbg =∑ x ∑ y ∏ θ grad θ (x,y),grad θ (x,y)=|f(x,y)*T θ |, where F pmbg Represents the focus evaluation result of the pixel at position (x, y), gradθ (x, y) represents the horizontal gradient value of the pixel at position (x, y) in the θ direction, T θ Represents the gradient operator for the θ direction matching.

[0051] The TV sight takes any pixel in the target channel image as the origin, establishes a plane rectangular coordinate system, takes the positive direction of the x-axis as 0°, selects 0°, 45°, 90° and 135° counterclockwise, and calculates the positive gradient value of each pixel in each direction. The gradient operator in each direction can be expressed as:

[0052]

[0053]

[0054] The calculation formulas for the positive gradient values ​​of pixels at position (x, y) in each direction are expressed as follows:

[0055] grad 0° =f(x,y-2)+2f(x,y-1)-2f(x,y+1)-f(x,y+2);

[0056] grad 45° =f(x-2,y-2)+2f(x-1,y-1)-2f(x+1,y+1)

[0057] -f(x+2,y+2);

[0058] grad 90° =f(x-2,y)+2f(x-1,y)-2f(x+1,y)-f(x+2,y);

[0059] grad 135° =f(x-2,y+2)+2f(x-1,y+1)-2f(x+1,y-1)

[0060] -f(x+2,y-2).

[0061] Among them, 0≤x≤M, 0≤y≤N, M represents the number of pixels on the x-axis of the target channel image, and N represents the number of pixels on the y-axis of the target channel image.

[0062] S204 , determining a focus evaluation result of the target channel image according to the forward gradient values ​​matched by each pixel of the target channel image in each direction.

[0063] In this solution, optionally, determining the focus evaluation result of the target channel image according to the forward gradient values ​​matched by each pixel of the target channel image in each direction includes:

[0064] Each pixel is taken as a target pixel in turn, and the forward gradient values ​​matched by the target pixel in each direction are multiplied to obtain the focus evaluation result of the target pixel;

[0065] The focus evaluation result of the target channel image is determined according to the focus evaluation result of each pixel.

[0066] The TV sighting device can sequentially use each pixel in the target channel image as the target pixel, multiply the forward gradient values ​​corresponding to the target pixel in each direction, and use them as the focus evaluation result of the target pixel. After obtaining the focus evaluation result of each pixel, the TV sighting device can use the sum of the focus evaluation results of each pixel in the target channel image as the focus evaluation result of the target channel image.

[0067] S205: If a focus signal is detected, the variable magnification voltage and the focus voltage at the last moment are obtained.

[0068] S206: Determine a zoom voltage curve that matches the zoom voltage.

[0069] The television sight can map the zoom voltage curve corresponding to the zoom voltage in the zoom voltage curve set according to the zoom voltage at the previous moment, or can fit the zoom voltage curve corresponding to the zoom voltage according to the zoom voltage at multiple moments and the focus voltage at multiple moments.

[0070] For example, a TV sight can obtain a variable magnification voltage and a focus voltage at multiple consecutive moments, and the variable magnification voltage and focus voltage at three consecutive moments satisfy: Among them, V F1 、V F2 and V F3 Represents the focusing voltage at three consecutive moments, V Z1 、V Z2 and V Z3 They represent the variable magnification voltages at three consecutive moments respectively. The variable magnification voltage at the last moment can be the variable magnification voltage at any moment among the variable magnification voltages at multiple consecutive moments. Through the above relationship, the TV sight can fit the zoom voltage curve corresponding to the variable magnification voltage. The zoom voltage in the zoom voltage curve satisfies the skew distribution.

[0071] S207: Determine a mode value of the skew distribution according to the zoom voltage curve.

[0072] In the zoom voltage curve, the TV sight can statistically obtain the mode value of the offset distribution.

[0073] S208. Determine a focus position search range according to the mode value and a predetermined standard deviation of the focus evaluation curve.

[0074] Among them, the focus evaluation curve is determined based on the focusing experiment and is used to characterize the focus evaluation value under different defocus degrees. Specifically, the TV sight can conduct a focusing experiment in advance, and collect different focus voltage values ​​according to the imaging law of the optical lens. An object at infinity is selected as the target, and the focus evaluation curve is determined under different focus voltage values. The TV sight can normalize the focus evaluation curve to avoid the influence of abnormal data during the experiment. The focus evaluation curve is symmetrical on the left and right and satisfies the normal distribution. The TV sight can determine the mean and standard deviation of the normal distribution based on the focus evaluation curve.

[0075] The mode value of the skew distribution is taken as the mean value, and the predetermined standard deviation of the focus evaluation curve is taken as the standard deviation. Based on the 3σ principle, the positive focus position search range is determined. In the scheme, the positive focus position search range may include a first search range and a second search range, and the second search range is a subset of the first search range. Specifically, the first search range may be (mode-3σ, mode+3σ), and the second search range may be (mode-σ, mode+σ), where mode represents the mode value of the skew distribution, and σ represents the standard deviation of the focus evaluation curve.

[0076] S209: Determine a motion control signal of a zoom device according to the focus voltage and the positive focus position search range.

[0077] In the solution, the step of determining the motion control signal of the zoom device according to the focus voltage and the positive focus position search range includes:

[0078] If the focus voltage is not within the first search range, moving the zoom device toward the first search range according to the first step, and outputting a first control signal;

[0079] If the focus voltage is within the first search range but not within the second search range, moving the zoom device toward the second search range according to a second step length and outputting a second control signal;

[0080] If the focus voltage is within the second search range, the zoom device is moved in a first direction according to a third step length, and a third control signal is output; wherein the first direction is a direction close to an end point of a preset interval of the second search range.

[0081] It can be understood that the focus voltage value corresponding to mode can represent the positive focus position. If the focus voltage at the last moment is not within the first search range, the zoom device is moved in a direction close to the first search range according to the first step length, that is, close to the positive focus position. The TV sighting device can generate a first control signal for moving the zoom device in a direction close to the first search range according to the first step length. If the focus voltage at the last moment is within the first search range but not within the second search range, the zoom device is moved in a direction close to the second search range according to the second step length, that is, close to the positive focus position. The TV sighting device can generate a second control signal for moving the zoom device in a direction close to the second search range according to the second step length. If the focus voltage at the last moment is within the second search range, in order to accurately locate the positive focus position, the TV sighting device can move the zoom device in the first direction according to the third step length. The first direction is a direction close to the end point of a preset interval of the second search range, for example, the first direction can be a direction close to mode-σ, or mode+σ. The TV sighting device can generate a third control signal for moving the zoom device in a direction close to the second search range according to the second step length.

[0082] The step lengths of the first step length, the second step length and the third step length may be the same or different. Preferably, the first step length may be greater than the second step length, and the second step length may be greater than the third step length.

[0083] S210: If the motion control signal is a target control signal, then obtain focus evaluation results of three consecutive frames of target channel images, and determine a focus position according to the focus evaluation results.

[0084] In a feasible solution, the target control signal is a third control signal;

[0085] If the motion control signal is a target control signal, obtaining focus evaluation results of three consecutive frames of target channel images, and determining a positive focus position according to the focus evaluation results, including:

[0086] If the motion control signal is the third control signal, obtaining focus evaluation results of three consecutive frames of target channel images, and determining a positive focus position according to the focus evaluation results;

[0087] If the motion control signal is the third control signal, it means that the focus voltage at the previous moment is within the second search range, and a fine-grained focus position search is required within the second search range. The TV sight can obtain the focus evaluation results of three consecutive target channel images, and determine the focus position by comparing the focus evaluation results of the three consecutive target channel images.

[0088] In a preferred solution, determining the focus position according to the focus evaluation result includes:

[0089] If the focus evaluation result of the first frame target channel image is less than the focus evaluation result of the second frame target channel image, and the focus evaluation result of the second frame target channel image is greater than the focus evaluation result of the third frame target channel image, then the positive focus position is determined according to the focus voltage matched by the second frame target channel image;

[0090] If the focus evaluation result of the first frame target channel image is less than the focus evaluation result of the second frame target channel image, and the focus evaluation result of the second frame target channel image is less than the focus evaluation result of the third frame target channel image, then move the zoom device in the first direction according to the third step length, return to execute to obtain the focus evaluation results of three consecutive frames of target channel images, until the focus evaluation results of the three consecutive frames of target channel images meet the preset positive focus position evaluation condition, and determine the positive focus position according to the focus voltage matched by the second frame target channel image;

[0091] If the focus evaluation result of the first frame target channel image is greater than the focus evaluation result of the second frame target channel image, and the focus evaluation result of the second frame target channel image is greater than the focus evaluation result of the third frame target channel image, then the zoom device is moved in the second direction according to the third step length, and the focus evaluation results of three consecutive frames of target channel images are returned to be obtained until the focus evaluation results of the three consecutive frames of target channel images meet the preset positive focus position evaluation condition, and the positive focus position is determined according to the focus voltage matched by the second frame target channel image; wherein the second direction is the opposite direction of the first direction;

[0092] If the focus evaluation result of the first frame target channel image is greater than the focus evaluation result of the second frame target channel image, and the focus evaluation result of the second frame target channel image is less than the focus evaluation result of the third frame target channel image, then move the zoom device in the first direction according to the third step length, return to execute to obtain the focus evaluation results of three consecutive frames of target channel images, until the focus evaluation results of the three consecutive frames of target channel images meet the preset positive focus position evaluation condition, and determine the positive focus position according to the focus voltage matched by the second frame target channel image;

[0093] Among them, the focus position evaluation condition is that the focus evaluation result of the first frame target channel image is smaller than the focus evaluation result of the second frame target channel image, and the focus evaluation result of the second frame target channel image is greater than the focus evaluation result of the third frame target channel image.

[0094] After determining the motion control signal of the zoom device, the method further includes:

[0095] If the motion control signal is the first control signal or the second control signal, the current moment is taken as the previous moment, and the process returns to obtain the variable magnification voltage and the focus voltage at the previous moment until the motion control signal is the third control signal.

[0096] If the motion control signal is the first control signal or the second control signal, it means that the focus voltage at the previous moment has not entered the second search range. The TV viewing device can update the current moment to the previous moment, return to execute to obtain the variable magnification voltage and the focus voltage at the previous moment, and execute S206-S209 to continue the coarse-grained focus position search until the motion control signal is the third control signal, convert the adjustment granularity, and perform a fine-grained focus position search.

[0097] The technical solution of the embodiment of the present invention is to obtain the target image generated by the photosensitive device and extract the target channel image from the target image; determine the focus evaluation result of the target channel image based on a preset focus evaluation model; if a focus signal is detected, obtain the variable magnification voltage and the focus voltage at the previous moment, and determine the motion control signal of the zoom device according to the variable magnification voltage and the focus voltage; if the motion control signal is a target control signal, obtain the focus evaluation results of three consecutive frames of target channel images, and determine the focus position according to the focus evaluation results. This technical solution solves the problem of slow zoom speed of TV sights, and realizes fast focusing through multi-level zoom adjustment, shortens the focusing time, and improves the focusing efficiency.

[0098] Embodiment 3

[0099] Figure 3 This is a schematic diagram of the structure of a device for determining a focus position provided by Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0100] The channel image extraction module 310 is used to obtain a target image generated by a photosensitive device and extract a target channel image from the target image; wherein the target channel image is an image generated based on a green channel component of each pixel in the target image;

[0101] A focus evaluation result determination module 320, configured to determine a focus evaluation result of the target channel image based on a preset focus evaluation model;

[0102] The motion control signal determination module 330 is used to obtain the variable magnification voltage and the focus voltage at the last moment if a focus signal is detected, and determine the motion control signal of the zoom device according to the variable magnification voltage and the focus voltage;

[0103] The focus position determination module 340 is used to obtain focus evaluation results of three consecutive frames of target channel images if the motion control signal is a target control signal, and determine the focus position according to the focus evaluation results.

[0104] In this solution, optionally, the focus evaluation model includes a gradient evaluation function; the focus evaluation result includes a positive gradient value of each pixel in each preset direction, and the angle between two adjacent directions is the same;

[0105] The focusing evaluation result determination module 320 includes:

[0106] A filtering result determination unit, used for performing median filtering on the target channel image to determine a filtering result;

[0107] A gradient value determination unit, configured to determine, according to the filtering result and based on the gradient evaluation function, the forward gradient value matched by each pixel of the target channel image in each direction;

[0108] The evaluation result determination unit is used to determine the focus evaluation result of the target channel image according to the forward gradient values ​​matched by each pixel of the target channel image in each direction.

[0109] Based on the above solution, optionally, the evaluation result determination unit is specifically used to:

[0110] Each pixel is taken as a target pixel in turn, and the forward gradient values ​​matched by the target pixel in each direction are multiplied to obtain the focus evaluation result of the target pixel;

[0111] The focus evaluation result of the target channel image is determined according to the focus evaluation result of each pixel.

[0112] In a feasible solution, the motion control signal determination module 330 includes:

[0113] A zoom voltage curve determining unit, used to determine a zoom voltage curve matching the variable magnification voltage; wherein the zoom voltage in the zoom voltage curve satisfies a skew distribution;

[0114] a mode value determining unit, configured to determine a mode value of the skew distribution according to the zoom voltage curve;

[0115] A search range determination unit, used to determine the focus position search range according to the mode value and a standard deviation of a predetermined focus evaluation curve; wherein the focus evaluation curve is determined based on a focusing experiment and is used to characterize focus evaluation values ​​at different defocus levels;

[0116] A control signal determination unit is used to determine a motion control signal of a zoom device according to the focus voltage and the positive focus position search range.

[0117] Based on the above solution, the focus position search range includes a first search range and a second search range; the second search range is a subset of the first search range;

[0118] The control signal determination unit is specifically used for:

[0119] If the focus voltage is not within the first search range, moving the zoom device toward the first search range according to the first step, and outputting a first control signal;

[0120] If the focus voltage is within the first search range but not within the second search range, moving the zoom device toward the second search range according to a second step length and outputting a second control signal;

[0121] If the focus voltage is within the second search range, the zoom device is moved in a first direction according to a third step length, and a third control signal is output; wherein the first direction is a direction close to an end point of a preset interval of the second search range.

[0122] In a preferred solution, the target control signal is a third control signal;

[0123] The focus position determination module 340 is specifically used to:

[0124] If the motion control signal is the third control signal, obtaining focus evaluation results of three consecutive frames of target channel images, and determining a positive focus position according to the focus evaluation results;

[0125] The device is also used for:

[0126] After determining the motion control signal of the zoom device, if the motion control signal is the first control signal or the second control signal, the current moment is taken as the previous moment, and the process returns to obtain the zoom voltage and the focus voltage of the previous moment until the motion control signal is the third control signal.

[0127] The device for determining the focus position provided in the embodiment of the present invention can execute the method for determining the focus position provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0128] Embodiment 4

[0129] Figure 4A schematic diagram of an electronic device 410 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0130] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0131] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0132] The processor 411 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as a method for determining a focus position.

[0133] In some embodiments, the method for determining the focus position may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the method for determining the focus position described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to perform the method for determining the focus position in any other appropriate manner (e.g., by means of firmware).

[0134] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0135] The computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable in-focus position determination device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0136] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0137] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0138] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0139] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0140] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0141] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for determining a positive focus position, characterized in that: The method comprises: Acquire a target image generated by a photosensitive device, and extract a target channel image from the target image; wherein the target channel image is an image generated based on a green channel component of each pixel in the target image; Determining a focus evaluation result of the target channel image based on a preset focus evaluation model; If a focus signal is detected, the variable magnification voltage and the focus voltage at the last moment are acquired, and a motion control signal of the zoom device is determined according to the variable magnification voltage and the focus voltage; If the motion control signal is a target control signal, the focus evaluation results of three consecutive frames of target channel images are obtained, and the focus position is determined according to the focus evaluation results.

2. The method according to claim 1, characterized in that The focus evaluation model includes a gradient evaluation function; the focus evaluation result includes the positive gradient value of each pixel in each preset direction, and the angle between two adjacent directions is the same; The step of determining the focus evaluation result of the target channel image based on a preset focus evaluation model includes: Performing median filtering on the target channel image to determine a filtering result; According to the filtering result, based on the gradient evaluation function, determine the forward gradient value matched by each pixel of the target channel image in each direction; The focus evaluation result of the target channel image is determined according to the forward gradient values ​​matched by each pixel of the target channel image in each direction.

3. The method according to claim 2, characterized in that Determining the focus evaluation result of the target channel image according to the forward gradient values ​​matched by each pixel of the target channel image in each direction includes: Each pixel is taken as a target pixel in turn, and the forward gradient values ​​matched by the target pixel in each direction are multiplied to obtain the focus evaluation result of the target pixel; The focus evaluation result of the target channel image is determined according to the focus evaluation result of each pixel.

4. The method according to claim 1, characterized in that: The step of determining a motion control signal of a zoom device according to the variable magnification voltage and the focus voltage comprises: Determining a zoom voltage curve that matches the variable magnification voltage; wherein the zoom voltage in the zoom voltage curve satisfies a skew distribution; Determining a mode value of the skew distribution according to the zoom voltage curve; Determine the focus position search range according to the mode value and a predetermined standard deviation of a focus evaluation curve; wherein the focus evaluation curve is determined based on a focusing experiment and is used to characterize focus evaluation values ​​at different defocus levels; A motion control signal of a zoom device is determined according to the focus voltage and the positive focus position search range.

5. The method according to claim 4, characterized in that The focus position search range includes a first search range and a second search range; the second search range is a subset of the first search range; The step of determining the motion control signal of the zoom device according to the focus voltage and the positive focus position search range comprises: If the focus voltage is not within the first search range, moving the zoom device toward the first search range according to the first step, and outputting a first control signal; If the focus voltage is within the first search range but not within the second search range, moving the zoom device toward the second search range according to a second step length and outputting a second control signal; If the focus voltage is within the second search range, the zoom device is moved in a first direction according to a third step length, and a third control signal is output; wherein the first direction is a direction close to an end point of a preset interval of the second search range.

6. The method according to claim 5, characterized in that The target control signal is a third control signal; If the motion control signal is a target control signal, obtaining focus evaluation results of three consecutive frames of target channel images, and determining a positive focus position according to the focus evaluation results, including: If the motion control signal is the third control signal, obtaining focus evaluation results of three consecutive frames of target channel images, and determining a positive focus position according to the focus evaluation results; After determining the motion control signal of the zoom device, the method further includes: If the motion control signal is the first control signal or the second control signal, the current moment is taken as the previous moment, and the process returns to obtain the variable magnification voltage and the focus voltage at the previous moment until the motion control signal is the third control signal.

7. A device for determining a positive focus position, characterized in that: The device comprises: A channel image extraction module, used to obtain a target image generated by a photosensitive device, and extract a target channel image from the target image; wherein the target channel image is an image generated based on a green channel component of each pixel in the target image; A focusing evaluation result determination module, used to determine the focusing evaluation result of the target channel image based on a preset focusing evaluation model; A motion control signal determination module, for obtaining a variable magnification voltage and a focus voltage at a previous moment if a focus signal is detected, and determining a motion control signal of a zoom device according to the variable magnification voltage and the focus voltage; The focus position determination module is used to obtain focus evaluation results of three consecutive frames of target channel images if the motion control signal is a target control signal, and determine the focus position according to the focus evaluation results.

8. An electronic device, characterized in that: The electronic device comprises: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for determining the focus position according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining the focus position according to any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for determining a focus position according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Digital microscope and focusing method thereof

    CN105785561A

  • Automatic focusing method, device and system

    CN107664899A

  • Iris imaging depth-of-field extension method based on liquid lens

    CN112394507A

  • Automatic focusing method of continuous zooming television sighting telescope based on FPGA (Field Programmable Gate Array)

    CN114785952A

  • Focusing method and device

    CN115701123A