Image restoration degree detection method and related equipment
By obtaining the pixel and grayscale information of the image and quantifying the image restoration degree, the problems of low accuracy and efficiency caused by manual comparison are solved, and efficient and accurate image restoration degree detection is achieved.
Patent Information
- Application Number
- CN202310295255.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-03-23
AI Technical Summary
Existing image restoration detection methods rely on manual comparison, resulting in poor accuracy and objectivity, long detection time, lack of quantitative standards, and inability to conduct horizontal comparisons, resulting in poor practicality of restoration data.
By obtaining the pixel distribution information of the standard image and the image to be detected, the positioning pixel area and the random pixel area are determined. The gray value distribution and Hamming distance information are combined to quantify the image restoration degree. Image resizing and binarization processing are used to improve the accuracy and efficiency of detection.
It realizes the quantitative evaluation of image restoration, improves the accuracy and objectivity of detection data, saves detection time, and enhances the practicality and convenience of detection.
Smart Images

Figure CN116309489B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image detection technology, and in particular to an image restoration degree detection method and related equipment. Background Art
[0002] With the advancement of computer technology and social progress, more and more companies are dividing different tasks into design and development phases. This allows them to split the work and delegate it to different companies for greater efficiency and quality. However, splitting design and development work can result in the final product differing from the design phase, necessitating fidelity testing of both the finished product and the design proposal. For example, in software development, it's often necessary to test the fidelity of the software interface based on the provided design drawings.
[0003] Currently, image fidelity testing typically involves manually comparing the interface in the design drawing with the actual application interface. This process identifies elements that differ between the software application interface and the design and provides modification suggestions. However, manual comparison is subjective, lacks accuracy and comprehensiveness, is relatively time-consuming, and cannot quantify differences. This leads to low fidelity testing efficiency, lacks horizontal comparability between testers, and poor practicality of fidelity data. Summary of the Invention
[0004] The present invention provides an image restoration degree detection method and related equipment to solve the problem that the current image restoration degree detection method is based on manual comparison, resulting in poor accuracy and objectivity of the detection data, long detection time, low detection efficiency, and the detection data does not have the same quantitative standard and cannot be compared horizontally, which in turn leads to poor practicality of the restoration degree data.
[0005] In a first aspect, the present invention provides a method for detecting image restoration degree, comprising:
[0006] Acquire a first standard image and a first image to be detected;
[0007] Acquire first pixel distribution information of the first standard image and second pixel distribution information of the first image to be detected;
[0008] Determining a positioning pixel area and a random pixel area of the first standard image based on the first pixel distribution information and the target positioning area, wherein the target positioning area is an area having positioning features in the first standard image, and the positioning pixel area is used to determine relative positions of pixels in the first image to be detected and the first standard image based on the first pixel distribution information and the second pixel distribution information, and to determine a collection range of the random pixel area of the first standard image;
[0009] Based on the positioning pixel point area, the random pixel point area, the first pixel point distribution information and the second pixel point distribution information, a first restoration degree of the first image to be detected relative to the first standard image is determined.
[0010] Optionally, the image restoration degree detection method further includes:
[0011] Adjusting the image sizes of the first standard image and the first image to be detected to obtain a second standard image and a second image to be detected having the same image sizes;
[0012] Acquire a first grayscale value distribution of the second standard image and a second grayscale value distribution of the second image to be detected;
[0013] Determining a first average grayscale value of the second standard image and a second average grayscale value of the second image to be detected based on the first grayscale value distribution and the second grayscale value distribution;
[0014] determining a first grayscale fingerprint of the first standard image based on the first grayscale value distribution and the first average grayscale value, wherein the first grayscale fingerprint is determined based on a quantitative relationship between the first average grayscale value and the grayscale values of each pixel in the first grayscale value distribution;
[0015] Determining a second grayscale fingerprint of the second image to be detected based on the second grayscale value distribution and the second average grayscale value, wherein the second grayscale fingerprint is determined based on a quantitative relationship between the second average grayscale value and the grayscale value of each pixel in the second grayscale value distribution;
[0016] A second restoration degree of the first to-be-detected image relative to the first standard image is determined according to the first grayscale fingerprint and the second grayscale fingerprint.
[0017] Optionally, adjusting the image sizes of the first standard image and the first image to be detected to obtain a second standard image and a second image to be detected having the same image sizes includes:
[0018] The first standard image and the first image to be detected are reduced to a target reduced size to obtain a second standard image and a second image to be detected having the same image size.
[0019] Optionally, the image restoration degree detection method further includes:
[0020] Acquire a first grayscale image of the first standard image and a second grayscale image of the first image to be detected;
[0021] Based on a preset grayscale threshold, obtaining a first binary matrix corresponding to the first grayscale image and a second binary matrix corresponding to the second grayscale image, wherein the first binary matrix is a color value distribution matrix determined after binarization processing is performed on the first grayscale image based on the preset grayscale threshold, and the second binary matrix is a color value distribution matrix determined after binarization processing is performed on the second grayscale image based on the preset grayscale threshold;
[0022] A third restoration degree of the first to-be-detected image relative to the first standard image is determined according to the first binary matrix and the second binary matrix.
[0023] Optionally, the image restoration degree detection method further includes:
[0024] Acquire first character information of the first standard image and second character information of the first image to be detected;
[0025] determining Hamming distance information between the first standard image and the first image to be detected based on the first character information and the second character information;
[0026] A fourth restoration degree of the first to-be-detected image relative to the first standard image is determined according to the Hamming distance information.
[0027] Optionally, adjusting the image sizes of the first standard image and the first image to be detected to obtain a second standard image and a second image to be detected having the same image sizes includes:
[0028] determining color block distribution information of the first standard image based on the first pixel distribution information;
[0029] determining a minimum color block area of the first standard image according to the color block distribution information;
[0030] determining a scalable range of the first standard image based on the minimum color block area;
[0031] The image sizes of the first standard image and the first image to be detected are adjusted according to the scalable range.
[0032] Optionally, obtaining a first binary matrix corresponding to the first grayscale image and a second binary matrix corresponding to the second grayscale image based on a preset grayscale threshold includes:
[0033] determining a background grayscale value of the first standard image based on the first pixel distribution information;
[0034] Acquire target monitoring features of the first standard image and their corresponding target monitoring grayscale values;
[0035] Determining a preset grayscale threshold for binarization processing based on the background grayscale value and / or the target monitoring grayscale value;
[0036] According to the preset grayscale threshold, binarization processing is performed on the first grayscale image and the second grayscale image to obtain the first binary matrix and the second binary matrix.
[0037] Optionally, before the step of determining a first restoration degree of the first to-be-detected image relative to the first standard image based on the positioning pixel area, the random pixel area, the first pixel distribution information, and the second pixel distribution information, the step further includes:
[0038] Obtaining the distribution of color blocks in the random pixel area;
[0039] Based on the number of color blocks in the random pixel area and / or the color values of adjacent color blocks in the random pixel area, the distribution of the target acquisition information in the random pixel area is determined.
[0040] In a second aspect, the present invention further provides an image restoration degree detection device, comprising:
[0041] An image acquisition module, configured to acquire a first standard image and a first image to be detected;
[0042] a pixel point acquisition module, configured to acquire first pixel point distribution information of the first standard image and second pixel point distribution information of the first image to be detected;
[0043] an acquisition module, configured to determine a positioning pixel area and a random pixel area of the first standard image based on the first pixel distribution information and the target positioning area, wherein the target positioning area is an area having positioning features in the first standard image, and the target positioning area is used to determine an acquisition range of the first image to be detected and the random pixel area of the first standard image;
[0044] A determination module is used to determine a first restoration degree of the first image to be detected relative to the first standard image based on the positioning pixel point area, the random pixel point area, the first pixel point distribution information and the second pixel point distribution information.
[0045] In a third aspect, the present invention further provides an electronic device comprising a memory and a processor, wherein the processor is configured to implement the steps of the image restoration degree detection method as described in any one of the first aspects above when executing a computer program stored in the memory.
[0046] It can be seen from the above technical solution that an embodiment of the present application provides an image restoration degree detection method, including: obtaining a first standard image and a first image to be detected; obtaining first pixel point distribution information of the first standard image and second pixel point distribution information of the first image to be detected; based on the first pixel point distribution information and the target positioning area, determining the positioning pixel point area and the random pixel point area of the first standard image, wherein the target positioning area is an area with positioning features in the first standard image, and the positioning pixel point area is used to determine the relative position of the pixels in the first image to be detected and the first standard image based on the first pixel point distribution information and the second pixel point distribution information, and determine the acquisition range of the random pixel point area of the first standard image; based on the positioning pixel point area, the random pixel point area, the first pixel point distribution information and the second pixel point distribution information, determine the first restoration degree of the first image to be detected relative to the first standard image. By matching the pixel distribution information within the positioning pixel area, the relative position of the pixel information in the first image to be detected in the first standard image can be determined, the area that can be used for matching can be determined, and then the acquisition range of the random pixel area can be determined to improve the accuracy of pixel matching. Based on the first pixel distribution information and the second pixel distribution information, the matching situation in the positioning pixel area and the random pixel area can be determined, and the first restoration degree of the first image to be detected relative to the first standard image can be determined, so as to realize the quantitative evaluation of the image restoration degree and improve the accuracy and objectivity of the detection data. By selecting some pixels for detection, the detection time can be saved, the detection efficiency can be improved, and the practicality and convenience of the image restoration degree detection method can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0048] Figure 1A schematic flow chart of an image restoration degree detection method provided in an embodiment of the present application;
[0049] Figure 2 A schematic structural diagram of an image restoration degree detection device provided in an embodiment of the present application;
[0050] Figure 3 A schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0051] Figure 4 A schematic structural diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The embodiments will be described in detail below, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following embodiments do not represent all implementation methods consistent with the present application. They are only examples of systems and methods consistent with some aspects of the present application as detailed in the claims. In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways, and the device embodiments described below are merely exemplary.
[0053] like Figure 1 As shown, an embodiment of the present application provides a method for detecting image restoration degree, which can be performed by a server and a controller, etc. The method includes:
[0054] Step S110: Acquire a first standard image and a first image to be detected.
[0055] Step S120 : Obtain first pixel distribution information of the first standard image and second pixel distribution information of the first image to be detected.
[0056] Exemplarily, the first pixel distribution information and the second pixel distribution information include coordinate positions and color value information of the pixels relative to the first standard image and the first image to be detected.
[0057] Step S130: Based on the first pixel distribution information and the target positioning area, determine the positioning pixel area and the random pixel area of the first standard image, wherein the target positioning area is an area with positioning features in the first standard image, and the positioning pixel area is used to determine the relative positions of the pixels in the first image to be detected and the first standard image based on the first pixel distribution information and the second pixel distribution information, and determine the acquisition range of the random pixel area of the first standard image.
[0058] Exemplarily, the target positioning area is an area with positioning features, which may include the center area of the first standard image and the top corner area of the image. The target positioning area may be determined manually or based on historical detection data. When determining the target positioning area, the positioning pixel area is determined based on the characteristics of the pixel distribution information around the target positioning area. For example, when the target positioning area is a top corner, the length, width, shape, and other information of the positioning pixel area can be determined based on the distribution of the color values of the pixels at the top corner.
[0059] Exemplarily, an area outside the positioning pixel area may be selected as the random pixel area, and the random pixel area may be automatically selected through a random sampling program.
[0060] Step S140: Determine a first restoration degree of the first image to be detected relative to the first standard image based on the positioning pixel area, the random pixel area, the first pixel distribution information, and the second pixel distribution information.
[0061] For example, the matching between the positioning pixel region and the random pixel region can be determined based on the first pixel distribution information and the second pixel distribution information. A weight can be set for the matching degree between the positioning pixel region and the random pixel region to further quantify the first restoration degree.
[0062] By matching the pixel distribution information within the positioning pixel area, the relative position of the pixel information in the first image to be detected in the first standard image can be determined, the area that can be used for matching can be determined, and then the acquisition range of the random pixel area can be determined to improve the accuracy of pixel matching. Based on the first pixel distribution information and the second pixel distribution information, the matching situation in the positioning pixel area and the random pixel area can be determined, and the first restoration degree of the first image to be detected relative to the first standard image can be determined, so as to realize the quantitative evaluation of the image restoration degree and improve the accuracy and objectivity of the detection data. By selecting some pixels for detection, the detection time can be saved, the detection efficiency can be improved, and the practicality and convenience of the image restoration degree detection method can be improved.
[0063] In a feasible implementation manner, the above-mentioned image restoration degree detection method further includes:
[0064] Step S210: Adjust the image sizes of the first standard image and the first image to be detected to obtain a second standard image and a second image to be detected having the same image sizes;
[0065] Step S220, obtaining a first grayscale value distribution of the second standard image and a second grayscale value distribution of the second image to be detected;
[0066] Step S230: determining a first average grayscale value of the second standard image and a second average grayscale value of the second image to be detected based on the first grayscale value distribution and the second grayscale value distribution;
[0067] Step S240: determining a first grayscale fingerprint of the first standard image based on the first grayscale value distribution and the first average grayscale value, wherein the first grayscale fingerprint is determined based on a quantitative relationship between the first average grayscale value and the grayscale values of each pixel in the first grayscale value distribution;
[0068] Step S250: determining a second grayscale fingerprint of the second image to be detected based on the second grayscale value distribution and the second average grayscale value, wherein the second grayscale fingerprint is determined based on a quantitative relationship between the second average grayscale value and the grayscale values of each pixel in the second grayscale value distribution;
[0069] Step S260: Determine a second restoration degree of the first image to be detected relative to the first standard image based on the first grayscale fingerprint and the second grayscale fingerprint.
[0070] For example, the color value detail level of the first standard image and the first image to be detected can be determined based on the first pixel distribution information and the second pixel distribution information. The image adjustment ratio can be determined based on the color value detail level. For example, an image can be amplified when the color value detail level is high. The first grayscale value distribution and the second grayscale value distribution include pixel coordinates and their corresponding grayscale value information of the second standard image and the second image to be detected.
[0071] Exemplarily, the first grayscale fingerprint can be determined by the magnitude relationship between the grayscale value of each pixel in the first grayscale value distribution and the first average grayscale value. For example, when the grayscale value of a certain pixel is greater than the first average grayscale value, the value at the pixel can be recorded as "1"; when the grayscale value of a certain pixel is less than or equal to the first average grayscale value, the value at the pixel can be recorded as "0". The quantitative relationship between the grayscale value of each pixel in the first grayscale value distribution and the first average grayscale value can be traversed to obtain the value at each pixel, and the first grayscale fingerprint can be determined based on the arrangement of each pixel. The method for determining the second grayscale fingerprint is the same as the method for determining the first grayscale fingerprint.
[0072] Exemplarily, the second degree of restoration of the first image to be detected relative to the first standard image can be determined based on the number of pixels with different values at each pixel in the first grayscale fingerprint and the second grayscale fingerprint relative to the total number of pixels in the first grayscale value distribution.
[0073] By adjusting the first image to be tested and the first standard image to the same size, we can avoid the problem of comparing images of different sizes and proportions, which would cause stretching or compression of color blocks, leading to changes in the distribution of pixels and, in turn, lowering the accuracy of image restoration detection. Furthermore, comparing images by grayscale values can avoid underestimating the restoration accuracy due to overall image hue deviations, thereby improving the quality and practicality of the restoration detection data, and thus the practicality and convenience of the image restoration detection method.
[0074] In a feasible implementation manner, adjusting the image sizes of the first standard image and the first image to be detected to obtain the second standard image and the second image to be detected having the same image sizes includes:
[0075] Step S310: Reduce the first standard image and the first image to be detected to a target reduced size to obtain a second standard image and a second image to be detected having the same image size.
[0076] By reducing the first standard image and the first image to be detected, the amount of data processing can be reduced, thereby improving the efficiency of image restoration detection, saving detection time and detection computing power, and thus improving the practicality and convenience of the image restoration detection method.
[0077] In a feasible implementation manner, the above-mentioned image restoration degree detection method further includes:
[0078] Step S410: Acquire a first grayscale image of the first standard image and a second grayscale image of the first image to be detected;
[0079] Step S420: Based on a preset grayscale threshold, a first binary matrix corresponding to the first grayscale image and a second binary matrix corresponding to the second grayscale image are obtained, wherein the first binary matrix is a color value distribution matrix determined after binarizing the first grayscale image based on the preset grayscale threshold, and the second binary matrix is a color value distribution matrix determined after binarizing the second grayscale image based on the preset grayscale threshold;
[0080] Step S430: Determine a third restoration degree of the first image to be detected relative to the first standard image based on the first binary matrix and the second binary matrix.
[0081] Exemplarily, the preset grayscale threshold may be determined based on the grayscale value of the color value corresponding to the pixel point of the feature to be detected.
[0082] The binarization process can set the pixel values at which the grayscale value exceeds a preset grayscale threshold to "1," and can set the pixel values at which the grayscale value is less than or equal to the preset grayscale threshold to "0." The binary matrix is determined based on the pixel values and the pixel coordinates relative to the image.
[0083] By binarizing the image, the area that needs to be inspected can be highlighted, and the accuracy of the image restoration data in the key inspection area can be improved, thereby improving the practicality and effectiveness of the restoration detection data.
[0084] In a feasible implementation manner, the above-mentioned image restoration degree detection method further includes:
[0085] Step S510: Acquire the first character information of the first standard image and the second character information of the first image to be detected;
[0086] Step S520: determining Hamming distance information between the first standard image and the first image to be detected based on the first character information and the second character information;
[0087] Step S530: Determine a fourth restoration degree of the first to-be-detected image relative to the first standard image based on the Hamming distance information.
[0088] Exemplarily, the image data of the first standard image and the first image to be detected can be converted and stored in a cache area through the nodejs Buffer method. The two sets of data can be converted into strings through toString to obtain the first character information and the second character information. The Hamming distance information can be determined based on the first character information and the second character information, and the similarity between the first image to be detected and the first standard image can be determined based on the Hamming distance information, wherein the similarity can be the ratio of the difference between the string length and the Hamming distance to the string length. A mapping relationship between the ratio information and the fourth degree of restoration can be established.
[0089] By converting image information into character information and determining the similarity between the first image to be detected and the first standard image based on the character information, the restoration degree can be detected from the image as a whole, simplifying the detection steps and reducing the detection difficulty, thereby improving the image restoration degree detection efficiency and detection quality.
[0090] In a feasible implementation manner, adjusting the image sizes of the first standard image and the first image to be detected to obtain the second standard image and the second image to be detected having the same image sizes includes:
[0091] Step S610: determining color block distribution information of the first standard image based on the first pixel distribution information;
[0092] Step S620: determining the minimum color block area of the first standard image based on the color block distribution information;
[0093] Step S630: determining a scalable range of the first standard image based on the minimum color block area;
[0094] Step S640: Adjust the image sizes of the first standard image and the first image to be detected according to the scalable range.
[0095] Exemplarily, the color block distribution information is determined based on the first pixel distribution information. An area where the difference between the color values of adjacent pixels is less than a preset difference may be considered a color block. The color block distribution information may include the color value, shape, and position of the color block relative to the first standard image. The number of pixels within the minimum color block area may be used as the minimum reduction ratio.
[0096] Determining the scalable range of the first standard image based on the minimum color block area can avoid over-compression of the image, which results in the inability to extract the grayscale values of the pixels of the compressed image. This can improve the accuracy of image restoration detection, improve the quality and practicality of restoration detection data, and further improve the practicality and convenience of the image restoration detection method.
[0097] In a feasible implementation, the step of obtaining the first binary matrix corresponding to the first grayscale image and the second binary matrix corresponding to the second grayscale image based on a preset grayscale threshold includes:
[0098] Step S710: determining the background grayscale value of the first standard image based on the first pixel distribution information;
[0099] Step S720: Acquire the target monitoring features of the first standard image and their corresponding target monitoring grayscale values;
[0100] Step S730: determining a preset grayscale threshold for binarization processing based on the background grayscale value and / or the target monitoring grayscale value;
[0101] Step S740: Binarize the first grayscale image and the second grayscale image according to the preset grayscale threshold to obtain the first binary matrix and the second binary matrix.
[0102] Exemplarily, the background of the first standard image can be determined based on the distribution of color blocks with the same color value in the first standard image, or based on the proportion of various color values in the first standard image. When the first standard image has target monitoring features, the preset grayscale threshold can be a value in the interval formed by the background grayscale value and the target monitoring grayscale value. When the first standard image does not have target monitoring features, the preset grayscale threshold can be the background grayscale value. When the first standard image does not have a background grayscale value, the preset grayscale threshold can be the target monitoring grayscale value.
[0103] The preset grayscale threshold is determined by the background grayscale value. By binarizing the image, the area that needs to be detected can be highlighted, and the outline of the color blocks in the image can be enhanced to distinguish the image background and other content; the preset grayscale threshold is determined by the target monitoring grayscale value, which can highlight the target monitoring features and improve the accuracy of the image restoration data in the key detection area, thereby improving the practicality and effectiveness of the restoration detection data.
[0104] In a feasible embodiment, before the step of determining the first degree of restoration of the first image to be detected relative to the first standard image based on the positioning pixel area, the random pixel area, the first pixel distribution information, and the second pixel distribution information, the step further includes:
[0105] Step S810: Obtain the distribution of color blocks in the random pixel area;
[0106] Step S820: Determine the distribution of target acquisition information in the random pixel area based on the number of color blocks in the random pixel area and / or the color values of adjacent color blocks in the random pixel area.
[0107] Exemplarily, the distribution of the target acquisition information includes the number and acquisition range of the target acquisition information. For example, when the number of color blocks in the random pixel area is greater than 1, the junction between the at least two color blocks can be used as the acquisition range of the target acquisition information. The number of target acquisition information collected at the junction can be determined based on the difference between the color values of the adjacent color blocks, and the number of collections is inversely proportional to the difference between the color values. When the number of color blocks in the random pixel area is 1, a certain number of pixels can be randomly selected in the random pixel area as target acquisition confidence points. The number of target acquisition information can be determined based on the importance of the features at the random pixel area, and the number of target acquisition information is positively correlated with the importance of the features.
[0108] By obtaining the number of color blocks in a random pixel region and determining the distribution of target acquisition information in the random pixel region, when at least two adjacent color blocks exist in the random pixel region, pixel information at the intersection of the color blocks can be focused on to determine the degree of similarity between the boundary contours of the color blocks in the random pixel region in the first image to be detected and those in the first standard image, thereby improving the accuracy of image restoration detection. When only one color block exists in the random pixel region, the number of samples can be reduced, saving computational effort and processing time, thereby improving the efficiency of restoration detection.
[0109] like Figure 2 As shown, Figure 2 This is a schematic structural diagram of an image restoration degree detection device provided in an embodiment of the present application, the device comprising:
[0110] An image acquisition module 201 is configured to acquire a first standard image and a first image to be detected;
[0111] A pixel point acquisition module 202 is used to acquire first pixel point distribution information of the first standard image and second pixel point distribution information of the first image to be detected;
[0112] An acquisition module 203 is configured to determine a positioning pixel area and a random pixel area of the first standard image based on the first pixel distribution information and the target positioning area, wherein the target positioning area is an area having positioning features in the first standard image, and the target positioning area is used to determine an acquisition range of the random pixel area of the first image to be detected and the first standard image;
[0113] The determination module 204 is used to determine a first restoration degree of the first image to be detected relative to the first standard image based on the above-mentioned positioning pixel point area, the above-mentioned random pixel point area, the above-mentioned first pixel point distribution information and the above-mentioned second pixel point distribution information.
[0114] An image restoration degree detection device 200 can realize Figure 1 To avoid repetition, the various processes implemented in the method embodiment will not be described again here.
[0115] See also Figure 3 , Figure 3 A schematic structural diagram of an electronic device provided in an embodiment of the present application.
[0116] An embodiment of the present application provides an electronic device 300, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320. When the processor 320 executes the computer program 311, the following steps are implemented:
[0117] Acquire a first standard image and a first image to be detected;
[0118] Obtaining first pixel distribution information of the first standard image and second pixel distribution information of the first image to be detected;
[0119] Based on the first pixel distribution information and the target positioning area, determining the positioning pixel area and the random pixel area of the first standard image, wherein the target positioning area is an area having positioning features in the first standard image, and the positioning pixel area is used to determine the relative positions of pixels in the first image to be detected and the first standard image based on the first pixel distribution information and the second pixel distribution information, and determine the acquisition range of the random pixel area of the first standard image;
[0120] Based on the above-mentioned positioning pixel point area, the above-mentioned random pixel point area, the above-mentioned first pixel point distribution information and the above-mentioned second pixel point distribution information, a first restoration degree of the above-mentioned first image to be detected relative to the above-mentioned first standard image is determined.
[0121] In the specific implementation process, when the processor 320 executes the computer program 311, it can achieve Figure 1 Any implementation manner in the corresponding embodiments.
[0122] Since the electronic device introduced in this embodiment is a device used to implement a device in the embodiment of the present application, based on the method introduced in the embodiment of the present application, technical personnel in this field can understand the specific implementation of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present application is not introduced in detail here. As long as the equipment used by technical personnel in this field to implement the method in the embodiment of the present application falls within the scope of protection to be protected by this application.
[0123] like Figure 4 As shown, Figure 4 A schematic structural diagram of a computer-readable storage medium provided in an embodiment of the present application.
[0124] This embodiment provides a computer-readable storage medium 400, on which a computer program 411 is stored. When the computer program 411 is executed by a processor, the following steps are implemented:
[0125] Acquire a first standard image and a first image to be detected;
[0126] Obtaining first pixel distribution information of the first standard image and second pixel distribution information of the first image to be detected;
[0127] Based on the first pixel distribution information and the target positioning area, determining the positioning pixel area and the random pixel area of the first standard image, wherein the target positioning area is an area having positioning features in the first standard image, and the positioning pixel area is used to determine the relative positions of pixels in the first image to be detected and the first standard image based on the first pixel distribution information and the second pixel distribution information, and determine the acquisition range of the random pixel area of the first standard image;
[0128] Based on the above-mentioned positioning pixel point area, the above-mentioned random pixel point area, the above-mentioned first pixel point distribution information and the above-mentioned second pixel point distribution information, a first restoration degree of the above-mentioned first image to be detected relative to the above-mentioned first standard image is determined.
[0129] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0131] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0133] The present application also provides a computer program product, which includes computer software instructions. When the computer software instructions are executed on a processing device, the processing device is caused to execute the following Figure 1 The process of the image restoration degree detection method in the corresponding embodiment.
[0134] The above-mentioned computer program product includes one or more computer instructions. When the above-mentioned computer program instructions are loaded and executed on a computer, the above-mentioned process or function according to the embodiment of the present application is generated in whole or in part. The above-mentioned computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The above-mentioned computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The above-mentioned computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated therein. The above-mentioned available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0135] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0137] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0138] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0139] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the above-mentioned methods in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0140] In summary, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for detecting image restoration degree, characterized in that: include: Acquire a first standard image and a first image to be detected; Acquire first pixel distribution information of the first standard image and second pixel distribution information of the first image to be detected; Determining a positioning pixel area and a random pixel area of the first standard image based on the first pixel distribution information and the target positioning area, wherein the target positioning area is an area having positioning features in the first standard image, and the positioning pixel area is used to determine relative positions of pixels in the first image to be detected and the first standard image based on the first pixel distribution information and the second pixel distribution information, and to determine a collection range of the random pixel area of the first standard image; Determining a first restoration degree of the first to-be-detected image relative to the first standard image based on the positioning pixel point area, the random pixel point area, the first pixel point distribution information, and the second pixel point distribution information; Adjusting the image sizes of the first standard image and the first image to be detected to obtain a second standard image and a second image to be detected having the same image sizes; Acquire a first grayscale value distribution of the second standard image and a second grayscale value distribution of the second image to be detected; Determining a first average grayscale value of the second standard image and a second average grayscale value of the second image to be detected based on the first grayscale value distribution and the second grayscale value distribution; determining a first grayscale fingerprint of the first standard image based on the first grayscale value distribution and the first average grayscale value, wherein the first grayscale fingerprint is determined based on a quantitative relationship between the first average grayscale value and the grayscale values of each pixel in the first grayscale value distribution; Determining a second grayscale fingerprint of the second image to be detected based on the second grayscale value distribution and the second average grayscale value, wherein the second grayscale fingerprint is determined based on a quantitative relationship between the second average grayscale value and the grayscale value of each pixel in the second grayscale value distribution; A second restoration degree of the first to-be-detected image relative to the first standard image is determined according to the first grayscale fingerprint and the second grayscale fingerprint.
2. The image restoration degree detection method according to claim 1, wherein: The adjusting the image sizes of the first standard image and the first image to be detected to obtain the second standard image and the second image to be detected having the same image sizes includes: The first standard image and the first image to be detected are reduced to a target reduced size to obtain a second standard image and a second image to be detected having the same image size.
3. The image restoration degree detection method according to claim 1, wherein: Also includes: Acquire a first grayscale image of the first standard image and a second grayscale image of the first image to be detected; Based on a preset grayscale threshold, obtaining a first binary matrix corresponding to the first grayscale image and a second binary matrix corresponding to the second grayscale image, wherein the first binary matrix is a color value distribution matrix determined after binarization processing is performed on the first grayscale image based on the preset grayscale threshold, and the second binary matrix is a color value distribution matrix determined after binarization processing is performed on the second grayscale image based on the preset grayscale threshold; A third restoration degree of the first to-be-detected image relative to the first standard image is determined according to the first binary matrix and the second binary matrix.
4. The image restoration degree detection method according to claim 1, wherein: Also includes: Acquire first character information of the first standard image and second character information of the first image to be detected; determining Hamming distance information between the first standard image and the first image to be detected based on the first character information and the second character information; A fourth restoration degree of the first to-be-detected image relative to the first standard image is determined according to the Hamming distance information.
5. The image restoration degree detection method according to claim 1, wherein: The adjusting the image sizes of the first standard image and the first image to be detected to obtain the second standard image and the second image to be detected having the same image sizes includes: determining color block distribution information of the first standard image based on the first pixel distribution information; determining a minimum color block area of the first standard image according to the color block distribution information; determining a scalable range of the first standard image based on the minimum color block area; The image sizes of the first standard image and the first image to be detected are adjusted according to the scalable range.
6. The image restoration degree detection method according to claim 3, wherein: The obtaining, based on a preset grayscale threshold, a first binary matrix corresponding to the first grayscale image and a second binary matrix corresponding to the second grayscale image includes: determining a background grayscale value of the first standard image based on the first pixel distribution information; Acquire target monitoring features of the first standard image and their corresponding target monitoring grayscale values; Determining a preset grayscale threshold for binarization processing based on the background grayscale value and / or the target monitoring grayscale value; According to the preset grayscale threshold, binarization processing is performed on the first grayscale image and the second grayscale image to obtain the first binary matrix and the second binary matrix.
7. The image restoration degree detection method according to claim 1, wherein: Before the step of determining a first restoration degree of the first to-be-detected image relative to the first standard image based on the positioning pixel area, the random pixel area, the first pixel distribution information, and the second pixel distribution information, the method further includes: Obtaining the distribution of color blocks in the random pixel area; Based on the number of color blocks in the random pixel area and / or the color values of adjacent color blocks in the random pixel area, the distribution of the target acquisition information in the random pixel area is determined.
8. An image restoration degree detection device, characterized in that: include: An image acquisition module, configured to acquire a first standard image and a first image to be detected; a pixel point acquisition module, configured to acquire first pixel point distribution information of the first standard image and second pixel point distribution information of the first image to be detected; an acquisition module, configured to determine a positioning pixel area and a random pixel area of the first standard image based on the first pixel distribution information and the target positioning area, wherein the target positioning area is an area having positioning features in the first standard image, and the target positioning area is used to determine an acquisition range of the first image to be detected and the random pixel area of the first standard image; a determination module, configured to determine a first restoration degree of the first to-be-detected image relative to the first standard image based on the positioning pixel point area, the random pixel point area, the first pixel point distribution information, and the second pixel point distribution information; An image adjustment module is configured to adjust the image sizes of the first standard image and the first image to be detected to obtain a second standard image and a second image to be detected having the same image sizes; A grayscale acquisition module, configured to acquire a first grayscale value distribution of the second standard image and a second grayscale value distribution of the second image to be detected; a grayscale determination module, configured to determine a first average grayscale value of the second standard image and a second average grayscale value of the second image to be detected based on the first grayscale value distribution and the second grayscale value distribution; a first fingerprint determination module, configured to determine a first grayscale fingerprint of the first standard image based on the first grayscale value distribution and the first average grayscale value, wherein the first grayscale fingerprint is determined based on a quantitative relationship between the first average grayscale value and the grayscale values of each pixel in the first grayscale value distribution; a second fingerprint determination module, configured to determine a second grayscale fingerprint of the second image to be detected based on the second grayscale value distribution and the second average grayscale value, wherein the second grayscale fingerprint is determined based on a quantitative relationship between the second average grayscale value and the grayscale value of each pixel in the second grayscale value distribution; The restoration degree determination module is used to determine a second restoration degree of the first image to be detected relative to the first standard image based on the first grayscale fingerprint and the second grayscale fingerprint.
9. An electronic device comprising a memory and a processor, characterized in that: The processor is configured to implement the steps of the image restoration degree detection method according to any one of claims 1 to 7 when executing the computer program stored in the memory.
Citation Information
Patent Citations
Method of sampling feature points, image matching method, and image matching apparatus
CN104778682A
Method for identifying phase state distribution characteristic of polymer modified asphalt
CN112763466A