Focusing noise reduction method and device and storage medium
By block division of the image and noise reduction processing using similarity and distance relationships, the problem of fluctuation in the focus clarity curve during automatic focus is solved, and the focus accuracy and imaging quality are improved.
Patent Information
- Application Number
- CN202510247529.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-05-16
Smart Images

Figure CN120017965A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a color ribbon generation method, device and storage medium. Background Art
[0002] Autofocus (AF) is one of the key technologies that are indispensable in modern digital cameras and smartphones. Its purpose is to keep the captured image clear by automatically adjusting the position of the lens. Contrast-based autofocus (CDAF) relies on the change in clarity in the image to determine whether the focus is appropriate. It evaluates the focus of the image by calculating the focus value (FV) in the continuous frame image sequence, and decides whether the lens focal length needs to be adjusted accordingly. By comparing the focus clarity of continuous image frames, the system can draw a focus clarity curve and judge the clarity change trend of the current image based on the curve. By analyzing the focus clarity curve, the system can give feedback to the focus motor, indicating whether it needs to step, the direction of the step, the amount of the step, and even whether the current picture has reached the clearest state. However, affected by image noise and external environmental interference, the FV curve is prone to local fluctuations and instability. Therefore, the noise reduction problem of the focus clarity curve during focusing deserves attention. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a focus noise reduction method, device and storage medium, in order to solve the technical problem that the FV curve noise is large during the focusing process. In the first aspect, a focus noise reduction method is provided, including: acquiring multiple images, the image is a frame of image acquired during the camera autofocus process; dividing the image into multiple blocks, and determining the first focus clarity of the block; dividing the area with the block as the central block, the area includes the central block and multiple adjacent blocks, and the multiple adjacent blocks are multiple blocks adjacent to the central block within a preset range; based on the focus clarity similarity or one or all of the distance parameters between the multiple adjacent blocks and the central block, determine the second focus clarity of the central block of the first image; the multiple images include a first image and a second image, based on the second focus clarity of the central block of the first image and the third focus clarity of the central block of the second image, determine the third focus clarity of the central block of the first image, wherein the second image is the previous frame of the first image. Based on the multiple third focus clarity in the first image, determine the total focus clarity of the first image.
[0004] The above focus denoising method, by dividing the image acquired during the focusing process into blocks, utilizes the similarity and / or distance relationship of the focus clarity between blocks in the same frame image, as well as the similarity of the focus clarity in adjacent frame images to denoise the focus clarity of the entire image. This can improve the real-time performance of the focus clarity statistics, and without modifying the single-pixel focus clarity calculation filter, improve the overall noise resistance of the image focus clarity and reduce the fluctuation of the focus clarity curve.
[0005] Optionally, dividing the area with the block as the central block also includes: when there is a missing position in the adjacent blocks in the area, using the central block or the adjacent block to fill the missing position, including: using the first focus clarity of the central block as the first focus clarity of the missing adjacent block; or using the midline of the central block as the axis, using the first focus clarity of the adjacent block symmetrical to the missing position as the first focus clarity of the missing adjacent block.
[0006] Optionally, the region includes blocks of N rows and M columns, wherein N and M are odd numbers, and N is greater than or equal to 3, and M is greater than or equal to 3.
[0007] Optionally, the second focus clarity of the central block is determined based on the focus clarity similarity between multiple adjacent blocks and the central block, including: determining the focus clarity similarity based on the first focus clarity of the adjacent blocks, the first focus clarity of the central block, and the influence factor of the adjacent blocks on the central block; determining the second focus clarity based on the focus clarity similarity and the first focus clarity of the adjacent blocks.
[0008] Optionally, the second focus clarity of the central block is determined based on the distance parameters between multiple adjacent blocks and the central block, including: taking the middle block as a base point, determining the first coordinate of the middle block and the second coordinate of the adjacent block; determining the distance parameter from the adjacent block to the middle block based on the first coordinate and the second coordinate; determining the second focus clarity based on the distance parameter and the first focus clarity of the adjacent block.
[0009] Optionally, the second focus clarity of the central block is determined based on the focus clarity similarity and distance parameters between multiple adjacent blocks and the central block, including: determining a first result based on the focus clarity similarity and the first focus clarity of the adjacent blocks; using the first result as the first focus clarity of the block, and determining the second focus clarity based on the distance parameter and the first focus clarity of the adjacent blocks.
[0010] Optionally, the second focus clarity of the central block is determined based on the focus clarity similarity and distance parameters between multiple adjacent blocks and the central block, including: determining a second result based on the distance parameter and the first focus clarity of the adjacent block area; using the second result as the first focus clarity of the block area, and determining the second focus clarity based on the focus clarity similarity and the first focus clarity of the adjacent block area.
[0011] Optionally, based on the second focus clarity of the central block of the first image and the third focus clarity of the central block of the second image, determining the third focus clarity of the central block of the first image includes: determining a first intermediate result based on a first weight value and the second focus clarity of the central block of the first image; determining a second intermediate result based on a second weight value and the third focus clarity of the central block of the second image; and determining the third focus clarity of the central block of the first image by summing the first intermediate result and the second intermediate result, wherein the sum of the first weight value and the second weight value is 1, and the first weight value is greater than or equal to the second weight value.
[0012] In a second aspect, a focus noise reduction device is provided, comprising: an acquisition unit, for acquiring multiple images, the image being a frame of image acquired during the camera autofocus process, the multiple images including a first image and a second image; a division unit, for dividing the image into multiple blocks, and determining a first focus clarity of the block; and further for dividing a region with the block as the central block, the region including the central block and multiple adjacent blocks, the multiple adjacent blocks being multiple blocks adjacent to the central block within a preset range; a first determination unit, for determining a second focus clarity of the central block based on one or all of the focus clarity similarities or distance parameters between the multiple adjacent blocks and the central block; a second determination unit, for determining a third focus clarity of the central block of the first image based on the second focus clarity of the central block of the first image and the third focus clarity of the central block of the second image, wherein the second image is a previous frame of the first image. A third determination unit, for determining the total focus clarity of the first image based on multiple third focus clarity in the first image.
[0013] In a third aspect, a computer-readable storage medium is provided, comprising instructions stored thereon, wherein when the instructions are executed by a processor, the focus noise reduction method provided in the first aspect is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The following is a brief introduction to the drawings used in describing the embodiments of the present application:
[0015] Figure 1 A schematic diagram of a process of focusing noise reduction method provided in some embodiments of the present application is shown;
[0016] Figure 2A schematic diagram of image block division provided in some embodiments of the present application is shown;
[0017] Figure 3 Another schematic diagram of image block division provided in some embodiments of the present application is shown;
[0018] Figure 4 The sigma parameter value determination function curve in some embodiments of the present application is shown;
[0019] Figure 5 A focus clarity curve comparison schematic diagram provided in some embodiments of the present application is shown;
[0020] Figure 6 A schematic structural diagram of a focus noise reduction device provided in some embodiments of the present application is shown. DETAILED DESCRIPTION
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will illustrate examples of implementation of the present application with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other accompanying drawings and other implementations can be obtained based on these drawings without creative work. Adjustments and improvements made without departing from the concept of the present application are all within the scope of protection of the present application.
[0022] In order to simplify the drawings, each figure only schematically shows the parts related to the embodiments, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only a part of the components with the same structure or function is schematically drawn, and there may be more or less components with the same structure or function in reality.
[0023] In this application, unless otherwise clearly specified and limited, ordinal numbers, such as "first", "second", etc., are only used to distinguish and describe associated objects, and cannot be understood as indicating or implying the relative importance or order between associated objects; in addition, they do not represent the number of associated objects. "Multiple" includes two or more, and other quantifiers are similar. " / " is used to describe the relationship between associated objects, which indicates the "or" relationship between associated objects. "And / or" is used to describe the relationship between associated objects, which includes any combination relationship between associated objects, such as "a and / or b" includes: "alone a", "alone b", or "a and b". "One or more" or "at least one" in multiple objects refers to any object or any combination of multiple objects, such as "one or more of a1, a2, a3" or "at least one of a1, a2, a3" includes: "alone a1", "alone a2", "alone a3", "a1 and a2", "a1 and a3", "a2 and a3" or "a1, a2 and a3".
[0024] Autofocus technology is one of the key technologies that are indispensable in modern digital cameras and smartphones. Its purpose is to keep the captured image clear by automatically adjusting the position of the lens. Contrast-based autofocus is a common and widely used technology. This method relies on the change of clarity in the image to determine whether the focus is appropriate. Specifically, CDAF evaluates the focus of the image by calculating the clarity value in a sequence of consecutive frame images, and decides whether the lens focal length needs to be adjusted accordingly. In the contrast-based autofocus process, the clarity of each frame of the image can be quantified by calculating the focus clarity of the frame. Focus clarity is usually closely related to the contrast of the image. The higher the image contrast, the higher the clarity. By comparing the focus clarity of consecutive image frames, the system can draw a focus clarity curve and judge the clarity change trend of the current image based on the curve. By analyzing the curve, the system can give feedback to the focus motor to indicate whether stepping is required, the direction of stepping, the amount of stepping, and even whether the current picture has reached the clearest state. Although this method has been widely used in some applications, the existing technology still faces some challenges. Traditional focusing algorithms often directly use the focus clarity of each frame of the image for focus judgment, or simply filter the focus clarity of the entire image. Such methods are easily affected by image noise and external environmental interference, resulting in local fluctuations and instability in the focus clarity curve. Especially in low-light or high-noise environments, noise interference can cause large fluctuations in the FV curve, which in turn causes the focus system to misjudge and fail to accurately determine the optimal focus position. Therefore, in the presence of noise, it is difficult for existing technologies to effectively remove noise interference in the focus clarity curve, making it impossible for the focus system to stably and accurately determine whether the image is clear, thereby affecting the focus accuracy and imaging quality. The present application provides a focus denoising method, device and storage medium, which divides the image obtained during the focusing process into blocks, utilizes the similarity of the focus clarity between blocks, denoises the focus clarity of the entire image, improves the real-time performance of focus clarity statistics, and improves the overall noise resistance of the image focus clarity without modifying the single-pixel focus clarity calculation filter, and reduces the fluctuation of the focus clarity curve.
[0025] Figure 1 A flow chart of a focus noise reduction method provided in some embodiments of the present application is shown. The method comprises at least the following steps:
[0026] S110: Acquire multiple images, where the image is a frame of image acquired during the camera autofocus process;
[0027] S120: Divide the image into a plurality of blocks, and determine a first focus clarity of the blocks;
[0028] S130: Dividing a region with the block as the central block, the region including the central block and a plurality of adjacent blocks, the plurality of adjacent blocks being a plurality of blocks adjacent to the central block within a preset range;
[0029] S140: Determine a second focus clarity of the central block based on one or all of the focus clarity similarities or distance parameters between the plurality of adjacent blocks and the central block;
[0030] S150: the plurality of images include a first image and a second image, and based on a second focus clarity of a central block of the first image and a third focus clarity of a central block of the second image, a third focus clarity of a central block of the first image is determined, wherein the second image is a previous frame image of the first image;
[0031] S160: Determine a total focus clarity of the first image based on a plurality of third focus clarity in the first image.
[0032] In the above embodiments, when dividing an image, the image can be evenly divided into blocks composed of multiple regular shapes, such as completely dividing the image into rectangles, and at the same time, the first focus clarity of the block is determined in each block. Each block may include one or more pixel units, which are not specifically limited here. After the division is completed, the blocks are selected in turn, and the selected block is used as the central block. Multiple adjacent blocks are delineated along the central block within a preset range. For example, the blocks adjacent to the left, right, top, bottom and four corners of the central block are all used as adjacent blocks of the central block to form a 3×3 area. Figure 2A schematic diagram of image block division provided in some embodiments of the present application is shown. Image P is divided into multiple rectangular blocks of x rows and y columns, a central block a is selected, and then its adjacent blocks b are delineated with the central block a as the center to form area A together. Multiple rectangular blocks determine their own focus clarity respectively, for example, in image P of x rows and y columns, the focus clarity is determined from FV(0,0) to F(x,y). In the same frame image, the image texture and contrast of adjacent blocks have certain similarities, so adjacent blocks with similar focus clarity can be used to eliminate noise interference. The focus clarity similarity value is mainly determined by the degree of similarity between the adjacent block and the selected central block, and the distance parameter is mainly determined by the physical distance between the adjacent block and the selected central block, such as the Euclidean distance. Therefore, the first focus clarity of the adjacent block can be taken into reference, for example, combined with the first focus clarity of the central block, calculated according to a certain demand ratio, and the second focus clarity of the central block is determined. Among them, the noise reduction process using the focus clarity similarity value or the distance parameter can be used selectively, such as adjusting the first focus clarity only by the focus clarity similarity value, or denoising the first focus clarity only by the distance parameter, or combining the two. In the process of combined use, the order between the two noise reduction processes is not restricted, and the focus clarity similarity value can be used for noise reduction first, and then the distance parameter can be used for noise reduction, or the two can be adjusted in sequence. In the focusing process, from a temporal perspective, the focus clarity of the same block of the image of adjacent frames is similar, so the focus clarity of the previous frame image can be used to participate in eliminating part of the noise interference of the current frame. That is, after determining the second focus clarity of all blocks of the image, the third focus clarity after noise reduction can be completed in combination with the previously acquired image (i.e., the second image), and the second focus clarity can continue to be denoised. For example, the two values of the second focus clarity determined in the first image and the third focus clarity determined in the second image can be assigned certain weights respectively, so as to adjust and determine the third focus clarity of the first image. Among them, if the second image does not exist before the first image, the second focus clarity can be denoised, and the second focus clarity can be used as the third focus clarity of the current image to determine the total focus clarity of the image. When determining the total focus clarity, the third focus clarity of all blocks in the image can be summed up to determine. The position of the blocks in the image can also be taken into reference. For example, starting from the center of the image, the third focus clarity of the blocks in the central area of the image has a larger weight, and the weight gradually decreases as it expands outward, thereby further smoothing the focus clarity curve. The focus denoising method of the present application has low computational complexity, and can count the focus clarity in real time, quickly adjust the focus clarity curve, and effectively improve the noise resistance of the focus clarity curve through multi-level noise reduction, and finally give the focusing motor accurate feedback control to improve the clarity of the final output image.
[0033] In some embodiments of the present application, the area is divided with the block as the central block, and also includes: when there is a missing position in the adjacent blocks in the area, the missing position is filled with the central block or the adjacent block, including: taking the first focus clarity of the central block as the first focus clarity of the missing adjacent block; or taking the midline of the central block as the axis, taking the first focus clarity of the adjacent block symmetrical to the missing position as the first focus clarity of the missing adjacent block.
[0034] Figure 3 Another image block division schematic diagram provided in some embodiments of the present application is shown. In the process of dividing the image into blocks and selecting the central block, each block can be used as the central block. However, some edge blocks have an incomplete number of adjacent blocks after division, such as Figure 3 In the illustrated area B, with block c as the center and multiple blocks d as adjacent blocks, there are missing positions on the left, top, bottom left, top left and top right. At this time, the first focus clarity of the central block can be assigned to the first focus clarity of the missing position to reduce the impact of the missing position on the calculation of the second focus clarity of the central block. Alternatively, the first focus clarity of the adjacent blocks at the corresponding positions can be assigned to the missing positions, for example, with the midline of the central block as the axis, the missing position on the left corresponds to the adjacent block on the right, and the missing position in the upper left corner corresponds to the adjacent block in the lower right corner.
[0035] In some embodiments, the region includes blocks of N rows and M columns, wherein N and M are odd numbers, and N is greater than or equal to 3, and M is greater than or equal to 3. For example, the blocks in the region form an arrangement of 3×3, 5×5, 7×7, etc., so that the central block can be determined relatively easily, thereby completing the noise reduction calculation.
[0036] In some embodiments, determining a second focus clarity of the central block based on focus clarity similarities between a plurality of adjacent blocks and the central block includes:
[0037] Determine the focus clarity similarity based on the first focus clarity of the adjacent blocks, the first focus clarity of the central block, and the influence factor of the adjacent blocks on the central block;
[0038] Based on the focus clarity similarity and the first focus clarity of the adjacent block, a second focus clarity is determined.
[0039] For example, the image is divided into M×N blocks, the first focus sharpness of the central block in the i-th row and j-th column can be represented by FV(i,j), and the first focus sharpness of the adjacent block can be represented by FV(i+k,j+g), where k and g are determined by the blocks between the central block and the adjacent block. For example, the first adjacent block on the right side of the central block FV(i,j) takes k as 1 and g as 0, and so on. The first focus sharpness FV(i,j) of each central block is demarcated. Taking the example of 3×3 division of blocks in the region, the second focus sharpness FVblock of the central block can be determined by formula 2. afterDN1 :
[0040]
[0041] Among them, ω represents the weight of the adjacent blocks, that is, the influence factor of the adjacent blocks on the central block. Figure 4 The sigma parameter value determination function curve in some embodiments of the present application is shown. Sigma is the value of the first focus clarity participation of adjacent blocks. The larger the sigma, the higher the reference degree of participation of adjacent blocks. The value can be reasonably set according to the needs. An excessively large setting may cause the final generated focus clarity curve to be distorted.
[0042] In some embodiments, a second focus clarity of the central block is determined based on distance parameters between multiple adjacent blocks and the central block, including: taking the middle block as a base point, determining a first coordinate (i, j) of the middle block and a second coordinate (i+k, j+g) of the adjacent block; determining a distance parameter φ from the adjacent block to the middle block based on the first coordinate (i, j) and the second coordinate (i+k, j+g); and determining a second focus clarity based on the distance parameter and the first focus clarity of the adjacent block.
[0043] Determine the second focus definition FVblock of the central block according to formula 3 afterDN1 :
[0044]
[0045] In the above embodiments, the physical distance between the central block and the adjacent blocks is included in the noise reduction. For example, the farther the Euclidean distance between the adjacent block and the central block is, the smaller the influence of the first focus clarity of the adjacent block on the second focus clarity determined by the central block. In the above formula 3, when calculating the value of φ, when the denominator is zero, the result of φ can be set equal to 1. By calculating the Euclidean distance, the focus clarity of the adjacent blocks that are close to the central block in physical space is included in the noise reduction process, which can effectively avoid the influence of noise far away from the central block on the focus judgment. Since the contrast and texture similarity of adjacent blocks in the image are high, the focus clarity of the adjacent blocks is used for noise reduction processing, which can smooth the focus clarity curve, remove noise interference, and significantly improve the focus accuracy. Compared with the processing of full-frame images, it can significantly reduce the computational complexity and improve the efficiency of real-time processing.
[0046] In some embodiments, a second focus clarity of a central block is determined based on the focus clarity similarity and distance parameters between multiple adjacent blocks and the central block, including: determining a first result based on the focus clarity similarity and the first focus clarity of the adjacent blocks; using the first result as the first focus clarity of the block, and determining a second focus clarity based on the distance parameter and the first focus clarity of the adjacent blocks.
[0047] In some embodiments, a second focus clarity of a central block is determined based on the focus clarity similarity and distance parameters between a plurality of adjacent blocks and the central block, including: determining a second result based on the distance parameter and the first focus clarity of the adjacent block area; using the second result as the first focus clarity of the block area, and determining a second focus clarity based on the focus clarity similarity and the first focus clarity of the adjacent block area.
[0048] The above embodiment of the focus noise reduction method can combine two noise reduction methods to achieve two-level noise reduction, which not only considers the similarity of the focus clarity between the adjacent blocks and the central block, but also considers the proportion of the focus clarity affected by the distance between the adjacent blocks and the central block, thereby improving the smoothing effect of the focus clarity curve. The two-level noise reduction method can make the processed image more consistent with the intuitive perception of the focus point of the human eye, the transition of image texture and contrast is more natural, and the artifacts or uneven image effects caused by noise interference are reduced, thereby improving the visual quality of the image.
[0049] In some embodiments, based on the second focus clarity of the central block of the first image and the third focus clarity of the central block of the second image, determining the third focus clarity of the central block of the first image includes: determining the third focus clarity of the central block of the first image based on the first weight value α and the second focus clarity FVblock of the central block of the first image. afterDN2 , determine a first intermediate result; based on the second weight value β and the third focus clarity FVblock of the central block of the second imagefrontafterDN3 , determine the second intermediate result; sum the first intermediate result and the second intermediate result to determine the third focus clarity FVblock of the central block of the first image afterDN3 , wherein the sum of the first weight value and the second weight value is 1, and the first weight value is greater than or equal to the second weight value.
[0050] Refer to the following formula 4:
[0051] FVblock afterDN3 (i,j)=α*FVblock afterDN2 (i,j)+β*FVblock frontafterDN3 (i,j) Formula 4
[0052] In order to ensure that the first image is not overly affected by the second image, the first weight value α and the second weight value β can be constrained so that the first weight value α accounts for a larger proportion than the second weight value β to prevent the focus clarity curve generated in the end from being distorted. After determining the third focus clarity of each central block of the first image, sum them to determine the total focus clarity of the first image, referring to Formula 5:
[0053]
[0054] Alternatively, the position of the block in the image is taken into consideration. For example, starting from the center of the image, the third focus clarity of the block in the central area of the image has a larger weight, and the weight gradually decreases as it expands outward. The regional weight value δ is introduced, and the regional weight value δ can gradually decrease from the middle area to the outside, thereby further smoothing the focus clarity curve. Refer to Formula 6 for determination:
[0055]
[0056] Figure 5 A focus clarity curve comparison diagram provided in some embodiments of the present application is shown. The focus clarity and lens focus position change on the left is a curve without noise reduction processing, and the right is a curve determined after three-level noise reduction (reference focus clarity similarity value, distance parameter and three-level noise reduction of adjacent frame similarity). It can be clearly seen that the focus clarity curve is smoother.
[0057] Based on the same technical concept, Figure 6The structure diagram of a focus noise reduction device provided in some embodiments of the present application is shown. The focus noise reduction device 600 includes: an acquisition unit 610, which is used to acquire multiple images, the image is a frame of image acquired during the camera autofocus process, and the multiple images include a first image and a second image; a division unit 620, which is used to divide the image into multiple blocks and determine the first focus clarity of the block; and is also used to divide the area with the block as the central block, the area includes the central block and multiple adjacent blocks, and the multiple adjacent blocks are multiple blocks adjacent to the central block within a preset range; a first determination unit 630, which is used to determine the second focus clarity of the central block based on one or all parameters of the focus clarity similarity or distance parameters between the multiple adjacent blocks and the central block; a second determination unit 640, which is used to determine the third focus clarity of the central block of the first image based on the second focus clarity of the central block of the first image and the third focus clarity of the central block of the second image, wherein the second image is a previous frame image of the first image. The third determining unit 650 is configured to determine the total focus clarity of the first image based on a plurality of third focus clarity in the first image.
[0058] The division of the above units is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. In addition, the above units can be implemented in the form of a processor calling software; for example, the focus noise reduction device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above focus noise reduction methods or realize the functions of each unit, wherein the processor is, for example, a general-purpose processor, such as a central processing unit (CPU), and the memory is a memory in the device or a memory outside the device. Alternatively, the above units can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in some embodiments, the hardware circuit is an application specific integrated circuit (ASIC), and the functions of some or all units above are realized by designing the logical relationship of the components in the circuit; for example, in another implementation, the hardware circuit can be implemented by a programmable logic device (PLD), which can include a large number of logic gate circuits, and the logical relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all units above. All units of the above focus noise reduction device can be implemented in the form of a processor calling a program, or in the form of a hardware circuit, or in the form of a processor calling a program and the rest in the form of a hardware circuit.
[0059] In addition, an embodiment of the present application further provides a computer-readable storage medium, including instructions stored thereon, and when the instructions are called by a processor, any one of the focus noise reduction methods in the above embodiments is executed. An embodiment of the present application further provides a computer program (or computer program product), including instructions, and when the instructions are called by a processor, any one of the focus noise reduction methods in the above embodiments is executed.
[0060] The above computer-readable storage medium can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0061] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. In addition, the above embodiments can be freely combined as needed.
Claims
1. A focus noise reduction method, characterized in that: include: Acquire multiple images, where the image is a frame of image acquired during the camera autofocus process; Dividing the image into a plurality of blocks, and determining a first focus clarity of the blocks; Dividing a region with the block as the central block, the region including the central block and a plurality of adjacent blocks, the plurality of adjacent blocks being a plurality of blocks adjacent to the central block within a preset range; Determine a second focus clarity of the central block based on one or all of the focus clarity similarities or distance parameters between the plurality of adjacent blocks and the central block; The multiple images include a first image and a second image, and based on a second focus clarity of a central block of the first image and a third focus clarity of a central block of the second image, a third focus clarity of a central block of the first image is determined, wherein the second image is a previous frame image of the first image; Based on the plurality of third focus sharpnesses in the first image, an overall focus sharpness of the first image is determined.
2. The focus noise reduction method according to claim 1, characterized in that: The said area division with the said block as the center block also includes: When there is a missing position of the adjacent blocks in the area, the missing position is filled by using the central block or the adjacent blocks, including: Using the first focus clarity of the central block as the first focus clarity of the missing adjacent blocks; or Taking the midline of the central block as the axis, the first focus clarity of the adjacent block symmetrical to the missing position is used as the first focus clarity of the missing adjacent block.
3. The focus noise reduction method according to claim 2, characterized in that: The area includes blocks with N rows and M columns, wherein N and M are odd numbers, and N is greater than or equal to 3, and M is greater than or equal to 3.
4. The focus noise reduction method according to any one of claims 1 to 3, characterized in that: Determining a second focus clarity of the central block based on focus clarity similarities between the plurality of adjacent blocks and the central block comprises: Determining the focus clarity similarity based on the first focus clarity of the adjacent blocks, the first focus clarity of the central block, and an influence factor of the adjacent blocks on the central block; The second focus clarity is determined based on the focus clarity similarity and the first focus clarity of the adjacent block.
5. The focus noise reduction method according to claim 4, characterized in that: Determining a second focus clarity of the central block based on a plurality of distance parameters between the adjacent blocks and the central block includes: Taking the middle block as a base point, determining a first coordinate of the middle block and a second coordinate of the adjacent block; Determine the distance parameter from the adjacent block to the middle block based on the first coordinate and the second coordinate; The second focus clarity is determined based on the distance parameter and the first focus clarity of the adjacent block.
6. The focus noise reduction method according to claim 5, characterized in that: Determining a second focus clarity of the central block based on focus clarity similarities and distance parameters between the plurality of adjacent blocks and the central block comprises: Determine a first result based on the focus clarity similarity and the first focus clarity of the adjacent block; The first result is used as the first focus clarity of the block, and the second focus clarity is determined based on the distance parameter and the first focus clarity of the adjacent block.
7. The focus noise reduction method according to claim 5, characterized in that: Determining a second focus clarity of the central block based on focus clarity similarities and distance parameters between the plurality of adjacent blocks and the central block comprises: Determine a second result based on the distance parameter and the first focus clarity of the adjacent block area; The second result is used as the first focus clarity of the block area, and the second focus clarity is determined based on the focus clarity similarity and the first focus clarity of the adjacent block area.
8. The focus noise reduction method according to any one of claims 1 to 3, characterized in that: The determining, based on the second focus clarity of the central block of the first image and the third focus clarity of the central block of the second image, a third focus clarity of the central block of the first image comprises: Determine a first intermediate result based on a first weight value and a second focus clarity of a central block of the first image; Determine a second intermediate result based on a second weight value and a third focus clarity of a central block of the second image; The first intermediate result and the second intermediate result are summed to determine a third focus clarity of a central block of the first image, wherein the sum of the first weight value and the second weight value is 1, and the first weight value is greater than or equal to the second weight value.
9. A focusing noise reduction device, characterized in that: include: An acquisition unit, configured to acquire a plurality of images, wherein the image is a frame of images acquired during the automatic focusing process of the camera, and the plurality of images include a first image and a second image; a dividing unit, used to divide the image into a plurality of blocks, determine a first focus definition of the blocks; and further used to divide an area with the block as a central block, wherein the area includes the central block and a plurality of adjacent blocks, wherein the plurality of adjacent blocks are a plurality of blocks adjacent to the central block within a preset range; A first determining unit, configured to determine a second focus clarity of the central block based on one or all of focus clarity similarities or distance parameters between the plurality of adjacent blocks and the central block; The second determination unit is used to determine the third focus clarity of the central block of the first image based on the second focus clarity of the central block of the first image and the third focus clarity of the central block of the second image, wherein the second image is a previous frame image of the first image. The third determining unit is used to determine the total focus clarity of the first image based on the plurality of third focus clarity in the first image.
10. A computer-readable storage medium, characterized in that: The invention comprises instructions stored thereon, wherein when the instructions are executed by a processor, the focus noise reduction method according to any one of claims 1 to 8 is executed.