CN116452537A - Image distortion detection method, device, electronic equipment and readable storage medium - Google Patents

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

Info

Publication number
CN116452537A
CN116452537A CN202310405739.XA CN202310405739A CN116452537A CN 116452537 A CN116452537 A CN 116452537A CN 202310405739 A CN202310405739 A CN 202310405739A CN 116452537 A CN116452537 A CN 116452537A
Authority
CN
China
Prior art keywords
image
distortion
pixel
gray value
detected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310405739.XA
Other languages
Chinese (zh)
Inventor
王晓曼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Optical Technology Co Ltd
Original Assignee
Goertek Optical Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Optical Technology Co Ltd filed Critical Goertek Optical Technology Co Ltd
Priority to CN202310405739.XA priority Critical patent/CN116452537A/en
Publication of CN116452537A publication Critical patent/CN116452537A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/18Eye characteristics, e.g. of the iris

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Ophthalmology & Optometry (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses an image distortion detection method, an image distortion detection device, electronic equipment and a readable storage medium, which are applied to the technical field of computer vision, wherein the image distortion detection method comprises the following steps: acquiring at least one reference pixel gray value corresponding to a target pixel point of an image to be detected; carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image; and carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result. The method and the device solve the technical problem of low detection accuracy of pupil movement distortion of the image.

Description

Image distortion detection method, device, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of computer vision, and in particular, to an image distortion detection method, an image distortion detection device, an electronic device, and a readable storage medium.
Background
With the continuous development of computers, computer vision technology is applied to the aspects of life of people, and meanwhile, intelligent vision products such as Virtual Reality (VR) products and augmented Reality (Augmented Reality, AR) products based on the computer vision technology are also being touted.
In the intelligent vision product, the lens is usually used for refracting ambient light, and in order to prolong the service life of the lens, the lens is subjected to film pasting treatment during production and manufacture, but due to the reasons of a manufacturing process, the film pasting or film plating lens is inevitably uneven locally, so that pupil movement (pupil swim) distortion is generated, and when a user wears the intelligent vision product to perform head movement, serious dizziness is generated, so that defective products need to be detected during quality inspection.
At present, since it is difficult to visually recognize the distortion, an image is usually captured by a camera equipped with a lens, and then the quality of the lens is detected by detecting whether the image has pupil movement distortion, but since the pupil movement distortion is very small, the image detection result is liable to occur when the image cannot accurately feed back whether the image has pupil movement distortion, so that the current accuracy of detecting the pupil movement distortion of the image is low.
Disclosure of Invention
The main purpose of the application is to provide an image distortion detection method, an image distortion detection device, an electronic device and a readable storage medium, and aims to solve the technical problem that the detection accuracy of pupil movement distortion of an image is low in the prior art.
In order to achieve the above object, the present application provides an image distortion detection method, including:
acquiring at least one reference pixel gray value corresponding to a target pixel point of an image to be detected;
carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image;
and carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
To achieve the above object, the present application further provides an image distortion detection apparatus including:
the acquisition module is used for acquiring at least one reference pixel gray value corresponding to a target pixel point of the image to be detected;
the enhancement module is used for carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image;
and the detection module is used for carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
The application also provides an electronic device comprising: at least one processor and a memory communicatively coupled to the at least one processor, the memory storing instructions executable by the at least one processor to enable the at least one processor to perform the steps of the image distortion detection method as described above.
The present application also provides a computer-readable storage medium having stored thereon a program for implementing an image distortion detection method, which when executed by a processor implements the steps of the image distortion detection method as described above.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the image distortion detection method as described above.
The application provides an image distortion detection method, an image distortion detection device, electronic equipment and a readable storage medium, namely, at least one reference pixel gray value corresponding to a target pixel point of an image to be detected is obtained; carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image; and carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
When the image distortion detection is carried out on the image to be detected, at least one reference pixel gray value of a target pixel point in the image to be detected is firstly obtained, the image to be detected is further subjected to distortion enhancement through the reference pixel gray value, the purpose of carrying out image gray conversion on the image to be detected can be achieved, the actual pixel gray value corresponding to the target pixel point of the image to be detected is further enhanced, namely, the contrast of the distortion enhanced image after the distortion enhancement is expanded, so that the visual effect of the image to be detected is improved, the image to be detected is finally detected according to the distortion pixel point of the distortion enhanced image, and the image distortion detection result is obtained.
The image to be detected is processed from the pixel level through the reference pixel gray value adjustment, and the distortion enhanced image has better visual display effect compared with the image to be detected, so that the distortion degree of the image can be truly reflected according to the distortion pixel points existing in the distortion enhanced image, and the purpose of accurately detecting the image distortion through the distortion pixel points which can be identified in the distortion enhanced image can be realized when the very tiny pupil movement distortion is dealt with.
Based on the method, the distortion enhanced image is obtained by carrying out pixel-level distortion enhancement on the image to be detected, so that the distortion condition of the image to be detected can be accurately fed back by identifying distortion pixel points in the distortion enhanced image when the image to be detected is subjected to image distortion detection, thereby realizing the purpose of detecting whether pupil movement distortion occurs in the image to be detected, namely overcoming the technical defect that whether the condition of generating pupil movement distortion in the image cannot be accurately fed back due to the fact that very tiny pupil movement distortion cannot be identified in the original detected image, and further easily causing the image detection result.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flow chart of an image distortion detection method according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating comparison of pupil movement distortion of a character region in an image distortion detection method according to an embodiment of the present disclosure;
fig. 3 is a flow chart of an image distortion detection method according to a second embodiment of the present application;
fig. 4 is a schematic structural diagram of an image distortion detecting apparatus according to a third embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application.
The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
Detailed Description
In order to make the above objects, features and advantages of the present invention more comprehensible, the following description of the embodiments accompanied with the accompanying drawings will be given in detail. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
Firstly, it should be understood that in the intelligent visual product, a local uneven condition is easily generated due to a film pasting or film plating process during lens production and manufacturing, and then a phenomenon of pupil movement distortion is caused, so that how to accurately detect pupil movement distortion becomes a problem to be solved, at present, in general, the pupil movement distortion phenomenon is objectively fed back through an image, that is, whether pupil movement distortion is generated or not is detected on the image, and whether the lens film meets the production requirement can be indirectly reflected through accurate detection of the pupil movement distortion, for example, a virtual reality product provided with a lens is taken as an example, because distortion is difficult to identify by eyes, when a defective lens is identified, an image is usually shot through the lens, and then distortion detection is performed on the image, so that the advantages and disadvantages of the lens are indirectly reflected, however, because pupil movement distortion is very tiny, even if original image detection is performed, accurate identification of pupil movement distortion cannot be realized, so that an effective detection means for the lens film pasting or film plating process is lack in the production process, whether the lens can not be accurately identified, and a user has a very high sense of reality when using a virtual reality product provided with a defective lens is used, and the user experience is very high, and the method for detecting the pupil movement distortion is very needed at present.
An embodiment of the present application provides an image distortion detection method, in a first embodiment of the image distortion detection method of the present application, referring to fig. 2, the image distortion detection method includes:
step S10, at least one reference pixel gray value corresponding to a target pixel point of an image to be detected is obtained;
step S20, carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image;
and step S30, carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
In this embodiment, it should be noted that although fig. 2 shows a logic sequence, in some cases, the steps shown or described may be performed in a sequence different from that herein, and the image distortion method is applied to an image distortion detection apparatus having an image capturing function, and the image distortion detection apparatus may be specifically a computer or a product quality inspection apparatus provided with a computer, or the like, wherein in one embodiment, assuming that the product quality inspection apparatus is used to detect a quality of a lens, a lens waiting for quality detection is mounted on the product quality inspection apparatus, and then an image to be detected is captured by the lens, so that whether pupil movement distortion is generated in the image to be detected is detected by the image distortion detection method, to determine the quality of the lens, wherein the quality of the lens may be classified into a good product, a defective product, a reworked product, or the like.
Additionally, it should be noted that the target pixel point is used to represent any pixel point on the image to be detected, and may specifically be one or more, depending on the image distortion detection requirement and the resolution of the image, where the resolution of the image is used to determine the total number of pixel points on the image to be detected, for example, assuming that the resolution of the image to be detected is 500×300, the image to be detected has a total of 150000 pixel points.
Additionally, it should be noted that the inventive concept of the embodiment of the present application is to enhance the image to be detected through distortion, so that the image to be detected after the distortion enhancement can identify the distortion of the exit pupil Kong Youdong, the reference pixel gray value is used to represent the distortion enhancement reference of the target pixel point of the image to be detected, specifically may be set by the user according to experience, for example, in one implementation, all the pixel points of the image to be detected may be taken as the target pixel point, and the reference pixel gray value of the target pixel point is set to m 0 That is, when the image to be detected is distorted and enhanced, the image to be detected is enhanced by m 0 The actual pixel gray values of all pixel points of the image to be detected are adjusted, a certain pixel point on the image to be detected can be used as a target pixel point, the image to be detected is divided into four image areas a, b, c and d, and m is sequentially arranged for different image areas 1 、m 2 、m 3 And m 4 And adjusting the actual pixel gray value of the target pixel point according to the reference pixel gray value of the region to which the target pixel point belongs.
Additionally, it should be noted that, the image to be detected may be an image representing image distortion detection to be performed, specifically, may be a binary gray image after performing binarization processing, or may be an original color image captured by an image distortion detection device configured with image distortion detection to be performed, the distortion enhanced image is used to represent the image to be detected after distortion enhancement, where the pupil Kong Youdong distortion can be identified by the distortion enhanced image, whether the pupil movement distortion exists in the distortion enhanced image may be determined based on a distortion pixel point of the distortion enhanced image, the distortion pixel point is used to represent a pixel point having pupil movement distortion, specifically, may be a pixel point greater than 0 and less than a gray value of a background pixel, where the pupil movement distortion may be determined based on a foreground color distortion identifier formed by the distortion pixel points, and the foreground color identifier may be a pattern or a character, and the foreground color may be set based on an actual detection requirement of a user, for example, in one embodiment, if the character exists on the color image captured by a lens to be detected, the pupil movement distortion is determined based on a gray image, and the pupil movement distortion is obtained by performing the gray image to be a gray image, and the pupil movement distortion is determined as a white character area, and the character area is smaller than 255 characters in each pixel area.
Additionally, it should be noted that, by comparing the magnitude relation between the pixel gray value of the target pixel point of the distortion enhanced image and the preset gray value threshold, the resolution of the target pixel point can be accurately fed back, referring to fig. 2, fig. 2 is a contrast diagram showing the pupil wandering distortion of the character region, where 11 is a character region where the pupil wandering distortion does not occur, 12 is a character region boundary, and 13 is a character region where the pupil wandering distortion occurs, it is obvious that the region directly below 13 is blurred in visual effect, the root cause is that the pixel gray value of the pixel point constituting the region directly below 13 is smaller than the preset gray value threshold, but, since the pixel gray value of a certain pixel point is not enough to be the basis for determining whether the pupil wandering distortion occurs or not as a result of the foreground color distortion identification, in order to more accurately distinguish whether the pupil wandering distortion exists in the enhanced image, the corresponding gray value threshold distortion is set for each pixel point in the enhanced image, the corresponding gray value distortion is generally calculated for the pixel of different image regions of the enhanced image region in a region, and the average gray value distortion occurs for each region of the enhanced image is assumed to be the average point number of the enhanced image, and the average wandering distortion occurs, for example, the result is assumed that the point x is found 0 、x 1 、x 2 ...x 9 Ten large areas, and the number of distorted pixel points reaching the ten large areas is n 0 、n 1 、n 2 ...n 9 The number of average distorted pixel points of the distorted enhanced image is n=n 0 +n 1 …+n 9 In addition,/10, in order to avoid occurrence of erroneous judgment of pupil wander distortion caused by uniform distribution of pixel points on the distortion enhanced image and to accelerate image distortion detection efficiency, a preset global distortion threshold may be set to perform judgment, where the preset global distortion threshold is used to characterize a critical value of a ratio of an average distortion pixel point number of the distortion enhanced image to an image area of the distortion enhanced image, and if an actual ratio of the average distortion pixel point number of the distortion enhanced image to the image area of the distortion enhanced image exceeds the preset global distortion threshold, it is determined that the distortion enhanced image has pupil wander distortion, that is, if the image to be detected has pupil wander distortion, otherwise it is determined that the distortion enhanced image does not have pupil wander distortion, where an image area of the distortion enhanced image may be a product of resolution, for example, 300x500, where it may also be understood that a total number of pixels, for example, in one embodiment, it is assumed that the preset global distortion threshold is set to be 0.18, an image area of the distortion enhanced image is 200000, and an average distortion pixel point number is 10000, that is preset, that is the ratio of the average distortion pixel point number of the image area of the distortion enhanced image exceeds the preset global distortion threshold.
As an example, steps S10 to S30 include: taking an original color image through a lens waiting for image distortion detection, carrying out graying treatment on the original color image to obtain an image to be detected, taking any pixel point of the image to be detected as a target pixel point, taking the target pixel point as an index, and inquiring to obtain a reference pixel gray value corresponding to all pixel points of the image to be detected; according to the reference pixel gray values, adjusting actual pixel gray values of all pixel points of the image to be detected to obtain a distortion enhanced image, wherein a specific mode of adjustment can be a mode of pixel gray value replacement; dividing the distortion enhanced image into at least one distortion detection area, respectively counting the number of distortion pixel points which are larger than 0 and smaller than background color pixel gray values in each distortion detection area, carrying out averaging treatment on the pixel points to obtain average distortion pixel points, detecting whether the ratio between the average distortion pixel points and the image area of the distortion enhanced image is larger than a preset global distortion threshold value, if so, determining that pupil movement distortion exists in the image to be detected, and if so, determining that pupil movement distortion does not exist in the image to be detected.
According to the embodiment of the invention, the original color image is photographed immediately after the lens film pasting or film plating is finished, the original color image is subjected to binarization gray processing to obtain the image to be detected, and then whether the lens meets the production requirement of good products or not after film pasting or film plating is indirectly fed back through image distortion detection of the image to be detected, wherein in the process of image distortion detection of the image to be detected, the image to be detected is processed from a pixel level through reference pixel gray value adjustment, and then the distortion enhanced image has better visual display effect compared with the image to be detected, so that the distortion degree of the image can be truly reflected according to distortion pixel points existing in the distortion enhanced image, the purpose of accurately detecting the image distortion through distortion pixel points capable of being identified in the distortion enhanced image can be achieved when the pupil moving distortion is handled, and then the lens is judged to be in accordance with the production requirement of good products when the pupil distortion exists in the image to be detected is confirmed, or the lens is judged to be in accordance with the production requirement of moving production when the pupil distortion exists in the image distortion detection process is confirmed, and the process distortion of the pupil moving lens is effectively detected, and the technological distortion is effectively detected by the film plating means is improved.
In order to accurately reflect the quality problem of the lens, 5 or more original color images are usually shot when the original color images are shot, so as to avoid the influence of differences among image frames, thereby improving the anti-interference capability of the detection result, and meanwhile, in order to avoid the influence of factors such as shooting environment and the like on the detection result, different original color images are shot at equal distances, in an implementation manner, a camera loaded with the lens waiting for quality detection can be moved from one side to the other side, and every 2mm of movement is used for shooting a picture, 10 pictures are shot in total, wherein the resolution of the picture is W.H.
The step of obtaining at least one reference pixel gray value corresponding to the target pixel point of the image to be detected comprises the following steps:
step A10, obtaining an image pixel reference table generated for the image to be detected;
and step A20, inquiring the corresponding reference pixel gray value in the image pixel reference table according to the target pixel point.
In this embodiment, it should be noted that, the image pixel reference table is configured to store mapping relationships between all pixels of an image to be detected and reference pixel gray values of all pixels, and since different pixels of the image to be detected are distorted and enhanced by using the same reference pixel gray value, the distortion enhanced image cannot show global or local pixel differences, so that in order to improve the image distortion detection precision 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.
As an example, steps a10 to a20 include: acquiring an image pixel reference table generated for the image to be detected; and inquiring the corresponding reference pixel gray value in the image pixel reference table by taking the target pixel point as an index. Because the image pixel reference table for storing the mapping relation between all pixel points of the image to be detected and the reference pixel gray values of all pixel points is arranged, the reference pixel gray value of the target pixel point is obtained through direct indexing, and the same reference pixel gray value is not set for different pixel points of the image to be detected, so that a foundation is laid for improving the image distortion detection accuracy of the image to be detected.
Wherein the step of acquiring an image pixel reference table generated for the image to be detected includes:
step B10, intercepting a unit reference image from the image to be detected according to a preset proportional relation;
step B20, calculating a global threshold value and a local threshold value of a reference pixel point of the unit reference image;
step B30, determining the actual pixel gray value of the reference pixel point according to the global threshold value and the local threshold value;
and step B40, carrying out interpolation processing on the unit reference image according to the preset proportion relation to obtain an image pixel reference table formed by reference pixel gray values converted from the actual pixel gray values.
In this embodiment, it should be noted that, since the number of pixels of the image to be detected is large, if the reference pixel gray value is set for each pixel, a large processing amount is consumed when the image pixel reference table is constructed, and the image is easily affected by the brightness and contrast of the image.
Additionally, it should be noted that, the unit reference image is used to represent a sub-image of the image to be detected under the preset proportional relationship, the reference pixel point is used to represent a specific pixel point in the unit reference image, the global threshold is used to represent the same threshold selected for any pixel point of the image to be detected, the local threshold is used to represent a corresponding threshold set at a specific position of the pixel point matrix for the reference pixel point, where the preset proportional relationship may be set by itself according to the detection precision, for example, in an implementation manner, if the image to be detected is 100×100, and the unit reference image is 10×10, the preset proportional relationship is 10:1.
As an example, steps B10 to B40 include: intercepting a unit reference image from the image to be detected according to a preset proportion relation; calculating a global threshold and a local threshold of a reference pixel point of the unit reference image, wherein a conventional threshold calculation mode is adopted in a specific calculation mode, and the conventional threshold calculation mode can be a fixed threshold method, an adaptive threshold method and the like; the global threshold value and the local threshold value are input to a preset actual pixel gray value calculation model together to obtain an actual pixel gray value of the reference pixel point, wherein the preset actual pixel gray value calculation model is provided with an actual pixel gray value calculation formula, and the actual pixel gray value calculation formula is specifically as follows:
table[i,j]=(1.0f-fBalance)*t 1 +fBalance*t_global
Wherein, table [ i, j]For the actual pixel gray value of the reference pixel point of the unit reference image, f is the number of images of the image to be detected, fBalance is the weight value of the global threshold, and is specifically between 0 and 1, t 1 T_global is the global threshold; and carrying out interpolation processing on the unit reference image according to the preset proportion relation to obtain a unit reference image with the same size as the image to be detected, obtaining the actual pixel gray value of the reference pixel point of the unit reference image with the same size as the image to be detected, taking the actual pixel gray value as the reference pixel gray value, and generating the image pixel reference table according to the mapping relation between the reference pixel gray value and the actual pixel value of the target pixel point. The actual pixel gray of the reference pixel point of the unit reference image is obtained by taking the unit reference image intercepted by the preset proportion relation as a unit, and the unit reference image is amplified to the same size as the image to be detected through the preset proportion relation, so that the reference pixel gray value of the reference pixel point is obtained, and finally, an image pixel reference table is generated through the mapping relation between the reference pixel gray value and the actual pixel gray value, namely, the purpose of setting the reference pixel gray values for different image areas of the image to be detected and further generating the image pixel reference table is achieved, and the pixel gray value is not set for each pixel point of the image to be detected, so that the construction processing amount for constructing the image pixel reference table is reduced.
Wherein the step of calculating the full threshold value and the partial threshold value of the reference pixel point of the unit reference image includes:
step C10, searching a pixel gray value interval of the image to be detected in a pixel histogram of the image to be detected, wherein the pixel gray value interval comprises a first pixel gray value and a second pixel gray value;
step C20, respectively calculating a first occurrence probability of at least one image pixel point of the unit reference image between the first pixel gray value and a preset pixel gray value and a second occurrence probability between the preset pixel gray value and the second pixel gray value;
step C30, determining the pixel point energy entropy of each image pixel point according to the first occurrence probability and the second occurrence probability;
and C40, obtaining a global threshold value of the reference pixel point by comparing the energy entropy of each pixel point, and calculating the local threshold value of the reference pixel point by positioning a local central area taking the reference pixel point as the center in the unit reference image.
In this embodiment, it should be noted that, in the image thresholding process, the threshold divides the pixels of the image into a foreground and a background, when the pixels in each type of pixels tend to be uniformly distributed in this type of pixels, the entropy is the largest, and when the pixels in both the foreground and the background tend to be uniformly distributed, the entropy of the foreground and the entropy of the background are the largest, and the accumulation of the entropy of the system is the largest, and the entropy of the whole image is the largest, i.e. the foreground and the background can be distinguished when the entropy is the largest, where the basic formula of the information entropy is as follows:
In addition, it should be noted that, because the image to be detected is susceptible to light in the shooting process, meanwhile, distortion of the middle area and the edge area of the image is different, if a conventional threshold processing mode is adopted, the foreground color and the background color of the image can be effectively distinguished when the entropy is maximum, and further, in order to improve the detection precision and the detection efficiency, a maximum entropy algorithm is adopted to respectively calculate the global threshold and the local threshold of the reference pixel point.
In addition, it should be noted that, the image pixel point is used for representing any pixel point of the unit reference image, the pixel histogram is used for displaying the correlation between the pixel gray value and the number of the pixel points under the pixel gray value, the pixel condition of the image to be detected can be accurately and intuitively displayed through the pixel histogram, and the calculated amount of threshold value calculation is reduced, wherein the abscissa of the pixel histogram represents the pixel gray value, specifically, 1, 2, 3, 255 and the like, the ordinate of the pixel histogram represents the number of the pixel points under a certain pixel gray value, specifically, the number of the pixel points can be a constant, the pixel gray value interval is used for representing the interval where the pixel gray value is located, the first pixel gray value is used for representing the initial pixel gray value of the pixel gray value interval, the second pixel gray value is used for representing the end pixel gray value of the pixel gray value interval, and the preset pixel gray value is located between the first pixel gray value and the second pixel gray value.
As an example, steps C10 to C40 include: generating a pixel histogram of the image to be detected by taking the pixel gray value of the image to be detected as an abscissa and the number of pixel points of the image to be detected as an ordinate, and searching a pixel gray value interval from the minimum pixel gray value to the maximum pixel gray value of the image to be detected in the pixel histogram; selecting a certain pixel point from the unit reference image as an image pixel point, and respectively calculating a first occurrence probability of the image pixel point between the minimum pixel gray value and a preset pixel gray value and a second occurrence probability of the image pixel point between the preset pixel gray value and the maximum pixel gray value, wherein the preset pixel gray value is not smaller than the minimum pixel gray value and not larger than the maximum pixel gray value; determining pixel point energy entropy of the image pixel points according to the first occurrence probability and the second occurrence probability; and sequentially taking all pixel points of the unit reference image as the image pixel points, respectively calculating the first occurrence probability of the image pixel points 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 the subsequent steps until the pixel point energy entropy of each pixel point of the unit reference image is obtained, comparing the pixel point energy entropy, selecting the maximum pixel point energy entropy from the pixel point energy entropy, taking a global threshold corresponding to the maximum pixel point energy entropy as the global threshold of the reference pixel point, intercepting a local central area taking the reference pixel point as the center from the unit reference image, and calculating the local threshold of the reference pixel point by referring to the step of calculating the global threshold of the reference pixel point, wherein the reference pixel point and the image pixel point can be the same pixel point or different pixel points.
When the local threshold value of the reference pixel point is obtained, the local central area is taken as the unit reference image, and the steps of calculating the occurrence probability, determining the pixel point energy entropy and determining the local threshold value are executed, namely, finally, the pixel gray value of the pixel point with the maximum pixel point energy entropy of the local central area is selected as the local threshold value.
The specific steps of calculating the first occurrence probability of the image pixel point 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 respectively may be:
wherein P is 1 For the first occurrence probability of the image pixel point between the minimum pixel gray value and a preset pixel gray value, P 2 For the second occurrence probability of the image pixel point between the minimum pixel gray value and a preset pixel gray value, t is the value of the image pixel pointPresetting a pixel gray value, gmin is the minimum pixel gray value, gmax is the maximum pixel gray value, hist [ i ]]And i is the pixel gray value of the image pixel point.
The step of determining the pixel point energy entropy of the image pixel point according to the first occurrence probability and the second occurrence probability may specifically be:
L=backroindEntropy+tageEntropy
Wherein backrotation entropy 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.
In one embodiment, assuming that the size of the unit reference image is nBoxSize, and then the width of the truncated local center region may be w= (w+nboxsize)/nBoxSize, the height of the local center region may be h= (h+nboxsize)/nBoxSize, where W, H is the width and height of the unit reference image in order, in order to cover the boundary of the image, the width of the local center region may be w= (w+nboxsize-1)/nBoxSize, the height of the unit reference image may be h= (h+nboxsize-1)/nBoxSize, and when calculating the reference pixel gray value of a certain pixel point table [ i, j ] of the unit reference image table, the local center region rect [ i ] nBoxSize, j ] is first set, accurate positioning of the pixel point is achieved based on the coordinate position, so as to obtain the threshold value, and then the local gray value is calculated by referring to the formula of the reference pixel value.
The step of performing distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image comprises the following steps:
Step D10, the actual pixel gray value of the target pixel point is compared with the reference pixel gray value of the target pixel point, and the actual pixel gray value is adjusted;
step D20, detecting whether the gray values of the reference pixels are compared;
step D30, if yes, taking the adjusted image to be detected as the distortion enhanced image;
and D40, if not, returning to the step of adjusting the actual pixel gray value and the subsequent step by comparing the actual pixel gray value of the target pixel point with the reference pixel gray value of the target pixel point until the distortion enhanced image is obtained.
In this embodiment, after obtaining the preset number of reference pixel gray values, the actual pixel gray values of the pixel points corresponding to the reference pixel gray values are replaced until all the reference pixel values are replaced, so as to obtain the distortion enhanced image.
As an example, steps D10 to D40 include: replacing the actual pixel gray value of the target pixel point with the reference pixel gray value of the target pixel point; detecting whether the gray values of the reference pixels are compared; if the comparison of the gray values of the reference pixels is detected, taking the adjusted image to be detected as the distortion enhanced image; and if the fact that the reference pixel gray values are not completely compared is detected, returning to the step and the subsequent steps of adjusting the actual pixel gray values by comparing the actual pixel gray values of the target pixel points with the reference pixel gray values of the target pixel points until the distortion enhanced image is obtained.
The step of adjusting the actual pixel gray value by comparing the actual pixel gray value of the target pixel point with the reference pixel gray value of the target pixel point includes:
step E10, detecting whether the actual pixel gray value is smaller than the reference pixel gray value;
e20, if the actual pixel gray value is smaller than the first preset pixel gray value sum of the target pixel points of the detection image set;
and E30, if the actual pixel gray value is larger than or equal to the second preset pixel gray value of the target pixel point of the detection image set, adjusting the actual pixel gray value to be the sum of the second preset pixel gray values of the target pixel points of the detection image set.
In this embodiment, it should be noted that, when capturing multiple images to be detected, since there are differences between the time and the environment of capturing different images to be detected, and further, there is an error in distortion enhancement of the image to be detected by using the reference pixel gray value of the current image to be detected, and further, the reference pixel gray value may be used as a basis for adjustment when the image is distorted and enhanced, and further, the pixel gray value of the target pixel point may be adjusted in a specific manner, where the first preset pixel gray value is used to represent an actual pixel point gray adjustment value of which the actual pixel point gray value of the target pixel point is smaller than the reference pixel gray value, specifically may be 9 or 10, and the second preset pixel gray value is used to represent an actual pixel point gray adjustment value of which the actual pixel point gray value of the target pixel point is not smaller than the reference pixel gray value, specifically may be 0 or 1, and the like.
As an example, the steps of step E10 to step E30 include: detecting whether the actual pixel gray value is smaller than the reference pixel gray value, and if the actual pixel gray value is smaller than the reference pixel gray value, adjusting the actual pixel gray value to be the sum of first preset pixel gray values of target pixel points of a detection image set; and if the actual pixel gray value is detected to be greater than or equal to the reference pixel gray value, adjusting the actual pixel gray value to be the sum of second preset pixel gray values of the target pixel points of the detection image set.
In one embodiment, the manner of adjusting the actual pixel gray level to the different magnitude relations between the actual pixel gray level and the reference pixel gray level can be referred to by the following formula:
wherein 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.
The embodiment of the application provides an image distortion detection method, namely, at least one reference pixel gray value corresponding to a target pixel point of an image to be detected is obtained; carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image; and carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
When the image distortion detection is carried out on the image to be detected, at least one reference pixel gray value of a target pixel point in the image to be detected is firstly obtained, the image to be detected is further distorted and enhanced through the reference pixel gray value, the distortion enhanced image is obtained, the purpose of carrying out image gray conversion on the image to be detected can be achieved, the actual pixel gray value corresponding to the target pixel point of the image to be detected is further enhanced, namely, the contrast of the distortion enhanced image after the distortion enhancement is expanded, so that the visual effect of the image to be detected is improved, and finally the image to be detected is detected according to the distortion pixel point of the distortion enhanced image, and the image distortion detection result is obtained.
The image to be detected is processed from the pixel level through the reference pixel gray value adjustment, and the distortion enhanced image has better visual display effect compared with the image to be detected, so that the distortion degree of the image can be truly reflected according to the distortion pixel points existing in the distortion enhanced image, and the purpose of accurately detecting the image distortion through the distortion pixel points which can be identified in the distortion enhanced image can be realized when the very tiny pupil movement distortion is dealt with.
Based on the method, the distortion enhanced image is obtained by carrying out pixel-level distortion enhancement on the image to be detected, so that the distortion condition of the image to be detected can be accurately fed back by identifying distortion pixel points in the distortion enhanced image when the image to be detected is subjected to image distortion detection, thereby realizing the purpose of detecting whether pupil movement distortion occurs in the image to be detected, namely overcoming the technical defect that whether the condition of generating pupil movement distortion in the image cannot be accurately fed back due to the fact that very tiny pupil movement distortion cannot be identified in the original detected image, and further easily causing the image detection result.
Example two
Further, referring to fig. 3, in another embodiment of the present application, the same or similar content as that of the first embodiment may be referred to the description above, and will not be repeated. On the basis, the step of detecting the image distortion of the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result comprises the following steps:
step F10, dividing the distortion-enhanced image into at least one distortion detection region, and obtaining the number of distortion pixel points of each distortion detection region, wherein the sum of the number of distortion pixel points of each distortion detection region is the total number of pixel points of the distortion pixel points;
Step F20, selecting an image distortion extremum of the distortion enhanced image according to the area occupation condition of the distortion detection area where each distorted pixel point is located;
step F30, detecting whether the image distortion extremum is larger than a preset local distortion threshold;
step F40, if the image distortion detection result is larger than the preset threshold, determining that the image to be detected is distorted;
and F50, if the image distortion detection result is smaller than or equal to the image distortion detection result, determining that the image to be detected has no distortion.
In this embodiment, it should be noted that, because the randomness of pupil movement distortion in the distortion enhanced image is strong, and the distortion is not concentrated in the image global area, if the image is detected to be distorted by adopting the preset global distortion threshold to average, the shaking condition of the local image area is easy to be ignored, so that the accuracy of detecting the image distortion of the image to be detected is reduced, for example, the distortion enhanced image is divided into four image areas d1, d2, d3 and d4, the ratio between the average distortion pixel number of each area and the area of the area is respectively 0.3, 0.1 and 0.15, the preset global distortion threshold is 0.18, and the average value (0.1625) is smaller than 0.18, the final image distortion detection result is that the pupil movement distortion does not exist in the image to be detected, but the shaking of the image area d1 still causes the dizziness feel in the use process of the user.
In addition, it should be noted that the distortion detection areas are automatically divided according to the detection requirements, the image distortion extremum is used for representing the maximum value of the ratio between the average distortion pixel number of different distortion detection areas and the area of the areas, and the local distortion threshold is preset for representing the critical value of pupil movement distortion existing in the local area.
As an example, steps F10 to F50 include: dividing the distortion enhanced image into at least one distortion detection area and counting the number of distortion pixel points of the distortion detection areas, wherein the sum of the number of distortion pixel points of each distortion detection area is the total number of pixel points of the distortion pixel points; determining the area distortion value of each distortion detection area according to the area occupation condition of each distortion pixel point in the distortion detection area, determining the maximum value of the ratio between the average distortion pixel point in each distortion detection area and the area of the area by comparing the area distortion values, and taking the maximum value as the image distortion extremum; detecting whether the image distortion extremum is larger than a preset local distortion threshold; if the image distortion extremum is detected to be larger than the preset local distortion threshold, determining that the image distortion detection result is that the image to be detected is distorted; and if the image distortion extremum is detected to be smaller than or equal to the preset local distortion threshold value, determining that the image distortion detection result is that the image to be detected is not distorted.
The step of determining the area distortion value of each distortion detection area according to the area occupation condition of the distortion detection area where each distortion pixel point is located may refer to the related step of the first embodiment, and will not be described herein.
The embodiment of the application provides an image distortion detection method, namely dividing the distortion enhanced image into at least one distortion detection area, and obtaining the number of distortion pixel points of each distortion detection area, wherein the sum of the number of distortion pixel points of each distortion detection area is the total number of pixel points of the distortion pixel points; selecting an image distortion extremum of the distortion enhanced image according to the area occupation condition of the distortion detection area where each distortion pixel point is located; detecting whether the image distortion extremum is larger than a preset local distortion threshold; if the image distortion detection result is larger than the preset value, determining that the image distortion detection result is that the image to be detected is distorted; and if the image distortion detection result is smaller than or equal to the image distortion detection result, determining that the image to be detected has no distortion. According to the embodiment of the application, the distortion enhanced image is divided into the plurality of distortion detection areas, the maximum value of the ratio of the distortion pixel points to the area of the area in different distortion detection areas is determined, and the pupil movement distortion condition of different areas is accurately detected by judging whether the maximum value is larger than the preset local distortion threshold value or not.
Example III
The embodiment of the application also provides an image distortion detection device, referring to fig. 4, the image distortion detection device includes:
an obtaining module 101, configured to obtain at least one reference pixel gray value corresponding to a target pixel point of an image to be detected;
the enhancement module 102 is configured to perform distortion enhancement on the image to be detected according to the gray value of each reference pixel, so as to obtain a distortion enhanced image;
and the detection module 103 is used for carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
Optionally, the obtaining module 101 is further configured to:
acquiring an image pixel reference table generated for the image to be detected;
and inquiring the corresponding reference pixel gray value in the image pixel reference table according to the target pixel point.
Optionally, the obtaining module 101 is further configured to:
intercepting a unit reference image from the image to be detected according to a preset proportional relation;
calculating a global threshold value and a local threshold value of a reference pixel point of the unit reference image;
determining an actual pixel gray value of the reference pixel point according to the global threshold value and the local threshold value;
And carrying out interpolation processing on the unit reference image according to the preset proportion relation to obtain an image pixel reference table formed by reference pixel gray values converted from the actual pixel gray values.
Optionally, the obtaining module 101 is further configured to:
searching a pixel gray value interval of the image to be detected in a pixel histogram of the image to be detected, wherein the pixel gray value interval comprises a first pixel gray value and a second pixel gray value;
respectively calculating a first occurrence probability of at least one image pixel point of the unit reference image between the first pixel gray value and a preset pixel gray value and a second occurrence probability between the preset pixel gray value and the second pixel gray value;
determining the pixel point energy entropy of each image pixel point according to the first occurrence probability and the second occurrence probability;
and obtaining a global threshold value of the reference pixel point by comparing the energy entropy of each pixel point, and calculating the local threshold value of the reference pixel point by locating a local central area taking the reference pixel point as the center in the unit reference image.
Optionally, the enhancement module 102 is further configured to:
the actual pixel gray value of the target pixel point is compared with the reference pixel gray value of the target pixel point, and the actual pixel gray value is adjusted;
detecting whether the gray values of the reference pixels are compared;
if yes, taking the adjusted image to be detected as the distortion enhanced image;
and if not, returning to execute the step and the subsequent steps of adjusting the actual pixel gray value by comparing the actual pixel gray value of the target pixel point with the reference pixel gray value of the target pixel point until the distortion enhanced image is obtained.
Optionally, the enhancement module 102 is further configured to:
detecting whether the actual pixel gray value is smaller than the reference pixel gray value;
if the pixel gray value is smaller than the first preset pixel gray value, the actual pixel gray value is adjusted to be the sum of the first preset pixel gray values of the target pixel points of the detection image set;
and if the actual pixel gray value is greater than or equal to the second preset pixel gray value of the target pixel point of the detection image set, the actual pixel gray value is adjusted to be the sum of the second preset pixel gray values of the target pixel point of the detection image set.
Optionally, the detection module 103 is further configured to:
dividing the distortion-enhanced image into at least one distortion detection region, and obtaining the number of distortion pixel points of each distortion detection region, wherein the sum of the number of distortion pixel points of each distortion detection region is the total number of pixel points of the distortion pixel points;
Selecting an image distortion extremum of the distortion enhanced image according to the area occupation condition of the distortion detection area where each distortion pixel point is located;
detecting whether the image distortion extremum is larger than a preset local distortion threshold;
if the image distortion detection result is larger than the preset value, determining that the image distortion detection result is that the image to be detected is distorted;
and if the image distortion detection result is smaller than or equal to the image distortion detection result, determining that the image to be detected has no distortion.
The image distortion detection device provided by the invention adopts the image distortion detection method in the embodiment, and solves the technical problem of low detection accuracy of pupil movement distortion of an image. Compared with the prior art, the image distortion detection device provided by the embodiment of the invention has the same beneficial effects as the image distortion detection method provided by the embodiment, and other technical features in the image distortion detection device are the same as the features disclosed by the method of the embodiment, and are not repeated herein.
Example IV
The embodiment of the invention provides electronic equipment, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the image distortion detection method in the first embodiment.
Referring now to fig. 5, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device may include a processing apparatus 1001 (e.g., a central processing unit, a graphics processor, etc.), which may 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 apparatus 1003 into a Random Access Memory (RAM) 1004. In the RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, the ROM1002, and the RAM1004 are connected to each other by a bus 1005. An input/output (I/O) interface 1006 is also connected to the bus.
In general, the following systems may be connected to the I/O interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, and the like; an output device 1008 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage device 1003 including, for example, a magnetic tape, a hard disk, and the like; and communication means 1009. The communication means may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While electronic devices having various systems are shown in the figures, it should be understood that not all of the illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 1009, or installed from the storage device 1003, or installed from the ROM 1002. The above-described functions defined in the method of the embodiment of the present disclosure are performed when the computer program is executed by the processing device 1001.
The electronic equipment provided by the invention solves the technical problem of low detection accuracy of pupil movement distortion of an image by adopting the image distortion detection method in the embodiment. Compared with the prior art, the electronic device provided by the embodiment of the invention has the same beneficial effects as the image distortion detection method provided by the embodiment, and other technical features in the electronic device are the same as the features disclosed by the method of the embodiment, and are not repeated here.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Example five
The present embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon for performing the image distortion detection method in the above-described embodiment.
The computer readable storage medium according to the embodiments of the present invention may be, for example, a usb disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The above-described computer-readable storage medium may be contained in an electronic device; or may exist alone without being assembled into an electronic device.
The computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to: acquiring at least one reference pixel gray value corresponding to a target pixel point of an image to be detected; carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image; and carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures 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 the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The computer readable storage medium provided by the invention stores the computer readable program instructions for executing the image distortion detection method, and solves the technical problem of low detection accuracy of pupil movement distortion of an image. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the embodiment of the invention are the same as those of the image distortion detection method provided by the above embodiment, and are not described in detail herein.
Example six
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the image distortion detection method as described above.
The computer program product provided by the application solves the technical problem of low detection accuracy of pupil movement distortion of an image. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as those of the image distortion detection method provided by the above embodiment, and are not described herein.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims.

Claims (10)

1. An image distortion detection method, characterized in that the image distortion detection method comprises:
acquiring at least one reference pixel gray value corresponding to a target pixel point of an image to be detected;
carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image;
and carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
2. The image distortion detection method as set forth in claim 1, wherein the step of acquiring at least one reference pixel gray value corresponding to a target pixel of the image to be detected comprises:
acquiring an image pixel reference table generated for the image to be detected;
and inquiring the corresponding reference pixel gray value in the image pixel reference table according to the target pixel point.
3. The image distortion detection method according to claim 2, wherein the step of acquiring an image pixel reference table generated for the image to be detected includes:
intercepting a unit reference image from the image to be detected according to a preset proportional relation;
calculating a global threshold value and a local threshold value of a reference pixel point of the unit reference image;
Determining an actual pixel gray value of the reference pixel point according to the global threshold value and the local threshold value;
and carrying out interpolation processing on the unit reference image according to the preset proportion relation to obtain an image pixel reference table formed by reference pixel gray values converted from the actual pixel gray values.
4. The image distortion detection method of claim 3, wherein the step of calculating the full threshold and the partial threshold of the reference pixel point at the unit reference image comprises:
searching a pixel gray value interval of the image to be detected in a pixel histogram of the image to be detected, wherein the pixel gray value interval comprises a first pixel gray value and a second pixel gray value;
respectively calculating a first occurrence probability of at least one image pixel point of the unit reference image between the first pixel gray value and a preset pixel gray value and a second occurrence probability between the preset pixel gray value and the second pixel gray value;
determining the pixel point energy entropy of each image pixel point according to the first occurrence probability and the second occurrence probability;
and obtaining a global threshold value of the reference pixel point by comparing the energy entropy of each pixel point, and calculating the local threshold value of the reference pixel point by locating a local central area taking the reference pixel point as the center in the unit reference image.
5. The image distortion detection method as set forth in claim 1, wherein said step of performing distortion enhancement on said image to be detected based on each of said reference pixel gray values, to obtain a distortion enhanced image, comprises:
the actual pixel gray value of the target pixel point is compared with the reference pixel gray value of the target pixel point, and the actual pixel gray value is adjusted;
detecting whether the gray values of the reference pixels are compared;
if yes, taking the adjusted image to be detected as the distortion enhanced image;
and if not, returning to execute the step and the subsequent steps of adjusting the actual pixel gray value by comparing the actual pixel gray value of the target pixel point with the reference pixel gray value of the target pixel point until the distortion enhanced image is obtained.
6. The image distortion detection method of claim 5, wherein the step of adjusting the actual pixel gray value by comparing the actual pixel gray value of the target pixel point with the reference pixel gray value of the target pixel point comprises:
detecting whether the actual pixel gray value is smaller than the reference pixel gray value;
If the pixel gray value is smaller than the first preset pixel gray value, the actual pixel gray value is adjusted to be the sum of the first preset pixel gray values of the target pixel points of the detection image set;
and if the actual pixel gray value is greater than or equal to the second preset pixel gray value of the target pixel point of the detection image set, the actual pixel gray value is adjusted to be the sum of the second preset pixel gray values of the target pixel point of the detection image set.
7. The image distortion detection method as set forth in claim 1, wherein the step of performing image distortion detection on the image to be detected based on the distorted pixel points of the distortion-enhanced image to obtain an image distortion detection result includes:
dividing the distortion-enhanced image into at least one distortion detection region, and obtaining the number of distortion pixel points of each distortion detection region, wherein the sum of the number of distortion pixel points of each distortion detection region is the total number of pixel points of the distortion pixel points;
selecting an image distortion extremum of the distortion enhanced image according to the area occupation condition of the distortion detection area where each distortion pixel point is located;
detecting whether the image distortion extremum is larger than a preset local distortion threshold;
if the image distortion detection result is larger than the preset value, determining that the image distortion detection result is that the image to be detected is distorted;
And if the image distortion detection result is smaller than or equal to the image distortion detection result, determining that the image to be detected has no distortion.
8. An image distortion detection apparatus, characterized by comprising:
the acquisition module is used for acquiring a reference pixel gray value corresponding to at least one pixel point of the image to be detected;
the enhancement module is used for carrying out distortion enhancement on the image to be detected according to the gray value of each reference pixel to obtain a distortion enhanced image;
and the detection module is used for carrying out image distortion detection on the image to be detected according to the distortion pixel points of the distortion enhanced image to obtain an image distortion detection result.
9. An electronic device, the electronic device comprising:
at least one processor;
a memory communicatively coupled to the at least one processor;
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the image distortion detection method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a program that implements an image distortion detection method, the program implementing the image distortion detection method being executed by a processor to implement the steps of the image distortion detection method according to any one of claims 1 to 7.
CN202310405739.XA 2023-04-11 2023-04-11 Image distortion detection method, device, electronic equipment and readable storage medium Pending CN116452537A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310405739.XA CN116452537A (en) 2023-04-11 2023-04-11 Image distortion detection method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310405739.XA CN116452537A (en) 2023-04-11 2023-04-11 Image distortion detection method, device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116452537A true CN116452537A (en) 2023-07-18

Family

ID=87126814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310405739.XA Pending CN116452537A (en) 2023-04-11 2023-04-11 Image distortion detection method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116452537A (en)

Similar Documents

Publication Publication Date Title
CN108550101B (en) Image processing method, device and storage medium
CN110544258B (en) Image segmentation method and device, electronic equipment and storage medium
CN111242881B (en) Method, device, storage medium and electronic equipment for displaying special effects
CN111598091A (en) Image recognition method and device, electronic equipment and computer readable storage medium
US20180324415A1 (en) Real-time automatic vehicle camera calibration
CN110766679A (en) Lens contamination detection method and device and terminal equipment
CN110070551B (en) Video image rendering method and device and electronic equipment
CN110796664B (en) Image processing method, device, electronic equipment and computer readable storage medium
CN112017222A (en) Video panorama stitching and three-dimensional fusion method and device
CN110062157B (en) Method and device for rendering image, electronic equipment and computer readable storage medium
CN110781823B (en) Screen recording detection method and device, readable medium and electronic equipment
CN107103865B (en) Method and device for detecting display area in display screen
CN111553302B (en) Key frame selection method, device, equipment and computer readable storage medium
CN110689014B (en) Method and device for detecting region of interest, electronic equipment and readable storage medium
CN108932703B (en) Picture processing method, picture processing device and terminal equipment
CN109886864B (en) Privacy mask processing method and device
CN110047126B (en) Method, apparatus, electronic device, and computer-readable storage medium for rendering image
CN110310341B (en) Method, device, equipment and storage medium for generating default parameters in color algorithm
CN109451318B (en) Method, apparatus, electronic device and storage medium for facilitating VR video encoding
US20200167933A1 (en) Image processing apparatus, image processing method, and a non-transitory computer readable storage medium
CN108776959B (en) Image processing method and device and terminal equipment
CN116452537A (en) Image distortion detection method, device, electronic equipment and readable storage medium
CN108540726B (en) Method and device for processing continuous shooting image, storage medium and terminal
CN111784607A (en) Image tone mapping method, device, terminal equipment and storage medium
CN112465692A (en) Image processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination