Image distortion detection method and device, electronic equipment and readable storage medium

By acquiring the baseline pixel grayscale value of the image for distortion enhancement and generating a distortion-enhanced image for detection, the problem of low accuracy in pupil movement distortion detection is solved, thereby improving the accuracy of lens quality detection and user experience.

CN116452537BActive Publication Date: 2026-04-07GOERTEK OPTICAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-11
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in detecting pupil movement distortion in images, which makes it impossible to accurately identify lens quality and affects user experience.

Method used

By obtaining the reference pixel grayscale value of the target pixel in the image to be detected, the image is distorted and enhanced to generate a distorted enhanced image. The distorted pixels in the distorted enhanced image are then used for detection, thereby improving the detection accuracy.

Benefits of technology

It enables accurate detection of minute pupil movement distortion, improves the accuracy of lens quality inspection, ensures the identification of superior and inferior lenses during the production process, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452537B_ABST
    Figure CN116452537B_ABST
Patent Text Reader

Abstract

This application discloses an image distortion detection method, apparatus, electronic device, and readable storage medium, applied in the field of computer vision technology. The image distortion detection method includes: acquiring at least one reference pixel grayscale value corresponding to a target pixel in an image to be detected; performing distortion enhancement on the image to be detected based on the grayscale values ​​of each reference pixel to obtain a distortion-enhanced image; and performing image distortion detection on the image to be detected based on the distorted pixels in the distortion-enhanced image to obtain an image distortion detection result. This application solves the technical problem of low detection accuracy for pupil movement distortion in images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision technology, and in particular to an image distortion detection method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] With the continuous development of computers, computer vision technology has been applied to all aspects of people's lives. At the same time, intelligent vision products such as virtual reality (VR) products and augmented reality (AR) products based on computer vision technology have also become very popular.

[0003] In smart vision products, lenses are typically used to refract ambient light. To extend the lifespan of these lenses, they are coated with a film during manufacturing. However, due to manufacturing processes, coated or laminated lenses inevitably have some unevenness, which can cause pupil swim distortion. When users wear smart vision products and make head movements, they may experience severe dizziness. Therefore, it is necessary to detect defective products during quality inspection.

[0004] Currently, since the above distortions are difficult to identify visually, images are usually captured by cameras equipped with lenses. The quality of the lens is then tested by detecting whether pupil movement distortion exists in the image. However, since pupil movement distortion is very small, the image detection results may not accurately reflect whether pupil movement distortion has occurred. Therefore, the current accuracy of pupil movement distortion detection in images is low. Summary of the Invention

[0005] The main objective of this application is to provide an image distortion detection method, apparatus, electronic device, and readable storage medium, aiming to solve the technical problem of low accuracy in detecting pupil movement distortion in images in the prior art.

[0006] To achieve the above objectives, this application provides an image distortion detection method, the image distortion detection method comprising:

[0007] Obtain at least one reference pixel grayscale value corresponding to the target pixel in the image to be detected;

[0008] Based on the grayscale values ​​of each reference pixel, the image to be detected is subjected to distortion enhancement to obtain a distortion-enhanced image;

[0009] Based on the distorted pixels of the distortion-enhanced image, image distortion detection is performed on the image to be detected to obtain the image distortion detection result.

[0010] To achieve the above objectives, this application also provides an image distortion detection device, the image distortion detection device comprising:

[0011] The acquisition module is used to acquire at least one reference pixel grayscale value corresponding to the target pixel in the image to be detected;

[0012] An enhancement module is used to perform distortion enhancement on the image to be detected based on the gray values ​​of each reference pixel to obtain a distortion-enhanced image;

[0013] The detection module is used to perform image distortion detection on the image to be detected based on the distorted pixels of the distortion-enhanced image, and obtain the image distortion detection result.

[0014] This application also provides an electronic device, the electronic device comprising: at least one processor and a memory communicatively connected to the at least one processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the image distortion detection method described above.

[0015] This application also provides a computer-readable storage medium storing a program for implementing an image distortion detection method, wherein when the program for the image distortion detection method is executed by a processor, it implements the steps of the image distortion detection method as described above.

[0016] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the image distortion detection method described above.

[0017] This application provides an image distortion detection method, apparatus, electronic device, and readable storage medium, namely, obtaining at least one reference pixel grayscale value corresponding to a target pixel in an image to be detected; performing distortion enhancement on the image to be detected based on the grayscale values ​​of each reference pixel to obtain a distortion-enhanced image; and performing image distortion detection on the image to be detected based on the distorted pixels in the distortion-enhanced image to obtain an image distortion detection result.

[0018] This application first obtains at least one reference pixel grayscale value of the target pixel in the image to be detected when performing image distortion detection on the image to be detected. Then, the image to be detected is distorted and enhanced by the reference pixel grayscale value to obtain a distortion-enhanced image. This achieves the purpose of image grayscale transformation on the image to be detected, thereby enhancing the actual pixel grayscale value corresponding to the target pixel in the image to be detected. That is, the contrast of the distortion-enhanced image after distortion enhancement is expanded, thereby improving the visual effect of the image to be detected. Finally, the image to be detected is detected based on the distorted pixels in the distortion-enhanced image, and the image distortion detection result is obtained.

[0019] Since adjusting the grayscale value of the reference pixel in the image to be detected processes the image at the pixel level, the distortion-enhanced image has a better visual display effect than the image to be detected. Thus, the distortion degree of the image can be accurately reflected by the distorted pixels in the distortion-enhanced image. Therefore, when dealing with very small pupil movement distortion, the purpose of accurately detecting image distortion can be achieved by identifying the distorted pixels in the distortion-enhanced image.

[0020] Based on this, this application obtains a distortion-enhanced image by performing pixel-level distortion enhancement on the image to be tested. Then, when performing image distortion detection on the image to be tested, it identifies distorted pixels in the distortion-enhanced image to accurately reflect the distortion status of the image to be tested. This achieves the goal of detecting whether pupil movement distortion occurs in the image to be tested. In other words, it overcomes the technical defect that the original detection image cannot identify very small pupil movement distortions, which easily leads to inaccurate feedback on whether pupil movement distortion has occurred. Therefore, it improves the accuracy of pupil movement distortion detection. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic flowchart of the image distortion detection method provided in Embodiment 1 of this application;

[0024] Figure 2 This is a comparative schematic diagram of pupil movement distortion in the character region of the image distortion detection method provided in Embodiment 1 of this application;

[0025] Figure 3 This is a schematic flowchart of the image distortion detection method provided in Embodiment 2 of this application;

[0026] Figure 4 This is a schematic diagram of the image distortion detection device provided in Embodiment 3 of this application;

[0027] Figure 5 This is a schematic diagram of the structure of the electronic device provided in Embodiment 4 of this application.

[0028] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0029] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] Example 1

[0031] First, it should be understood that in intelligent vision products, unevenness can easily occur due to the coating or lamination process during lens manufacturing, leading to pupil movement distortion. Therefore, accurately detecting pupil movement distortion has become a pressing issue. Currently, pupil movement distortion is typically objectively reflected in images; that is, the presence of pupil movement distortion is detected on the image. Accurate detection of pupil movement distortion can indirectly reflect whether the lens coating meets production requirements. Taking virtual reality products equipped with lenses as an example, since distortion is difficult to identify visually, it is crucial to carefully assess the lens coating. When producing high-quality products, images are typically captured through lenses, and distortion detection is performed on these images to indirectly reflect the quality of the lenses. However, because pupil movement distortion is extremely minor, even raw image detection cannot accurately identify it. This results in a lack of effective detection methods for lens coating or patching processes during manufacturing, making it impossible to accurately distinguish between good and bad lenses. When users experience dizziness while using virtual reality products with defective lenses, it significantly impacts their user experience. Therefore, there is an urgent need for a method to improve the accuracy of pupil movement distortion detection in images.

[0032] This application provides an image distortion detection method. In Embodiment 1 of the image distortion detection method of this application, referring to... Figure 2 The image distortion detection method includes:

[0033] Step S10: Obtain at least one reference pixel grayscale value corresponding to the target pixel in the image to be detected.

[0034] Step S20: Based on the grayscale values ​​of each reference pixel, perform distortion enhancement on the image to be detected to obtain a distortion-enhanced image;

[0035] Step S30: Based on the distorted pixels of the distortion-enhanced image, perform image distortion detection on the image to be detected to obtain the image distortion detection result.

[0036] In this embodiment, it should be noted that, although Figure 2 The logical order is shown, but in some cases, the steps shown or described may be performed in a different order than that shown here. The image distortion method is applied to an image distortion detection device, which has an image capturing function. Specifically, the image distortion detection device can be a computer or a product quality inspection instrument equipped with a computer. In one feasible embodiment, assuming the product quality inspection instrument is used to detect lens quality, a lens awaiting quality inspection is mounted on the product quality inspection instrument, and then an image to be inspected is captured through the lens. The image distortion detection method is then used to detect whether the image to be inspected produces pupil movement distortion in order to determine the lens quality. The lens quality can be divided into good products, defective products, and rework products.

[0037] Additionally, it should be noted that the target pixel is used to represent any pixel in the image to be detected. Specifically, it can be one or more, depending on the image distortion detection requirements and the image resolution. The image resolution is used to determine the total number of pixels in the image to be detected. For example, assuming the resolution of the image to be detected is 500*300, then the image to be detected has a total of 150,000 pixels.

[0038] Additionally, it should be noted that the inventive concept of this application is to enhance the image to be detected through distortion, thereby enabling the enhanced image to identify pupil movement distortion. The reference pixel grayscale value is used to characterize the distortion enhancement reference of the target pixel in the image to be detected. Specifically, it can be set by the user based on experience. For example, in one feasible method, all pixels in the image to be detected can be used as target pixels, and the reference pixel grayscale value of the target pixels can be set to m0. That is, when distorting the image to be detected, the actual pixel grayscale value of all pixels in the image to be detected is adjusted through m0. A certain pixel in the image to be detected can be used as the target pixel, and the image to be detected can be divided into four image regions: a, b, c, and d. For different image regions, four reference pixel grayscale values, m1, m2, m3, and m4, are set sequentially. Then, the actual pixel grayscale value of the target pixel is adjusted according to the reference pixel grayscale value of the region to which the target pixel belongs.

[0039] Additionally, it should be noted that the image to be detected represents the image awaiting image distortion detection. Specifically, it can be a binarized grayscale image after binarization processing, or it can be the original color image captured by the image distortion detection device configured to detect the image to be detected. The distortion enhancement image represents the distortion-enhanced image to be detected. The distortion enhancement image can identify pupil movement distortion. The presence of pupil movement distortion in the distortion enhancement image can be determined based on the distorted pixels in the distortion enhancement image. Distorted pixels represent pixels with pupil movement distortion, specifically pixels greater than 0 and smaller than the background image. The pixels are defined by their grayscale values. Pupil movement distortion can be determined based on whether the foreground distortion markers composed of distorted pixels move. The foreground distortion markers can be patterns or characters, and the foreground color can be set based on the user's actual detection needs. For example, in one feasible approach, assuming that there are characters in the color image captured by the lens waiting to be detected, the color image is converted to grayscale to obtain the image to be detected. The character area is set to black as the foreground color, and the non-character area is set to white as the background color. The distorted pixels are the pixels in each character area that are greater than 0 and less than 255.

[0040] Additionally, it should be noted that by comparing the grayscale value of the target pixel in the distortion-enhanced image with a preset grayscale threshold, the resolution of the target pixel can be accurately reflected. Figure 2 , Figure 2This diagram illustrates a comparison of pupil movement distortion in character regions. In the diagram, 11 represents the character region without pupil movement distortion, 12 is the character region boundary, and 13 represents the character region with pupil movement distortion. Clearly, the area directly below 13 appears blurry visually. This is because the pixel grayscale values ​​of the pixels constituting the area directly below 13 are below a preset grayscale threshold. However, since the grayscale value of a single pixel is insufficient to determine whether pupil movement distortion exists in the foreground color distortion indicator, a more accurate method is needed to identify whether pupil movement distortion exists in the distortion-enhanced image. Pupil movement distortion is typically not addressed by setting a grayscale threshold for every pixel in the distorted image. Instead, the number of distorted pixels in different regions of the distorted image is statistically analyzed. The average number of distorted pixels across these regions is then used to determine if pupil movement distortion is present. For example, if the distorted image is divided into ten regions (x0, x1, x2...x9), and the number of distorted pixels in each region is calculated as n0, n1, n2...n9, then the average number of distorted pixels in the distorted image is n = n0 + n1... +n9 / 10. Furthermore, to avoid misjudging pupil movement distortion due to uniform pixel distribution on the distortion-enhanced image, and to accelerate image distortion detection efficiency, a preset global distortion threshold can be set for judgment. This preset global distortion threshold represents a critical value representing the ratio of the average number of distorted pixels to the image area of ​​the distortion-enhanced image. If the actual ratio of the average number of distorted pixels to the image area of ​​the distortion-enhanced image exceeds the preset global distortion threshold, then pupil movement distortion is determined to exist in the distortion-enhanced image, i.e., the image to be detected... If the image exhibits pupil movement distortion, then the image is determined to be free of pupil movement distortion. Conversely, if the image does not exhibit pupil movement distortion, then the image enhancement image is determined to be free of pupil movement distortion. The image area of ​​the image enhancement image can be the product of the resolution, such as 300x500. This can also be understood as the total number of pixels. For example, in one feasible implementation, assuming the preset global distortion threshold is set to 0.18, the image area of ​​the image enhancement image is 200,000, and the average number of distorted pixels is 10,000. That is, the ratio of the average number of distorted pixels to the image area of ​​the image enhancement image exceeds the preset global distortion threshold, indicating that pupil movement distortion occurs in the image enhancement image.

[0041] As an example, steps S10 to S30 include: capturing an original color image through a lens awaiting image distortion detection; converting the original color image to grayscale to obtain an image to be detected; using any pixel in the image to be detected as a target pixel; using the target pixel as an index to retrieve a reference pixel grayscale value corresponding to all pixels in the image to be detected; adjusting the actual pixel grayscale values ​​of all pixels in the image to be detected based on the reference pixel grayscale value to obtain a distortion-enhanced image, wherein the specific adjustment method can be... The method for replacing pixel grayscale values ​​involves dividing the distortion-enhanced image into at least one distortion detection region, counting the number of distorted pixels in each distortion detection region that are greater than 0 and less than the grayscale value of the background color, averaging the number of pixels to obtain an average number of distorted pixels, and detecting whether the ratio between the average number of distorted pixels and the image area of ​​the distortion-enhanced image is greater than a preset global distortion threshold. If it is greater, it is determined that the image to be detected has pupil movement distortion; if it is less than or equal to, it is determined that the image to be detected does not have pupil movement distortion.

[0042] This application embodiment captures the original color image immediately after lens coating or plating is completed, and performs binarization grayscale processing on the original color image to obtain the image to be tested. Then, by detecting image distortion in the image to be tested, it can indirectly provide feedback on whether the lens meets the requirements for good product production after coating or plating. In the process of image distortion detection, since adjusting the grayscale value of the image to be tested by the reference pixel is a pixel-level image processing, the distortion-enhanced image has a better visual display effect than the image to be tested. Therefore, the degree of image distortion can be accurately reflected based on the distorted pixels present in the distortion-enhanced image. Therefore, when dealing with very minor pupil movement distortion, it is possible to accurately detect image distortion by identifying identifiable distorted pixels in the distortion-enhanced image. This allows for the determination that the lens does not meet production requirements if the image distortion detection result confirms the presence of pupil movement distortion, or that the lens meets production requirements if the image distortion detection result confirms the absence of pupil movement distortion. This provides an effective means of detecting lens coating or patching processes during the manufacturing process. Thus, by improving the accuracy of pupil movement distortion detection, the goal of effectively detecting lens coating or patching processes is achieved.

[0043] In order to accurately reflect the quality of the lens, five or more original color images are usually captured when taking the original color images to avoid the influence of differences between image frames, thereby improving the anti-interference ability of the detection results. At the same time, in order to avoid the influence of factors such as the shooting environment on the detection results, different original color images are taken at equal distances. In one feasible method, the camera carrying the lens waiting to be inspected can be moved from one side to another, and one image is taken every 2mm of movement, for a total of 10 images. The resolution of the images is W*H.

[0044] The step of obtaining at least one reference pixel grayscale value corresponding to the target pixel in the image to be detected includes:

[0045] Step A10: Obtain the image pixel reference table generated for the image to be detected;

[0046] Step A20: Based on the target pixel, query the corresponding reference pixel grayscale value in the image pixel reference table.

[0047] In this embodiment, it should be noted that the image pixel reference table is used to store the mapping relationship between all pixels of the image to be detected and the reference pixel gray values ​​of all pixels. Since different pixels of the image to be detected are all subjected to distortion enhancement with the same reference pixel gray value, the distortion enhancement image will not be able to reflect global or local pixel differences. Therefore, in order to improve the image distortion detection accuracy of the image to be detected, a corresponding reference pixel gray value is set for each pixel of the image to be detected, so that each pixel of the image to be detected can be distorted and enhanced in a targeted manner during subsequent distortion enhancement processing.

[0048] As an example, steps A10 to A20 include: obtaining an image pixel reference table generated for the image to be detected; and querying the corresponding reference pixel grayscale value in the image pixel reference table using the target pixel as an index. Since an image pixel reference table storing the mapping relationship between all pixels in the image to be detected and the reference pixel grayscale values ​​of all pixels is already set, the reference pixel grayscale value of the target pixel can be obtained by direct indexing, rather than setting the same reference pixel grayscale value for all different pixels in the image to be detected. Therefore, this lays the foundation for improving the accuracy of image distortion detection for the image to be detected.

[0049] The step of obtaining the image pixel reference table generated for the image to be detected includes:

[0050] Step B10: Extract a unit reference image from the image to be detected according to a preset ratio.

[0051] Step B20: Calculate the global threshold and local threshold of the reference pixel in the unit reference image;

[0052] Step B30: Determine the actual pixel grayscale value of the reference pixel based on the global threshold and the local threshold;

[0053] Step B40: Interpolate the unit reference image according to the preset ratio to obtain an image pixel reference table composed of reference pixel gray values ​​converted from the actual pixel gray values.

[0054] In this embodiment, it should be noted that since the image to be detected has a large number of pixels, if a reference pixel grayscale value is set for each pixel, it will result in a large amount of processing when constructing the image pixel reference table, and it will be easily affected by the brightness and contrast of the image.

[0055] Additionally, it should be noted that the unit reference image is used to represent a sub-image of the image to be detected under a preset ratio, the reference pixel is used to represent a specific pixel in the unit reference image, the global threshold is used to represent the same threshold selected for any pixel in the image to be detected, and the local threshold is used to represent the corresponding threshold set for the specific position of the reference pixel in the pixel matrix. The preset ratio can be set according to the detection accuracy. For example, in one feasible approach, assuming the image to be detected is 100*100 and the unit reference image is 10*10, the preset ratio is 10:1.

[0056] As an example, steps B10 to B40 include: cropping a unit reference image from the image to be detected according to a preset ratio; calculating a global threshold and a local threshold for a reference pixel in the unit reference image, wherein the calculation method adopts a conventional threshold calculation method, which may be a fixed threshold method or an adaptive threshold method, etc.; inputting the global threshold and the local threshold into a preset actual pixel grayscale value calculation model to obtain the actual pixel grayscale value of the reference pixel, wherein the preset actual pixel grayscale value calculation model is provided with an actual pixel grayscale value calculation formula, and the actual pixel grayscale value calculation formula is as follows:

[0057] table[i,j]=(1.0f-fBalance)*t1+fBalance*t_global

[0058] Where, table[i,j] represents the actual pixel grayscale value of the reference pixel in the unit reference image, f represents the number of images in the image to be detected, fBalance represents the weight value of the global threshold, specifically between 0 and 1, t1 represents the local threshold, and t_global represents the global threshold; the unit reference image is interpolated according to the preset ratio to obtain a unit reference image of the same size as the image to be detected, the actual pixel grayscale value of the reference pixel in the unit reference image of the same size as the image to be detected is obtained, the actual pixel grayscale value is used as the reference pixel grayscale value, and the image pixel reference table is generated according to the mapping relationship between the reference pixel grayscale value and the actual pixel value of the target pixel. The actual pixel grayscale of the reference pixel in the unit reference image is obtained by cropping the unit reference image according to a preset ratio. Then, the unit reference image is enlarged to the same size as the image to be detected according to the preset ratio to obtain the reference pixel grayscale value of the reference pixel. Finally, the image pixel reference table is generated by the mapping relationship between the reference pixel grayscale value and the actual pixel grayscale value. That is, the purpose of setting the reference pixel grayscale value for different image regions of the image to be detected is realized, thereby generating the image pixel reference table, rather than setting the pixel grayscale value for every pixel in the image to be detected. Therefore, the amount of processing required to build the image pixel reference table is reduced.

[0059] The step of calculating the total threshold and local threshold of the reference pixel in the unit reference image includes:

[0060] Step C10: Find the pixel grayscale value range of the image to be detected in the pixel histogram of the image to be detected, wherein the pixel grayscale value range includes the first pixel grayscale value and the second pixel grayscale value.

[0061] Step C20: Calculate the first probability of occurrence of at least one image pixel of the unit reference image between the first pixel gray value and the preset pixel gray value, and the second probability of occurrence between the preset pixel gray value and the second pixel gray value.

[0062] Step C30: Determine the pixel energy entropy of each image pixel based on the first occurrence probability and the second occurrence probability;

[0063] Step C40: By comparing the energy entropy of each pixel, the global threshold of the reference pixel is obtained, and by locating a local center region centered on the reference pixel in the unit reference image, the local threshold of the reference pixel is calculated.

[0064] In this embodiment, it should be noted that during image thresholding, the threshold divides the image pixels into foreground and background. When the pixels in each class tend to be evenly distributed within that class, the entropy of that part is at its maximum. When both foreground and background pixels tend to be evenly distributed, the entropy of the foreground and background is at its maximum. Due to the cumulative nature of system entropy, the entropy of the entire image is at its maximum at this point. That is, when the entropy is at its maximum, the foreground and background can be distinguished. The basic formula for information entropy is as follows:

[0065]

[0066] Additionally, it should be noted that since the image to be detected is easily affected by light during the shooting process, and at the same time, there are differences in distortion between the central region and the edge region of the image, if a conventional thresholding method is used, the foreground and background colors of the image can be effectively distinguished when the entropy is maximized. Therefore, in order to improve detection accuracy and efficiency, the maximum entropy algorithm is used to calculate the global threshold and local threshold of the reference pixel.

[0067] Additionally, it should be noted that image pixels are used to represent any pixel in a unit reference image, and pixel histograms are used to show the correlation between pixel grayscale values ​​and the number of pixels at a given pixel grayscale value. Pixel histograms can accurately and intuitively display the pixel situation of the image to be detected, and also reduce the computational load of threshold calculation. The horizontal axis of the pixel histogram represents the pixel grayscale value, which can be 1, 2, 3, or 255, etc. The vertical axis of the pixel histogram represents the number of pixels with a given pixel grayscale value, which can be a constant. Pixel grayscale value intervals are used to represent the interval in which a pixel grayscale value is located. The first pixel grayscale value represents the starting pixel grayscale value of the pixel grayscale value interval, and the second pixel grayscale value represents the ending pixel grayscale value of the pixel grayscale value interval. Preset pixel grayscale values ​​are located between the first and second pixel grayscale values.

[0068] As an example, steps C10 to C40 include: generating a pixel histogram of the image to be detected, with the pixel grayscale value of the image to be detected as the horizontal axis and the number of pixels in the image to be detected as the vertical axis; finding the pixel grayscale value range of the image to be detected from the minimum pixel grayscale value to the maximum pixel grayscale value in the pixel histogram; selecting a pixel in the unit reference image as an image pixel; calculating a first probability of occurrence of the image pixel between the minimum pixel grayscale value and a preset pixel grayscale value, and a second probability of occurrence between the preset pixel grayscale value and the maximum pixel grayscale value, wherein the preset pixel grayscale value is not less than the minimum pixel grayscale value and not greater than the maximum pixel grayscale value; determining the pixel energy entropy of the image pixel based on the first probability of occurrence and the second probability of occurrence; and converting the unit reference image... All pixels are sequentially used as image pixels, and the steps of calculating the first occurrence probability of the image pixel between the minimum pixel gray value and the preset pixel gray value, and the second occurrence probability between the preset pixel gray value and the maximum pixel gray value, and subsequent steps are performed until the pixel energy entropy of each pixel of the unit reference image is obtained. The energy entropy of each pixel is compared one by one, and the maximum pixel energy entropy is selected from the pixel energy entropy. The global threshold corresponding to the maximum pixel energy entropy is used as the global threshold of the reference pixel. In addition, a local central region centered on the reference pixel is extracted from the unit reference image, and the local threshold of the reference pixel is calculated by referring to the steps of obtaining the global threshold of the reference pixel. The reference pixel and the image pixel can be the same pixel or different pixels.

[0069] Specifically, when determining the local threshold of the reference pixel, the local center region is taken as the unit reference image, and the steps of calculating the occurrence probability, determining the pixel energy entropy, and determining the local threshold are performed. That is, the pixel gray value of the pixel with the largest pixel energy entropy in the local center region is finally selected as the local threshold.

[0070] The specific steps for calculating the first probability of an image pixel occurring between the minimum pixel grayscale value and the preset pixel grayscale value, and the second probability of an image pixel occurring between the preset pixel grayscale value and the maximum pixel grayscale value, can be as follows:

[0071]

[0072]

[0073] Wherein, P1 is the first occurrence probability of the image pixel between the minimum pixel gray value and the preset pixel gray value, P2 is the second occurrence probability of the image pixel between the minimum pixel gray value and the preset pixel gray value, t is the preset pixel gray value, gmin is the minimum pixel gray value, gmax is the maximum pixel gray value, hist[i] is the pixel gray value of the image pixel, and i is the image pixel.

[0074] Specifically, the step of determining the pixel energy entropy of the image pixel based on the first occurrence probability and the second occurrence probability can be as follows:

[0075]

[0076]

[0077] L=backroindEntropy+tageEntropy

[0078] Wherein, backroindEntropy is the foreground energy entropy of the image pixel, targetEntropy is the background energy entropy of the image pixel, and L is the pixel energy entropy of the image pixel.

[0079] In one feasible approach, assuming the size of the unit reference image is nBoxSize*nBoxSize, the width of the cropped local center region can be w = (W + nBoxSize) / nBoxSize, and the height of the local center region can be h = (H + nBoxSize) / nBoxSize, where W and H are the width and height of the unit reference image, respectively. To cover the image boundary, the width of the local center region can also be w = (W + nBoxSize - 1) / nBoxSize, and the height of the unit reference image can also be h = (H + nBoxSize - 1) / nBoxSize. When calculating the reference pixel grayscale value of a certain pixel point table[i, j] in the unit reference image table, the local center region rect[i*nBoxSize, j*nBoxSize, nBoxSize, nBoxSize] is first set, and the pixel point is accurately located based on the coordinate position, thereby expanding to obtain the local threshold. After obtaining the local threshold, the reference pixel grayscale value is obtained by referring to the above reference pixel grayscale value calculation formula.

[0080] The step of performing distortion enhancement on the image to be detected based on the gray values ​​of each reference pixel to obtain a distortion-enhanced image includes:

[0081] Step D10: Adjust the actual pixel grayscale value by comparing the actual pixel grayscale value of the target pixel with the reference pixel grayscale value of the target pixel;

[0082] Step D20: Check whether the grayscale values ​​of each reference pixel have been compared.

[0083] Step D30: If yes, then the adjusted image to be detected is used as the distortion enhancement image;

[0084] If not, in step D40, return to the step of adjusting the actual pixel gray value by comparing the actual pixel gray value of the target pixel with the reference pixel gray value of the target pixel, and then proceed with subsequent steps until the distortion-enhanced image is obtained.

[0085] In this embodiment, it should be noted that after obtaining a preset number of reference pixel grayscale values, the actual pixel grayscale values ​​of the pixels corresponding to each reference pixel grayscale value are replaced until all reference pixel values ​​are replaced, thereby obtaining a distortion-enhanced image.

[0086] As an example, steps D10 to D40 include: replacing the actual pixel grayscale value of the target pixel with the reference pixel grayscale value of the target pixel; detecting whether the grayscale values ​​of each reference pixel have been compared; if the grayscale values ​​of each reference pixel have been compared, then using the adjusted image to be detected as the distortion enhancement image; if the grayscale values ​​of each reference pixel have not been compared, then returning to the step of adjusting the actual pixel grayscale value by comparing the actual pixel grayscale value of the target pixel with the reference pixel grayscale value of the target pixel, and subsequent steps, until the distortion enhancement image is obtained.

[0087] The step of adjusting the actual pixel grayscale value by comparing the actual pixel grayscale value of the target pixel with the reference pixel grayscale value of the target pixel includes:

[0088] Step E10: Detect whether the actual pixel grayscale value is less than the reference pixel grayscale value;

[0089] Step E20: If the actual pixel grayscale value is less than the sum of the first preset pixel grayscale values ​​of the target pixels in the detected image set;

[0090] Step E30: If the actual pixel grayscale value is greater than or equal to the target pixel value of the detected image set, then adjust the actual pixel grayscale value to the sum of the second preset pixel grayscale values.

[0091] In this embodiment, it should be noted that when capturing multiple images to be detected, the time and environment of each image differ, leading to errors in using the reference pixel grayscale value of the current image to enhance distortion. Therefore, the reference pixel grayscale value can be used as the basis for adjustment during image distortion enhancement, and a specific method can be used to adjust the pixel grayscale value of the target pixel. Specifically, the first preset pixel grayscale value is used to represent the actual pixel grayscale adjustment value of the target pixel that is less than the reference pixel grayscale value, and can be 9 or 10, etc. The second preset pixel grayscale value is used to represent the actual pixel grayscale adjustment value of the target pixel that is not less than the reference pixel grayscale value, and can be 0 or 1, etc.

[0092] As an example, steps E10 to E30 include: detecting whether the actual pixel grayscale value is less than the reference pixel grayscale value; if the actual pixel grayscale value is detected to be less than the reference pixel grayscale value, adjusting the actual pixel grayscale value to the sum of a first preset pixel grayscale values ​​of the target pixels in the detected image set; if the actual pixel grayscale value is detected to be greater than or equal to the reference pixel grayscale value, adjusting the actual pixel grayscale value to the sum of a second preset pixel grayscale values ​​of the target pixels in the detected image set.

[0093] In one feasible approach, the method for adjusting the actual pixel grayscale value to address the different magnitude relationships between the actual pixel grayscale value and the reference pixel grayscale value can refer to the following formula:

[0094]

[0095] Where m is the number of images to be detected, gray is the first preset pixel gray value, 0 is the second preset pixel gray value, F(i,j) is the adjusted actual pixel gray value, Fm(i,j) is the actual pixel gray value, and T(i,j) is the reference pixel gray value.

[0096] This application provides an image distortion detection method, which involves obtaining at least one reference pixel grayscale value corresponding to a target pixel in an image to be detected; performing distortion enhancement on the image to be detected based on the grayscale values ​​of each reference pixel to obtain a distortion-enhanced image; and performing image distortion detection on the image to be detected based on the distorted pixels in the distortion-enhanced image to obtain an image distortion detection result.

[0097] In this embodiment, when performing image distortion detection on the image to be detected, at least one reference pixel grayscale value of the target pixel in the image to be detected is first obtained. Then, the image to be detected is distorted and enhanced by the reference pixel grayscale value to obtain a distortion-enhanced image. This achieves the purpose of image grayscale transformation on the image to be detected, thereby enhancing the actual pixel grayscale value corresponding to the target pixel in the image to be detected. That is, the contrast of the distortion-enhanced image after distortion enhancement is expanded, thereby improving the visual effect of the image to be detected. Finally, the image to be detected is detected based on the distorted pixels in the distortion-enhanced image, and the image distortion detection result is obtained.

[0098] Since adjusting the grayscale value of the reference pixel in the image to be detected processes the image at the pixel level, the distortion-enhanced image has a better visual display effect than the image to be detected. Thus, the distortion degree of the image can be accurately reflected by the distorted pixels in the distortion-enhanced image. Therefore, when dealing with very small pupil movement distortion, the purpose of accurately detecting image distortion can be achieved by identifying the distorted pixels in the distortion-enhanced image.

[0099] Based on this, this application obtains a distortion-enhanced image by performing pixel-level distortion enhancement on the image to be tested. Then, when performing image distortion detection on the image to be tested, it identifies distorted pixels in the distortion-enhanced image to accurately reflect the distortion status of the image to be tested. This achieves the goal of detecting whether pupil movement distortion occurs in the image to be tested. In other words, it overcomes the technical defect that the original detection image cannot identify very small pupil movement distortions, which easily leads to inaccurate feedback on whether pupil movement distortion has occurred. Therefore, it improves the accuracy of pupil movement distortion detection.

[0100] Example 2

[0101] Furthermore, referring to Figure 3 In another embodiment of this application, content that is the same as or similar to that in Embodiment 1 described above can be referred to the above description and will not be repeated hereafter. Based on this, the step of performing image distortion detection on the image to be detected according to the distorted pixels of the distortion-enhanced image to obtain the image distortion detection result includes:

[0102] Step F10: Divide the distortion-enhanced image into at least one distortion detection region, and obtain the number of distorted pixels in each distortion detection region, wherein the sum of the number of distorted pixels in each distortion detection region is the total number of distorted pixels.

[0103] Step F20: Select the image distortion extreme value of the distortion enhancement image based on the area occupancy of each distorted pixel in its respective distortion detection area;

[0104] Step F30: Detect whether the extreme value of the image distortion is greater than a preset local distortion threshold;

[0105] Step F40: If the result is greater than 0, then the image distortion detection result is determined to be that the image to be detected has distortion.

[0106] Step F50: If the result is less than or equal to the image distortion detection result, then the image to be detected is determined to be free of distortion.

[0107] In this embodiment, it should be noted that, due to the strong randomness of pupil movement distortion in the distortion-enhanced image and the fact that the distortion is not concentrated in the global image area, if the image is detected by averaging the preset global distortion threshold, the shaking of local image areas may be overlooked, thereby reducing the accuracy of image distortion detection for the image to be detected. For example, assuming that the distortion-enhanced image is divided into four image regions d1, d2, d3, and d4, and the ratio between the average number of distorted pixels and the area of ​​each region is 0.3, 0.1, 0.1, and 0.15, respectively, and the preset global distortion threshold is 0.18, since the average value (0.1625) is less than 0.18, the final image distortion detection result is that there is no pupil movement distortion in the image to be detected. However, the shaking of image region d1 may still cause dizziness for the user during use.

[0108] Additionally, it should be noted that the distortion detection area is automatically divided according to the detection requirements. The image distortion extreme value is used to characterize the maximum value of the ratio between the average number of distorted pixels and the area of ​​the region in different distortion detection areas. The preset local distortion threshold is used to characterize the critical value of pupil movement distortion in local areas.

[0109] As an example, steps F10 to F50 include: dividing the distortion-enhanced image into at least one distortion detection region, and counting the number of distorted pixels in each distortion detection region, wherein the sum of the number of distorted pixels in each distortion detection region is the total number of distorted pixels; determining the regional distortion value of each distortion detection region based on the area occupancy of each distorted pixel in its respective distortion detection region, and determining the maximum value of the ratio between the average number of distorted pixels and the area of ​​each distortion detection region by comparing each regional distortion value one by one, and taking the maximum value as the image distortion extreme value; detecting whether the image distortion extreme value is greater than a preset local distortion threshold; if the image distortion extreme value is detected to be greater than the preset local distortion threshold, then determining that the image distortion detection result is that the image to be detected has distortion; if the image distortion extreme value is detected to be less than or equal to the preset local distortion threshold, then determining that the image distortion detection result is that the image to be detected does not have distortion.

[0110] The regional distortion value is the ratio of the number of distorted pixels in the distortion detection region to the area of ​​the region. The step of determining the regional distortion value of each distortion detection region based on the area occupancy of each distorted pixel in its respective distortion detection region can be referred to the relevant steps in the above embodiment one, and will not be repeated here.

[0111] This application provides an image distortion detection method, which involves dividing the distortion-enhanced image into at least one distortion detection region and obtaining the number of distorted pixels in each distortion detection region, wherein the sum of the number of distorted pixels in each distortion detection region is the total number of distorted pixels; selecting the image distortion extreme value of the distortion-enhanced image based on the area occupancy of each distorted pixel in its respective distortion detection region; detecting whether the image distortion extreme value is greater than a preset local distortion threshold; if it is greater, determining that the image distortion detection result indicates that the image to be detected has distortion; if it is less than or equal to, determining that the image distortion detection result indicates that the image to be detected does not have distortion. This application embodiment divides the distortion-enhanced image into multiple distortion detection regions, and then determines the maximum value of the ratio of distorted pixels to the area of ​​their respective regions. By determining whether the maximum value is greater than a preset local distortion threshold, it accurately detects pupil movement distortion in different regions. Compared to detection methods that rely on the relationship between the ratio of the average distorted pixels to the image area and a preset global distortion threshold to detect pupil movement distortion, this application embodiment considers pupil movement distortion caused by local image region shaking in the image to be detected, thus improving the accuracy of pupil movement distortion detection.

[0112] Example 3

[0113] This application also provides an image distortion detection device, referring to... Figure 4 The image distortion detection device includes:

[0114] The acquisition module 101 is used to acquire at least one reference pixel gray value corresponding to the target pixel in the image to be detected;

[0115] Enhancement module 102 is used to perform distortion enhancement on the image to be detected based on the gray values ​​of each reference pixel to obtain a distortion-enhanced image;

[0116] The detection module 103 is used to perform image distortion detection on the image to be detected based on the distorted pixels of the distortion-enhanced image, and obtain the image distortion detection result.

[0117] Optionally, the acquisition module 101 is further configured to:

[0118] Obtain an image pixel reference table generated for the image to be detected;

[0119] Based on the target pixel, the corresponding reference pixel grayscale value is queried from the image pixel reference table.

[0120] Optionally, the acquisition module 101 is further configured to:

[0121] A unit reference image is extracted from the image to be detected according to a preset proportional relationship;

[0122] Calculate the global threshold and local threshold of the reference pixel point in the unit reference image;

[0123] The actual pixel grayscale value of the reference pixel is determined based on the global threshold and the local threshold.

[0124] The unit reference image is interpolated according to the preset ratio to obtain an image pixel reference table composed of reference pixel gray values ​​converted from the actual pixel gray values.

[0125] Optionally, the acquisition module 101 is further configured to:

[0126] The pixel grayscale value range of the image to be detected is found in the pixel histogram of the image to be detected, wherein the pixel grayscale value range includes the first pixel grayscale value and the second pixel grayscale value.

[0127] Calculate the first probability of occurrence of at least one image pixel of the unit reference image between the first pixel gray value and the preset pixel gray value, and the second probability of occurrence between the preset pixel gray value and the second pixel gray value;

[0128] The pixel energy entropy of each image pixel is determined based on the first occurrence probability and the second occurrence probability.

[0129] The global threshold of the reference pixel is obtained by comparing the energy entropy of each pixel, and the local threshold of the reference pixel is calculated by locating a local central region centered on the reference pixel in the unit reference image.

[0130] Optionally, the enhancement module 102 is further configured to:

[0131] The actual pixel grayscale value is adjusted by comparing the actual pixel grayscale value of the target pixel with the reference pixel grayscale value of the target pixel.

[0132] Check whether the grayscale values ​​of each reference pixel have been compared.

[0133] If so, the adjusted image to be detected will be used as the distortion enhancement image;

[0134] If not, return to the step of adjusting the actual pixel gray value by comparing the actual pixel gray value of the target pixel with the reference pixel gray value of the target pixel, and then proceed with subsequent steps until the distortion-enhanced image is obtained.

[0135] Optionally, the enhancement module 102 is further configured to:

[0136] Detect whether the actual pixel grayscale value is less than the reference pixel grayscale value;

[0137] If it is less than, then the actual pixel gray value is adjusted to the sum of the first preset pixel gray values ​​of the target pixels in the detected image set;

[0138] If the actual pixel grayscale value is greater than or equal to the target pixel value of the detected image set, then the actual pixel grayscale value is adjusted to the sum of the second preset pixel grayscale values.

[0139] Optionally, the detection module 103 is further configured to:

[0140] The distortion-enhanced image is divided into at least one distortion detection region, and the number of distorted pixels in each distortion detection region is obtained, wherein the sum of the number of distorted pixels in each distortion detection region is the total number of distorted pixels.

[0141] The extreme values ​​of image distortion in the distortion enhancement image are selected based on the area occupied by each distorted pixel in its respective distortion detection area.

[0142] Detect whether the extreme value of the image distortion is greater than a preset local distortion threshold;

[0143] If the result is greater than the value, then the image distortion detection result is determined to indicate that the image to be detected is distorted.

[0144] If the result is less than or equal to the image distortion detection result, then the image distortion detection result is determined to be that the image to be detected does not have distortion.

[0145] The image distortion detection device provided by this invention, employing the image distortion detection method described in the above embodiments, solves the technical problem of low detection accuracy for pupil movement distortion in images. Compared with the prior art, the beneficial effects of the image distortion detection device provided by this invention are the same as those of the image distortion detection method described in the above embodiments, and other technical features of this image distortion detection device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0146] Example 4

[0147] This invention provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the image distortion detection method in Embodiment 1 above.

[0148] The following is for reference. Figure 5 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0149] like Figure 5 As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processor, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus.

[0150] Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. The communication devices allow electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although electronic devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.

[0151] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1009, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of embodiments of this disclosure.

[0152] The electronic device provided by this invention employs the image distortion detection method described in the above embodiments, solving the technical problem of low accuracy in detecting pupil movement distortion in images. Compared with the prior art, the beneficial effects of the electronic device provided by this invention are the same as those of the image distortion detection method described in the above embodiments, and other technical features of this electronic device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0153] It should be understood that various parts of this disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

[0154] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

[0155] Example 5

[0156] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, which are used to execute the image distortion detection method in the above embodiment.

[0157] The computer-readable storage medium provided in this embodiment of the invention may be, for example, a USB flash drive, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0158] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.

[0159] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by an electronic device, cause the electronic device to: acquire at least one reference pixel grayscale value corresponding to a target pixel in an image to be detected; perform distortion enhancement on the image to be detected based on each of the reference pixel grayscale values ​​to obtain a distortion-enhanced image; and perform image distortion detection on the image to be detected based on the distorted pixels in the distortion-enhanced image to obtain an image distortion detection result.

[0160] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0161] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0162] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0163] The computer-readable storage medium provided by this invention stores computer-readable program instructions for executing the above-described image distortion detection method, thus solving the technical problem of low accuracy in detecting pupil movement distortion in images. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this invention are the same as those of the image distortion detection method provided in the above-described embodiments, and will not be repeated here.

[0164] Example 6

[0165] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the image distortion detection method described above.

[0166] The computer program product provided in this application solves the technical problem of low accuracy in detecting pupil movement distortion in images. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiments of this invention are the same as the beneficial effects of the image distortion detection method provided in the above embodiments, and will not be repeated here.

[0167] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.

Claims

1. An image distortion detection method, characterized in that, The image distortion detection method includes: Obtain at least one reference pixel grayscale value corresponding to the target pixel in the image to be detected; Based on the grayscale values ​​of each reference pixel, the image to be detected is subjected to distortion enhancement to obtain a distortion-enhanced image; Based on the distorted pixels of the distortion-enhanced image, image distortion detection is performed on the image to be detected to obtain the image distortion detection result; The step of performing image distortion detection on the image to be detected based on the distorted pixels of the distortion-enhanced image to obtain the image distortion detection result includes: The distortion-enhanced image is divided into at least one distortion detection region, and the number of distorted pixels in each distortion detection region is obtained, wherein the sum of the number of distorted pixels in each distortion detection region is the total number of distorted pixels. The extreme values ​​of image distortion in the distortion enhancement image are selected based on the area occupied by each distorted pixel in its respective distortion detection area. Detect whether the extreme value of the image distortion is greater than a preset local distortion threshold; If the result is greater than the value, then the image distortion detection result is determined to indicate that the image to be detected is distorted. If the result is less than or equal to the image distortion detection result, then the image distortion detection result is determined to be that the image to be detected does not have distortion.

2. The image distortion detection method as described in claim 1, characterized in that, The step of obtaining at least one reference pixel grayscale value corresponding to the target pixel in the image to be detected includes: Obtain an image pixel reference table generated for the image to be detected; Based on the target pixel, the corresponding reference pixel grayscale value is queried from the image pixel reference table.

3. The image distortion detection method as described in claim 2, characterized in that, The step of obtaining the image pixel reference table generated for the image to be detected includes: A unit reference image is extracted from the image to be detected according to a preset proportional relationship; Calculate the global threshold and local threshold of the reference pixel point in the unit reference image; The actual pixel grayscale value of the reference pixel is determined based on the global threshold and the local threshold. The unit reference image is interpolated according to the preset ratio to obtain an image pixel reference table composed of reference pixel gray values ​​converted from the actual pixel gray values.

4. The image distortion detection method as described in claim 3, characterized in that, The steps of calculating the total threshold and local threshold of the reference pixel in the unit reference image include: The pixel grayscale value range of the image to be detected is found in the pixel histogram of the image to be detected, wherein the pixel grayscale value range includes the first pixel grayscale value and the second pixel grayscale value. Calculate the first probability of occurrence of at least one image pixel of the unit reference image between the first pixel gray value and the preset pixel gray value, and the second probability of occurrence between the preset pixel gray value and the second pixel gray value; The pixel energy entropy of each image pixel is determined based on the first occurrence probability and the second occurrence probability. The global threshold of the reference pixel is obtained by comparing the energy entropy of each pixel, and the local threshold of the reference pixel is calculated by locating a local central region centered on the reference pixel in the unit reference image.

5. The image distortion detection method as described in claim 1, characterized in that, The step of performing distortion enhancement on the image to be detected based on the gray values ​​of each of the reference pixels to obtain a distortion-enhanced image includes: The actual pixel grayscale value is adjusted by comparing the actual pixel grayscale value of the target pixel with the reference pixel grayscale value of the target pixel. Check whether the grayscale values ​​of each reference pixel have been compared. If so, the adjusted image to be detected will be used as the distortion enhancement image; If not, return to the step of adjusting the actual pixel gray value by comparing the actual pixel gray value of the target pixel with the reference pixel gray value of the target pixel, and then proceed with subsequent steps until the distortion-enhanced image is obtained.

6. The image distortion detection method as described in claim 5, characterized in that, The step of adjusting the actual pixel grayscale value by comparing the actual pixel grayscale value of the target pixel with the reference pixel grayscale value of the target pixel includes: Detect whether the actual pixel grayscale value is less than the reference pixel grayscale value; If it is less than, the actual pixel gray value is adjusted to the sum of the first preset pixel gray values ​​of the target pixel in the detected image set, wherein the first preset pixel gray value is used to characterize the actual pixel gray value of the target pixel that is less than the reference pixel gray value. If the actual pixel grayscale value is greater than or equal to the target pixel value in the detected image set, the actual pixel grayscale value is adjusted to the sum of the second preset pixel grayscale values ​​of the target pixel value. The second preset pixel grayscale value is used to characterize the actual pixel grayscale adjustment value of the target pixel value that is not less than the reference pixel grayscale value.

7. An image distortion detection device, characterized in that, The image distortion detection device includes: The acquisition module is used to acquire the grayscale value of a reference pixel corresponding to at least one pixel in the image to be detected. An enhancement module is used to perform distortion enhancement on the image to be detected based on the gray values ​​of each reference pixel to obtain a distortion-enhanced image; The detection module is used to perform image distortion detection on the image to be detected based on the distorted pixels of the distortion-enhanced image, and obtain an image distortion detection result. The detection module is also used to divide the distortion-enhanced image into at least one distortion detection region, and to obtain the number of distorted pixels in each distortion detection region, wherein the sum of the number of distorted pixels in each distortion detection region is the total number of distorted pixels; to select the image distortion extreme value of the distortion-enhanced image based on the area occupancy of each distorted pixel in its respective distortion detection region; to detect whether the image distortion extreme value is greater than a preset local distortion threshold; if it is greater, then the image distortion detection result is determined to be that the image to be detected has distortion; if it is less than or equal to, then the image distortion detection result is determined to be that the image to be detected does not have distortion.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; A memory that is communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the steps of the image distortion detection method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program for implementing an image distortion detection method, which is executed by a processor to implement the steps of the image distortion detection method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for detecting pollution degree of lubricating oil

    CN115100212A