Methods, apparatus, media and equipment for testing the shadow correction effect of PD lenses

By acquiring and analyzing the PD information of the photosensitive chip, generating and processing the difference image, the problem of insufficient detection accuracy of lens shadow correction effect is solved, ensuring image quality.

CN115866241BActive Publication Date: 2025-10-31KUNSHAN QIUTI PHOTOELECTRIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211513388.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-29
Publication Date
2025-10-31
Estimated Expiration
2042-11-29

AI Technical Summary

Technical Problem

In existing technologies, the detection accuracy of lens shadow correction effect cannot be guaranteed, which often leads to situations where the lens passes the inspection but the captured image is unqualified.

Method used

By acquiring the target image and the PD information of the masked pixels in the photosensitive chip, the image is parsed into a first PD image and a second PD image. The difference image is calculated, and the difference image is subjected to dilation, binarization, and erosion processing to detect the lens shadow correction effect.

Benefits of technology

It improves the detection accuracy of lens shadow correction effect and ensures image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115866241B_ABST
    Figure CN115866241B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, medium, and device for detecting the shading correction effect of a PD lens. The method includes: acquiring a target image and PD information of occluded pixels in a photosensitive chip; the target image is an image taken using a lens with fast focusing function; analyzing the target image based on the PD information to obtain a first PD image and a second PD image; determining a difference image based on the first PD image and the second PD image; and detecting the shading correction effect of the lens based on the difference image. Thus, since lens shading correction is equivalent to uniformity correction of PD points, the detection accuracy can be ensured when detecting the correction effect based on the difference image of the first PD image and the second PD image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of camera module testing technology, and in particular to a method, apparatus, medium and equipment for testing the shadow correction effect of PD lens. Background Technology

[0002] PD lenses utilize image sensors with PD dots. PD dots are symmetrically arranged, regular pixels on the image sensor that enable fast focusing. Due to the lens's optical characteristics, uneven optical refraction during image formation can cause shadows around the lens, resulting in vignetting at the edges of the image and affecting overall image quality.

[0003] To ensure image quality, Lens Shading Correction (LSC) is generally used to correct images. Therefore, it is necessary to test the effect of lens shading correction to determine whether the correction accuracy meets the requirements.

[0004] In related technologies, the detection methods provided by the image sensor manufacturers are generally used for detection. However, in practical applications, it has been found that the detection accuracy of lens shadow correction effect cannot be guaranteed, and there are often situations where the lens passes the detection but the captured image is unqualified.

[0005] Therefore, a method for detecting the effect of lens shadow correction is urgently needed to solve the above problems. Summary of the Invention

[0006] To address the problems existing in the prior art, embodiments of the present invention provide a method, apparatus, medium, and device for detecting the shadow correction effect of a PD lens, so as to solve or partially solve the technical problem that the detection accuracy cannot be guaranteed when detecting the shadow correction effect of a lens in the prior art.

[0007] A first aspect of the present invention provides a method for detecting the shadow correction effect of a PD lens, the method comprising:

[0008] Acquire the target image and the PD information of the masked pixels in the image sensor; the target image is an image captured by a lens with fast focusing function;

[0009] The target image is analyzed based on the PD information to obtain a first PD image and a second PD image;

[0010] Determine the difference image based on the first PD image and the second PD image;

[0011] The lens shadow correction effect is detected based on the difference image.

[0012] In the above scheme, the step of parsing the target image based on the PD information to obtain the first PD image includes:

[0013] Determine the number of rows of left-hand PD points contained in each PDBlock storage block and the number of left-hand PD points contained in each row; the position and number of PD points contained in each PDBlock are the same;

[0014] The coordinates of each left PD point in the first PDBlock are determined based on the PD information, the number of rows of left PD points contained in the first PDBlock storage block, and the number of left PD points contained in each row.

[0015] The coordinates of the left PD points in the remaining PDBlocks are determined based on the coordinates of each left PD point in the first PDBlock.

[0016] The first PD image is formed by extracting the corresponding PD point pixels based on the coordinates of each left PD point in all PDBlocks.

[0017] In the above scheme, determining the coordinates of each left PD point in the first PDBlock based on the PD information, the number of rows of left PD points contained in the first PDBlock storage block, and the number of left PD points contained in each row includes:

[0018] Based on the PD information, the X-axis and Y-axis relative coordinates of each left PD point in the first PDBlock relative to the origin of the target image are determined.

[0019] The x-coordinate of each left PD point is determined based on the relative coordinates along the X-axis and the initial offset of each left PD point in the x-direction.

[0020] The ordinate of each left PD point is determined based on the relative Y-axis coordinate and the initial offset of each left PD point in the y-direction.

[0021] In the above scheme, determining the coordinates of the left PD points in the remaining PDBlocks based on the coordinates of each left PD point in the first PDBlock includes:

[0022] Obtain the sequence number of each remaining PD storage block;

[0023] The coordinates of all left-side PD points in the remaining PDBlocks are determined based on the coordinates of each left-side PD point in the first PDBlock, the sequence number of each remaining PDBlock, and the number of pixels in the x-direction within each PD storage block.

[0024] In the above scheme, determining the coordinates of all left-side PD points in the remaining PDBlocks based on the coordinates of each left-side PD point in the first PDBlock, the sequence number of each remaining PDBlock, and the number of pixels in the x-direction within each PD storage block includes:

[0025] According to formula P i ′=P i *n+PD_PITCH_X determines the coordinates of the leftmost PD point P in the remaining PDBlock. i ';in,

[0026] P i Let i represent the coordinates of each left-hand PD point stored in the first PD storage block, where i is the index of the left-hand PD point in each PDBlock, n is the index of each PDBlock, and PD_PITCH_X is the number of pixels in the x-direction within each PDBlock.

[0027] In the above scheme, determining the difference image based on the first PD image and the second PD image includes:

[0028] Obtain the first brightness value of each pixel in the first PD image and obtain the second brightness value of each pixel in the second PD image;

[0029] Obtain the absolute value of the brightness difference between the first brightness value and the second brightness value, and obtain a difference image based on the absolute value of the brightness difference.

[0030] In the above scheme, the step of detecting the lens shadow correction effect based on the difference image includes:

[0031] Dilatation is performed on the difference image to obtain a dilated difference image;

[0032] The dilated difference image is binarized to obtain a binarized difference image;

[0033] The binarized difference image is subjected to erosion processing to obtain the eroded binarized difference image;

[0034] The number of bright spots in the binarized difference image after erosion is obtained. If the number of bright spots is determined to be greater than a preset threshold, the lens shadow correction effect is determined to be unqualified.

[0035] A second aspect of the present invention provides an apparatus for detecting the shadow correction effect of a PD lens, the apparatus comprising:

[0036] The acquisition unit is used to acquire a target image and PD information of masked pixels in the photosensitive chip; the target image is an image captured by a lens with fast focusing function;

[0037] The parsing unit is used to parse the target image based on the PD information to obtain a first PD image and a second PD image;

[0038] The determining unit is configured to determine a difference image based on the first PD image and the second PD image;

[0039] The detection unit is used to detect the lens shadow correction effect based on the difference image.

[0040] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in any of the first aspects.

[0041] A fourth aspect of the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the method described in any of the first aspects.

[0042] This invention provides a method, apparatus, medium, and device for detecting the shadow correction effect of a PD lens. The method includes: acquiring a target image and PD information of occluded pixels in a photosensitive chip; the target image is an image taken using a lens with fast focusing function; analyzing the target image based on the PD information to obtain a first PD image and a second PD image; determining a difference image based on the first PD image and the second PD image; and detecting the shadow correction effect of the lens based on the difference image. Thus, since lens shadow correction mainly involves uniformity correction of PD points, the detection accuracy can be ensured when detecting the correction effect based on the difference image of the first PD image and the second PD image. Attached Figure Description

[0043] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings.

[0044] In the attached diagram:

[0045] Figure 1 A schematic flowchart of a method for detecting the shadow correction effect of a PD lens according to an embodiment of the present invention is shown;

[0046] Figure 2 A schematic diagram of a target image according to an embodiment of the present invention is shown;

[0047] Figure 3The diagram illustrates the PD point density in the x-direction and the PD point density in the y-direction within a PDBlock according to an embodiment of the present invention.

[0048] Figure 4 A schematic diagram of a first PD image according to an embodiment of the present invention is shown;

[0049] Figure 5 A schematic diagram of a second PD image according to an embodiment of the present invention is shown;

[0050] Figure 6 A schematic diagram of a difference image according to an embodiment of the present invention is shown;

[0051] Figure 7 A schematic diagram of a device for detecting the shadow correction effect of a PD lens according to an embodiment of the present invention is shown;

[0052] Figure 8 A schematic diagram of a computer device structure according to an embodiment of the present invention is shown;

[0053] Figure 9 A schematic diagram of a computer-readable storage medium structure according to an embodiment of the present invention is shown. Detailed Implementation

[0054] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0055] This invention provides a method for detecting the shadow correction effect of a PD lens, such as... Figure 1 As shown, the method mainly includes the following steps:

[0056] S110, acquire the target image and PD information of the masked pixels in the image sensor; the target image is an image captured by a lens using a fast focusing function;

[0057] PD points, also known as masked pixels, are symmetrically positioned points (including left and right PD points) on the image sensor to enable fast autofocus. The target image is the raw image captured using a PD lens (a lens with fast autofocus), and it can be in RAW format. The target image can be formatted as follows: Figure 2 As shown.

[0058] In this embodiment, the PD point information in the photosensitive chip is preset, and the PD point information may include the following information:

[0059] PD_OFFSET_X: The initial offset of the PD point in the x-direction, including the initial offset of each left PD point and the initial offset of each right PD point in the x-direction;

[0060] PD_OFFSET_Y: The initial offset of the PD point in the y direction, including the initial offset of each left PD point and the initial offset of each right PD point in the y direction;

[0061] PD_PITCH_X: The number of pixels in the x-direction within each PDBlock (PD storage block);

[0062] PD_PITCH_Y: The number of pixels in the y-direction within each PDBlock;

[0063] PD_DENSITY_X: The density of PD points in the x direction within each PDBlock, including the density of PD points on the left and right sides in the x direction;

[0064] PD_DENSITY_Y: The density of PD points in the y direction within each PDBlock, including the density of PD points on the left and right sides in the y direction;

[0065] PD_BLK_NUM_X: The number of PDB blocks in the x-direction of the target image.

[0066] PD_BLK_NUM_Y: The number of PDB blocks in the y-direction of the target image.

[0067] PD_POS_L: The relative coordinates of each left PD point within the PDBlock relative to the origin of the target image;

[0068] PD_POS_R: The relative coordinates of each right-hand PD point within the PDBlock relative to the origin of the target image;

[0069] The PD point density in the x-direction and the PD point density in the y-direction within each PDBlock can be defined as follows: Figure 3 As shown.

[0070] It is worth noting that the photosensitive chip contains multiple PDBlocks, each of which contains a left PD point and a right PD point. The number and arrangement of PD points in each PDBlock are the same. Therefore, once the coordinates of the PD points in the first PDBlock are determined, the coordinates of the PD points in all the remaining PDBlocks can be determined based on the coordinates of the PD points in the first PDBlock and the PD information.

[0071] S111, Analyze the target image based on the PD information to obtain a first PD image and a second PD image;

[0072] After obtaining the target image, it is necessary to extract the left and right PD images from it. Therefore, the target image needs to be parsed based on the PD information to obtain the first and second PD images. The first PD image is the left PD image, and the second PD image is the right PD image.

[0073] Since the methods for obtaining the first PD image and the second PD image are similar, the difference lies in that the first PD image is obtained using the left PD point as the parsing object, while the second PD image is obtained using the right PD point as the parsing object. To avoid redundancy, the first PD image will be used as an example here. When determining the second PD object, the method for determining the first PD image can be referred to, simply replacing the left PD point used to determine the first PD image with the right PD point.

[0074] In one implementation, the target image is parsed based on PD information to obtain a first PD image, including:

[0075] Determine the number of rows of left-hand PD points contained in each PDBlock storage block and the number of left-hand PD points contained in each row;

[0076] The coordinates of each left PD point in the first PDBlock are determined based on the PD information, the number of rows of left PD points contained in the first PDBlock storage block, and the number of left PD points contained in each row.

[0077] The coordinates of the left PD points in the remaining PDBlocks are determined based on the coordinates of each left PD point in the first PDBlock.

[0078] The first PD image is formed by extracting the corresponding PD point pixels based on the coordinates of each left PD point in all PDBlocks.

[0079] In one implementation, determining the coordinates of each left PD point in the first PDBlock based on the PD information, the number of rows of left PD points contained in the first PDBlock storage block, and the number of left PD points contained in each row includes:

[0080] Based on the PD information, the X-axis and Y-axis relative coordinates of each left PD point in the first PDBlock relative to the origin of the target image are determined;

[0081] The x-coordinate of each left PD point is determined based on its relative x-axis coordinate and the initial offset of each left PD point in the x-direction.

[0082] The ordinate of each left PD point is determined based on its relative Y-axis coordinate and the initial offset of each left PD point in the y-direction.

[0083] In one implementation, determining the coordinates of the left PD points in the remaining PDBlocks based on the coordinates of each left PD point in the first PDBlock includes:

[0084] Obtain the sequence number of each remaining PD storage block;

[0085] The coordinates of all left-side PD points in the remaining PDBlocks are determined based on the coordinates of each left-side PD point in the first PDBlock, the sequence number of each remaining PDBlock, and the number of pixels in the x-direction within each PD storage block.

[0086] In one implementation, determining the coordinates of all left-side PD points in the remaining PDBlocks based on the coordinates of each left-side PD point in the first PDBlock, the sequence number of each remaining PDBlock, and the number of pixels in the x-direction within each PD storage block includes:

[0087] According to formula P i ′=P i *n+PD_PITCH_X determines the coordinates of the leftmost PD point P in the remaining PDBlock. i ';in,

[0088] P i Let i represent the coordinates of each left-hand PD point stored in the first PD storage block, where i is the index of the left-hand PD point in each PDBlock, n is the index of each PDBlock, and PD_PITCH_X is the number of pixels in the x-direction within each PDBlock.

[0089] Specifically, since the position and number of left-side PD points in each PDBlock are the same, the number of rows of left-side PD points in each PDBlock, PD_Num_PerBlock_X, and the number of left-side PD points in each row, PD_Num_PerBlock_Y, can be determined based on formulas (2) and (3).

[0090] PD_Num_PerBlock_X=PD_PITCH_X / PD_DENSITY_X(2)

[0091] PD_Num_PerBlock_Y=PD_PITCH_Y / PD_DENSITY_Y(3)

[0092] Wherein, PD_PITCH_X is the number of pixels in the x-direction within each PDBlock, PD_DENSITY_X is the density of left-side PD points in the x-direction within each PDBlock, PD_PITCH_Y is the number of pixels in the y-direction within each PDBlock, and PD_DENSITY_Y is the density of left-side PD points in the y-direction within each PDBlock.

[0093] Thus, after obtaining the row number of the left PD points within the first PDBlock, the x-coordinate PD_L_X[i] of each left PD point within the first PDBlock can be determined based on formula (4), and the y-coordinate PD_L_Y[i] of each left PD point within the first PDBlock can be determined based on formula (5).

[0094] PD_L_X[i]=PD_OFFSET_X+PD_POS_L_X[i](4)

[0095] PD_L_Y[i]=PD_OFFSET_Y+PD_POS_L_Y[i](5)

[0096] Where i is the sequence number of each left PD point in the first PD storage block; PD_OFFSET_X is the starting offset of each left PD point in the x direction; PD_POS_L_X[i] is the relative x-coordinate of each left PD point in the first PD storage block relative to the origin of the target image; PD_OFFSET_Y is the starting offset of each left PD point in the y direction; and PD_POS_L_Y[i] is the relative y-coordinate of each left PD point in the first PD storage block relative to the origin of the target image.

[0097] For example, suppose the first PDBlock contains 4 rows of left PD points, and each row contains 2 left PD points, then i is 8.

[0098] The relative coordinates of each left PD point in the first PDBlock with respect to the origin of the target image, the starting offset of each left PD point in the x-direction, and the starting offset of each left PD point in the y-direction can all be obtained from the PD information. That is, PD_POS_L_X[i], PD_POS_L_Y[i], PD_OFFSET_X, and PD_OFFSET_Y are known. Therefore, the coordinates of the 8 left PD points contained in the first PDBlock can be determined based on the above information.

[0099] Since the position and number of PD points are the same in each PDBlock, the coordinates of the left PD points in all PDBlocks can be determined based on the coordinates of the left PD points in the first PDBlock.

[0100] Finally, the corresponding left-side PD image can be extracted based on the coordinates of the left-side PD points of all PDBlocks. Similarly, the right-side PD image can be extracted using the same method as the left-side PD image extraction described above, which will not be repeated here. The left-side PD image can be obtained as follows: Figure 4 As shown, the PD image on the right can be seen as follows: Figure 5 As shown.

[0101] S112, determine the difference image based on the first PD image and the second PD image;

[0102] Since the lens shadow correction process mainly corrects the uniformity of PD points, the correction effect can be detected based on the first PD image and the second PD image.

[0103] In one implementation, determining a difference image based on a first PD image and a second PD image includes:

[0104] Obtain the first brightness value of each pixel in the first PD image and obtain the second brightness value of each pixel in the second PD image;

[0105] Obtain the absolute value of the brightness difference between the first brightness value and the second brightness value, and obtain the difference image based on the absolute value of the brightness difference.

[0106] Specifically, since the left and right PD points are symmetrical, the first and second PD images are the same size. Therefore, by subtracting the brightness values ​​of corresponding pixels, a difference image can be obtained. The difference image can be shown as follows: Figure 6 As shown.

[0107] S113, The lens shadow correction effect is detected based on the difference image.

[0108] In one implementation, detecting the lens shading correction effect based on the difference image includes:

[0109] Dilatation is applied to the difference image to obtain the dilatated difference image;

[0110] The dilated difference image is binarized to obtain a binarized difference image;

[0111] The binarized difference image is subjected to erosion processing to obtain the eroded binarized difference image;

[0112] The number of bright spots in the binarized difference image after erosion is obtained. If the number of bright spots is greater than a preset threshold, the lens shadow correction effect is determined to be unqualified. The preset threshold can be set based on customer needs and is not limited here.

[0113] In this embodiment, to improve the quality of the difference image, it is necessary to first perform a dilation operation on the difference image to fill in the defects within the difference image, as follows:

[0114] Set the convolution kernel based on the size of the difference image;

[0115] Based on the convolution kernel, the dilation function of the OpenCV vision library is called to perform convolution calculation on the difference image to obtain the dilated difference image.

[0116] To facilitate the detection of lens shadow correction effects, this embodiment requires binarization of the dilated difference image, ultimately obtaining a binarized image containing only black and white pixels. The binarization process works by determining a pixel grayscale threshold, setting the grayscale values ​​of pixels in the dilated difference image greater than this threshold to 255, and setting the grayscale values ​​of pixels less than this threshold to 0. The final image presents a black and white visual effect.

[0117] In order to more clearly display the bright spots in the binarized difference image and improve detection efficiency, it is also necessary to perform an erosion operation on the binarized difference image to remove the burrs.

[0118] In this way, since lens shadow correction is equivalent to uniformity correction of PD points, the detection accuracy can be ensured when detecting the correction effect based on the difference image between the first PD image and the second PD image.

[0119] Based on the same inventive concept as in the foregoing embodiments, this embodiment also provides a device for detecting the shadow correction effect of a PD lens, such as... Figure 7 As shown, the device includes:

[0120] The acquisition unit 71 is used to acquire the target image and the PD information of the masked pixels in the photosensitive chip; the target image is an image captured by a lens with fast focusing function;

[0121] The parsing unit 72 is used to parse the target image based on the PD information to obtain a first PD image and a second PD image;

[0122] Determining unit 73 is used to determine a difference image based on the first PD image and the second PD image;

[0123] The detection unit 74 is used to detect the lens shadow correction effect based on the difference image.

[0124] Since the apparatus described in the embodiments of this invention is used to implement the method for detecting the shadow correction effect of a PD lens according to the embodiments of this invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the method described in the embodiments of this invention, and therefore will not be described in detail here. All apparatuses used in the methods of the embodiments of this invention fall within the scope of protection of this invention.

[0125] Based on the same inventive concept, this embodiment provides a computer device 800, such as... Figure 8 As shown, it includes a memory 810, a processor 820, and a computer program 811 stored in the memory 810 and executable on the processor 820. When the processor 820 executes the computer program 811, it implements any step of the method described above.

[0126] Based on the same inventive concept, this embodiment provides a computer-readable storage medium 900, such as... Figure 9 As shown, a computer program 911 is stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0127] Through one or more embodiments of the present invention, the present invention has the following beneficial effects or advantages:

[0128] This invention provides a method, apparatus, medium, and device for detecting the shading correction effect of a PD lens. The method includes: acquiring a target image and PD information of occluded pixels in a photosensitive chip; the target image is an image taken using a lens with fast focusing function; analyzing the target image based on the PD information to obtain a first PD image and a second PD image; determining a difference image based on the first PD image and the second PD image; and detecting the shading correction effect of the lens based on the difference image. Thus, since lens shading correction is equivalent to uniformity correction of PD points, the detection accuracy can be ensured when detecting the correction effect based on the difference image of the first PD image and the second PD image.

[0129] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0130] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0131] Similarly, it should be understood that, in order to simplify this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.

[0132] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0133] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0134] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components of the gateway, proxy server, or system according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing some or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0135] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0136] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0137] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting the shadow correction effect of a PD lens, characterized in that, The method includes: Acquire the target image and the PD information of the masked pixels in the image sensor; the target image is an image captured by a lens with fast focusing function; The target image is analyzed based on the PD information to obtain a first PD image and a second PD image; the method of obtaining the first PD image is the same as the method of obtaining the second PD image; Determine the difference image based on the first PD image and the second PD image; The lens shading correction effect is detected based on the difference image; wherein... The step of parsing the target image based on the PD information to obtain a first PD image includes: Determine the number of rows of left-hand PD points contained in each PDBlock storage block and the number of left-hand PD points contained in each row; the position and number of PD points contained in each PDBlock are the same; The coordinates of each left PD point in the first PDBlock are determined based on the PD information, the number of rows of left PD points contained in the first PDBlock storage block, and the number of left PD points contained in each row. The coordinates of the left PD points in the remaining PDBlocks are determined based on the coordinates of each left PD point in the first PDBlock. The PD point pixels at the corresponding positions are extracted based on the coordinates of each left PD point in all PDBlocks to form the first PD image; The step of detecting the lens shadow correction effect based on the difference image includes: Dilatation is performed on the difference image to obtain a dilated difference image; The dilated difference image is binarized to obtain a binarized difference image; The binarized difference image is subjected to erosion processing to obtain the eroded binarized difference image; The number of bright spots in the binarized difference image after erosion is obtained. If the number of bright spots is determined to be greater than a preset threshold, the lens shadow correction effect is determined to be unqualified.

2. The method as described in claim 1, characterized in that, The step of determining the coordinates of each left PD point in the first PDBlock based on the PD information, the number of rows of left PD points contained in the first PDBlock storage block, and the number of left PD points contained in each row includes: Based on the PD information, the X-axis and Y-axis relative coordinates of each left PD point in the first PDBlock relative to the origin of the target image are determined. Based on the X-axis relative coordinates and each of the left PD points, x The initial offset in the direction determines the x-coordinate of each left PD point; Based on the relative Y-axis coordinates and each of the left PD points, y The initial offset in the direction determines the ordinate of each left PD point.

3. The method as described in claim 1, characterized in that, The step of determining the coordinates of the left PD points in the remaining PDBlocks based on the coordinates of each left PD point in the first PDBlock includes: Obtain the sequence number of each remaining PD storage block; Based on the coordinates of each left-hand PD point in the first PDBlock, the sequence number of each remaining PDBlock, and the contents of each PD storage block x The number of pixels in a direction determines the coordinates of all left-side PD points in the remaining PDBlock.

4. The method as described in claim 3, characterized in that, The method is based on the coordinates of each left-hand PD point in the first PDBlock, the sequence number of each remaining PDBlock, and the data within each PD storage block. x The number of pixels in a direction determines the coordinates of all left-side PD points in the remaining PDBlock, including: According to the formula Determine the coordinates of the left PD point in the remaining PDBlock. ;in, The coordinates of each left-hand PD point stored in the first PD storage block, the i The sequence number of the leftmost PD point in each PDBlock, the n The sequence number for each PDBlock, the Within each PDBlock x The number of pixels in the direction.

5. The method as described in claim 1, characterized in that, The step of determining the difference image based on the first PD image and the second PD image includes: Obtain the first brightness value of each pixel in the first PD image and obtain the second brightness value of each pixel in the second PD image; Obtain the absolute value of the brightness difference between the first brightness value and the second brightness value, and obtain a difference image based on the absolute value of the brightness difference.

6. A device for detecting the shadow correction effect of a PD lens, characterized in that, The device includes: The acquisition unit is used to acquire a target image and PD information of masked pixels in the photosensitive chip; the target image is an image captured by a lens with fast focusing function; The parsing unit is used to parse the target image based on the PD information to obtain a first PD image and a second PD image; the method of obtaining the first PD image is the same as the method of obtaining the second PD image; The determining unit is configured to determine a difference image based on the first PD image and the second PD image; The detection unit is used to detect the lens shadow correction effect based on the difference image; The step of parsing the target image based on the PD information to obtain a first PD image includes: Determine the number of rows of left-hand PD points contained in each PDBlock storage block and the number of left-hand PD points contained in each row; the position and number of PD points contained in each PDBlock are the same; The coordinates of each left PD point in the first PDBlock are determined based on the PD information, the number of rows of left PD points contained in the first PDBlock storage block, and the number of left PD points contained in each row. The coordinates of the left PD points in the remaining PDBlocks are determined based on the coordinates of each left PD point in the first PDBlock. The PD point pixels at the corresponding positions are extracted based on the coordinates of each left PD point in all PDBlocks to form the first PD image; The step of detecting the lens shadow correction effect based on the difference image includes: Dilatation is performed on the difference image to obtain a dilated difference image; The dilated difference image is binarized to obtain a binarized difference image; The binarized difference image is subjected to erosion processing to obtain the eroded binarized difference image; The number of bright spots in the binarized difference image after erosion is obtained. If the number of bright spots is determined to be greater than a preset threshold, the lens shadow correction effect is determined to be unqualified.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1-5.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Lens shade correction index confirming method, lens shade emendation method and device

    CN101271196A

  • Content adaptive lens shading correction method and device

    CN114205487A