A photographing definition recognition method and system based on edge detection

By combining differential image and edge detection methods with fuzzy probability and weighted processing, the problem of low accuracy in image sharpness recognition is solved, and accurate assessment and quality improvement of image sharpness are achieved.

CN120451127BActive Publication Date: 2026-01-13广东九安智能科技股份有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510612919.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2026-01-13
Estimated Expiration
2045-05-13

AI Technical Summary

Technical Problem

Existing technologies fail to effectively utilize edge pixel information in images for image sharpness recognition, resulting in low accuracy of sharpness recognition results.

Method used

By calculating the blur probability through differential images, and combining edge detection and weighted processing, the similarity of images is calculated, and the standard image is dynamically updated to improve the accuracy of sharpness recognition.

Benefits of technology

It enables accurate assessment of image sharpness, enhances the precision and sensitivity of image quality assessment, and is suitable for photo effect detection and image quality improvement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451127B_ABST
    Figure CN120451127B_ABST
Patent Text Reader

Abstract

The present application relates to the field of photographing definition recognition, more particularly, the present application relates to a photographing definition recognition method and system based on edge detection. The method comprises: obtaining a pre-processed target image, the target image being a current image to be measured, performing difference between the target image and a standard image to obtain a difference image, and calculating a blur probability of the target image according to the difference image; performing edge detection on the target image to obtain edge pixel points, and calculating the importance of the edge pixel points according to the edge pixel points and the difference image; weighting each pixel point in the target image, and then converting the target image into a sequence, calculating the similarity between the sequence of the target image and the sequence of the standard image, and when the similarity is not less than a preset threshold, regarding the target image as an updated standard image and continuing the definition recognition. Through the technical scheme of the present application, the accuracy of the definition recognition result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image sharpness recognition. More specifically, this invention relates to an image sharpness recognition method and system based on edge detection. Background Technology

[0002] With the widespread use of smartphones, digital cameras, and other mobile devices, photography has become an important part of modern life. From social media to e-commerce and digital archive management, image capture technology continues to permeate our lives. However, in practical applications, capturing clear, high-quality images still faces many challenges. Factors affecting image quality include lighting conditions, focal length, camera hardware performance, shooting angle, and camera shake. Among these, one of the most common influencing factors is image sharpness. Image sharpness directly affects the visual effect of the image and subsequent processing applications, especially in fields such as image analysis, image recognition, and augmented reality. Poorly sharp images not only significantly detract from the visual experience but may also lead to the failure or inaccuracy of image processing algorithms, thereby affecting the efficiency and accuracy of subsequent tasks.

[0003] A Chinese patent application with publication number CN104394377A discloses a method and apparatus for identifying blurry anomalies in surveillance images, comprising: capturing a surveillance image from a video stream and smoothing the surveillance image; calculating a blur evaluation value between the original surveillance image and the smoothed surveillance image; comparing the blur evaluation value with a preset blur threshold; and determining that the surveillance image is a blurry image if the blur evaluation value is less than the blur threshold.

[0004] However, edge pixels in an image usually correspond to the outline, shape, and structural features of an object, containing a lot of detailed information. The aforementioned application determines whether an image is blurry by analyzing the structural similarity between two images, without taking into account the relationship between edge pixels in the image, which leads to low accuracy of the sharpness recognition results. Summary of the Invention

[0005] To address the issue of low accuracy in image sharpness recognition, this invention proposes a method and system for image sharpness recognition based on edge detection.

[0006] In a first aspect, this invention discloses a method for image sharpness recognition based on edge detection, comprising: acquiring a preprocessed target image, wherein the target image is the current image to be tested; performing a difference operation between the target image and a standard image to obtain a difference image; calculating the blur probability of the target image based on the difference image; performing edge detection on the target image to obtain edge pixels; calculating the importance of the edge pixels based on the edge pixels and the difference image; weighting each pixel in the target image and converting the target image into a sequence; calculating the similarity between the sequence of the target image and the sequence of the standard image; when the similarity is not less than a preset threshold, using the target image as the updated standard image and continuing the sharpness recognition; the similarity satisfies the following relationship:

[0007] , Sequence representing the target image and a sequence of standard images Similarity, Sequence representing the target image The mean, Sequences representing standard images The mean, Represents a sequence and sequence covariance, and Representing sequences respectively and sequence variance and These are two stability constants.

[0008] First, the blur probability is obtained by calculating the difference between the target image and the standard image, providing a preliminary basis for subsequent sharpness assessment. Next, edge detection not only extracts structural information from the image but also assesses the importance of edge pixels by combining the difference image, thus avoiding misfocusing on irrelevant areas. After weighting, the influence of each pixel in the target image is more accurately assessed, helping to highlight key areas of the image. The similarity between the target image and the standard image is further verified to see if the target image has met the preset sharpness standard. If the similarity meets the requirements, the target image is updated to a new standard image, and continuous iterative optimization is performed. This not only dynamically tracks changes in image sharpness but also accurately assesses image quality by integrating multiple pieces of information.

[0009] Preferably, the preprocessing includes: denoising the target image using Gaussian filtering, improving the brightness distribution of the target image using histogram equalization, and enhancing the edge information in the target image using an edge enhancement algorithm.

[0010] Preferably, the fuzziness probability includes: counting the number of non-zero pixels in the difference image, calculating the ratio of the total number of pixels in the difference image to the number of non-zero pixels, and using the result of negative correlation mapping of the ratio as the fuzziness probability.

[0011] When the proportion of non-zero pixels in a difference image is high, it means that there are more variations or irregularities in the image, which usually indicates that the image may be blurry or noisy.

[0012] Preferably, the blur probability further includes: dividing the difference image into several sub-regions using a grid, and counting the number of non-zero pixels in each sub-region; the blur probability satisfies the following relationship:

[0013] , Represents fuzzy probability. Subregion The number of non-zero pixels in the middle. This represents the average number of non-zero pixels in the sub-region. This represents the total number of sub-regions. This represents an exponential function.

[0014] By exponentializing the difference between the number of non-zero pixels in each sub-region and the mean of that region, the non-uniformity of pixel distribution between regions is emphasized, which helps to highlight areas of significant variation in the image and suppress the effects of noise.

[0015] Preferably, the importance includes: for any edge pixel, calculating the gradient value of the edge pixel; the importance satisfies the following relationship:

[0016] , Indicates the position is the Line 1 The importance of edge pixels in a column Indicates the position is the Line 1 Gradient values ​​of edge pixels in the column. It is a vector function. In the difference image, the first... Line 1 Column pixel values, This represents a fuzzy probability.

[0017] The gradient values ​​of edges reflect the intensity of grayscale changes in an image, revealing details of the image structure, while the pixel values ​​of the difference image provide information about image changes under different states, helping to identify dynamic features of the image. By combining these three factors, not only edge sharpness and image variations are considered, but the influence of image quality is also adjusted through blur probability, thereby avoiding misjudgment of irrelevant information in blurry or low-quality images.

[0018] Preferably, the importance further includes: for any edge pixel, calculating the cumulative difference between the pixel value of the edge pixel and the pixel values ​​of its 8 neighboring pixels; the importance satisfies the following relationship:

[0019] , Indicates the position is the Line 1 The importance of edge pixels in a column Indicates the position is the Line 1 The cumulative difference of the edge pixels of the column. It is a vector function. In the difference image, the first... Line 1 Column pixel values, This represents a fuzzy probability.

[0020] Preferably, the weighting of each pixel in the target image includes: setting the weight of non-edge pixels in the target image to 1, and using the sum of 1 and importance as the weight of edge pixels in the target image; traversing to obtain the weight of each pixel in the target image to obtain the weighted target image.

[0021] For non-edge pixels, a uniform weight of 1 is assigned to ensure that smooth areas of the image are not disturbed after weighting; while for edge pixels, the weighted importance of each edge pixel is calculated by combining its gradient value, pixel information of the difference image, and blur probability, thereby enhancing the representation of key structures in the image.

[0022] Secondly, the present invention discloses an image sharpness recognition system based on edge detection, comprising: a processor; and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, the system performs the above-described image sharpness recognition method based on edge detection.

[0023] The beneficial effects of this invention are:

[0024] This invention accurately assesses image sharpness by leveraging the differences between a target image and a standard image, as well as edge information within the image. First, preprocessing techniques such as Gaussian filtering, histogram equalization, and edge enhancement improve image quality and reduce noise, thereby extracting sharper edge features. By calculating the image's blur probability and combining the gradient of edge pixels with the correlation of the difference image, the degree of blurriness can be effectively determined, especially in the image's edges. By weighting the target image and converting it into a sequence, the similarity between the target image and the standard image is calculated, allowing for adaptive updates to the standard image and progressively improving recognition accuracy. This method not only enhances the accuracy of image quality assessment but also optimizes the sensitivity of sharpness detection through edge information guidance. It is suitable for practical applications such as photo quality inspection and image quality improvement, providing more stable and reliable sharpness judgment results. Attached Figure Description

[0025] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent upon reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein:

[0026] Figure 1 This is a flowchart of the image sharpness recognition method based on edge detection according to an embodiment of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] It should be understood that when the terms "first," "second," etc., are used in the claims, specification, and drawings of this invention, they are only used to distinguish different objects and not to describe a specific order. The terms "comprising" and "including" used in the specification and claims of this invention indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0029] This invention provides a method for image sharpness recognition based on edge detection. For example... Figure 1 As shown, the image sharpness recognition method based on edge detection includes steps S1-S3, which are described in detail below.

[0030] S1. Obtain the preprocessed target image, which is the current image to be tested. Difference the target image with the standard image to obtain the difference image. Calculate the blur probability of the target image based on the difference image.

[0031] In one embodiment, in a scenario involving image sharpness detection, real-time video data is first acquired from a camera, and each frame of the video is extracted and processed as an image. To improve the accuracy of subsequent sharpness detection, Gaussian filtering is first applied to each frame to remove high-frequency noise and ensure the accuracy of edge information. Next, histogram equalization is used to enhance the brightness distribution of the target image, thereby improving details in low-contrast areas, making the image brightness more uniform and details more clearly visible. Finally, edge enhancement algorithms, such as Laplacian filtering or high-pass filtering, are used to strengthen edge information in the image, highlighting the contours and structures of objects, further improving image sharpness. These preprocessing steps effectively enhance image quality, ensuring that the sharpness detection algorithm can better identify image details and quality, providing clearer and more reliable input for subsequent sharpness evaluation.

[0032] The current image to be detected is used as the target image, and the target image is compared with the standard image to obtain the difference image.

[0033] For example, the video is extracted frame by frame into images. The first frame is a clear image, i.e., the standard image. Then the target image is the second frame. If the target image is any frame, then the standard image is the image that is closest to the target image in the history before the target image and whose detection result is clear.

[0034] The calculation of the blur probability of the target image based on the difference image includes: counting the number of non-zero pixels in the difference image, calculating the ratio of the total number of pixels in the difference image to the number of non-zero pixels, and using the result of negative correlation mapping of the ratio as the blur probability.

[0035] When the proportion of non-zero pixels in a difference image is high, it means that there are more variations or irregularities in the image, which usually indicates that the image may be blurry or noisy.

[0036] In another embodiment, the blur probability further includes: dividing the difference image into grids to obtain several sub-regions, and counting the number of non-zero pixels in each sub-region.

[0037] Fuzzy probabilities satisfy the following relationship: , Represents fuzzy probability. Subregion The number of non-zero pixels in the middle. This represents the average number of non-zero pixels in the sub-region. This represents the total number of sub-regions. This represents an exponential function.

[0038] By exponentializing the difference between the number of non-zero pixels in each sub-region and the mean of that region, the non-uniformity of pixel distribution between regions is emphasized. This helps to highlight significant areas of change in the image and suppress the effects of noise. In this way, the ability to capture details in image processing can be improved, especially in the identification of changing regions, thereby enhancing the accuracy and robustness of image analysis in practical applications.

[0039] S2, perform edge detection on the target image to obtain edge pixels, and calculate the importance of the edge pixels based on the edge pixels and the difference image.

[0040] It's important to note that the primary purpose of edge detection is to identify and locate regions in an image where there are significant changes in grayscale or color—the image's "edges." These edges typically correspond to the contours of objects or structures within the image, or transitions between different regions; they are often the locations of important information in the image. Edge detection allows us to extract the most representative and meaningful parts of an image, which is crucial for subsequent image analysis and understanding.

[0041] Edge detection can suppress noise in images because edges typically correspond to prominent, real-world structures, while noise usually manifests as subtle and irregular variations. Edge detection allows us to focus our attention on these meaningful regions, reducing interference from irrelevant information and thus improving the accuracy and efficiency of image analysis.

[0042] In one embodiment, the importance includes: for any edge pixel, calculating the gradient value of the edge pixel.

[0043] Importance satisfies the following relation: , Indicates the position is the Line 1 The importance of edge pixels in a column Indicates the position is the Line 1 Gradient values ​​of edge pixels in the column. It is a vector function. In the difference image, the first... Line 1 Column pixel values, This represents a fuzzy probability.

[0044] when When the value is not zero, it indicates that the target image has changed compared to the standard image. The overall value is 1; when When the value is zero, it indicates that the target image has not changed compared to the standard image. The overall value is 0.

[0045] The fact that the difference value of a pixel in the difference image between the target image and the standard image is not zero does not necessarily mean that the pixel is more important. Therefore, the probability of image blurring is calculated. The higher the probability of image blurring, the lower the importance of the pixel.

[0046] In another embodiment, importance also includes:

[0047] For any edge pixel, calculate the sum of the differences between the edge pixel value and the pixel values ​​of its 8 neighboring pixels.

[0048] Importance satisfies the following relation: , Indicates the position is the Line 1 The importance of edge pixels in a column Indicates the position is the Line 1 The cumulative difference of the edge pixels of the column. It is a vector function. In the difference image, the first... Line 1 Column pixel values, This represents a fuzzy probability.

[0049] S3: After weighting each pixel in the target image, the target image is converted into a sequence. The similarity between the sequence of the target image and the sequence of the standard image is calculated. When the similarity is not less than a preset threshold, the target image is used as the updated standard image, and the sharpness recognition is continued.

[0050] In one embodiment, the weight of non-edge pixels in the target image is set to 1, and the sum of 1 and importance is used as the weight of edge pixels in the target image; the weight of each pixel in the target image is obtained by traversing the image to obtain the weighted target image.

[0051] Similarity satisfies the following relation:

[0052] , Sequence representing the target image and a sequence of standard images Similarity, Sequence representing the target image The mean, Sequences representing standard images The mean, Represents a sequence and sequence covariance, and Representing sequences respectively and sequence variance and These are two stability constants.

[0053] , ,in This indicates the range of pixel values ​​in the image. For example, , .

[0054] The greater the similarity between two images, the lower the probability that one image is blurry and the other is clear. In other words, the two images are clearer because the detection result of the standard image is clear. When the similarity between two images is low, it means that one image is blurry and the other is not blurry, that is, the target image is blurry.

[0055] If the similarity is not less than a preset threshold, the target image is used as the updated standard image, and sharpness recognition continues.

[0056] This invention also discloses an edge-detection-based image sharpness recognition system, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the edge-detection-based image sharpness recognition method according to this invention.

[0057] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

[0058] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device.

[0059] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.

[0060] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for image sharpness recognition based on edge detection, characterized in that, include: The preprocessed target image is obtained, which is the current image to be tested. The target image is then compared with the standard image to obtain a difference image. The blur probability of the target image is calculated based on the difference image. Edge detection is performed on the target image to obtain edge pixels, and the importance of the edge pixels is calculated based on the edge pixels and the difference image. After weighting each pixel in the target image, the target image is converted into a sequence. The similarity between the sequence of the target image and the sequence of the standard image is calculated. When the similarity is not less than a preset threshold, the target image is used as the updated standard image, and the sharpness recognition continues. Similarity satisfies the following relation: , Sequence representing the target image and a sequence of standard images Similarity, Sequence representing the target image The mean, Sequences representing standard images The mean, Represents a sequence and sequence covariance, and Representing sequences respectively and sequence variance and These are two stability constants; Weighting each pixel in the target image includes: setting the weight of non-edge pixels in the target image to 1, and using the sum of 1 and importance as the weight of edge pixels in the target image; Iterate through the target image to obtain the weight of each pixel, and obtain the weighted target image.

2. The image sharpness recognition method based on edge detection according to claim 1, characterized in that, The preprocessing includes: The target image is denoised using Gaussian filtering, its brightness distribution is improved using histogram equalization, and its edge information is enhanced using an edge enhancement algorithm.

3. The image sharpness recognition method based on edge detection according to claim 1, characterized in that, The fuzzy probability includes: The number of non-zero pixels in the difference image is counted, and the ratio of the total number of pixels in the difference image to the number of non-zero pixels is calculated. The result of the negative correlation mapping of the ratio is used as the fuzzy probability.

4. The image sharpness recognition method based on edge detection according to claim 1, characterized in that, The fuzzy probability also includes: Divide the difference image into several sub-regions by gridding, and count the number of non-zero pixels in each sub-region; Fuzzy probabilities satisfy the following relationship: , Represents fuzzy probability. Subregion The number of non-zero pixels in the middle. This represents the average number of non-zero pixels in the sub-region. This represents the total number of sub-regions. This represents an exponential function.

5. The image sharpness recognition method based on edge detection according to claim 1, characterized in that, The importance mentioned includes: For any edge pixel, calculate the gradient value of the edge pixel; Importance satisfies the following relation: , Indicates the position is the Line 1 The importance of edge pixels in a column Indicates the position is the Line 1 Gradient values ​​of edge pixels in the column. It is a vector function. In the difference image, the first... Line 1 Column pixel values, This represents a fuzzy probability.

6. The image sharpness recognition method based on edge detection according to claim 1, characterized in that, The importance also includes: For any edge pixel, calculate the sum of the differences between the edge pixel value and the pixel values ​​of its 8 neighboring pixels; Importance satisfies the following relation: , Indicates the position is the Line 1 The importance of edge pixels in a column Indicates the position is the Line 1 The cumulative difference of the edge pixels of the column. It is a vector function. In the difference image, the first... Line 1 Column pixel values, This represents a fuzzy probability.

7. A photographic sharpness recognition system based on edge detection, characterized in that, include: Processor; and A memory storing computer instructions that, when executed by a processor, cause the system to perform the edge detection-based image sharpness recognition method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Monitoring image blurring abnormity identification method and device

    CN104394377A

  • Image definition determining method and device

    CN110827254A

  • Saturated image deblurring method based on nonlinear degradation model

    CN111047544A