Image clarity detection method, device, electronic device and storage medium

By extracting image edge information, acquiring feature points, blurring processing and calculating edge statistical feature similarity, the problem of low image clarity detection accuracy in the prior art is solved, and higher detection accuracy and fewer false alarms and missed reports are achieved.

CN114511583BActive Publication Date: 2025-03-18ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111574421.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2025-03-18
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In the prior art, the accuracy of image clarity detection is low, and there are problems of false alarms and missed alarms.

Method used

By extracting edge information of the target image to be detected, in response to the edge information satisfying the preset conditions, the feature points of the target image are acquired, and the target image is blurred to obtain the target blur image. Then, the edge statistical features of the target image and the target blur image are calculated based on the feature points, and the sharpness of the image is obtained by the similarity calculation.

Benefits of technology

The accuracy of image clarity detection is improved, false alarms and missed reports are reduced, and the evaluation of the similarity of edge statistical feature between the target image and the blurred image is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114511583B_ABST
    Figure CN114511583B_ABST
Patent Text Reader

Abstract

The present application relates to an image clarity detection method, device, electronic device and storage medium, wherein the image clarity detection method extracts edge information of a target image to be detected, obtains feature points of the target image based on the edge information in response to the edge information satisfying a preset edge condition, and performs blurring processing on the target image to obtain a target blurred image, obtains a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the feature points, and obtains the clarity of the target image based on the similarity between the first edge statistical feature and the second edge statistical feature. It uses the similarity of the edge statistical features between the target image and the blurred image as an evaluation of the clarity of the target image, thereby avoiding the influence of the content of the target image itself on the clarity detection and improving the accuracy of the image clarity detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image clarity detection method, device, electronic device and storage medium. Background Art

[0002] With the rapid growth of the security market, the detection of the clarity of video surveillance images plays an important role in the normal operation of video surveillance. At present, the detection of the clarity of video surveillance images is often based on the analysis of the collected image content. For example, a clarity evaluation model is established based on the mean and maximum values ​​of the normalized image, or a clarity evaluation model is established based on the excessive width of the image edge. In the above method, the clarity detection result is greatly affected by the content of the image itself, so there are false positives and false negatives in the detection, and the accuracy is low.

[0003] With regard to the problem of low accuracy in image clarity detection in related technologies, no effective solution has been proposed so far. Summary of the invention

[0004] In this embodiment, a method, device, electronic device and storage medium for detecting image clarity are provided to solve the problem of low accuracy of image clarity detection in the related art.

[0005] In a first aspect, an image clarity detection method is provided in this embodiment, comprising:

[0006] Extract edge information of the target image to be detected;

[0007] In response to the edge information satisfying a preset edge condition, obtaining feature points of the target image based on the edge information, and performing blurring processing on the target image to obtain a target blurred image;

[0008] Based on the feature points, obtaining a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image;

[0009] The definition of the target image is obtained according to the similarity between the first edge statistical feature and the second edge statistical feature.

[0010] In some embodiments, extracting edge information of the target image to be detected includes:

[0011] The target image is processed according to a preset edge information extraction operator, and the obtained edge feature map is determined as the edge information of the target image.

[0012] In some embodiments, obtaining feature points of the target image based on the edge information includes:

[0013] Obtaining a sharp point of the target image according to the local statistical information of the edge information and a preset first eigenvalue threshold;

[0014] In response to the number of the sharp points being greater than a preset first number threshold, the sharp points are used as feature points of the target image.

[0015] In some of the embodiments, it also includes:

[0016] In response to the number of the sharp points being less than the first number threshold, obtaining strong edge points of the target image according to the edge information and a preset second eigenvalue threshold;

[0017] In response to the number of the strong edge points being greater than a preset second number threshold, the strong edge points are used as feature points of the target image.

[0018] In some embodiments, obtaining the first edge statistical feature of the target image and the second edge statistical feature of the target blurred image based on the feature points includes:

[0019] Based on the feature points, a feature point width histogram of the target image is calculated to obtain a first edge statistical feature of the target image;

[0020] Based on the feature points, a feature point width histogram of the target blurred image is calculated to obtain a second edge statistical feature of the target blurred image.

[0021] In some embodiments, calculating a feature point width histogram of the target image based on the feature points includes:

[0022] Calculating the extreme value of the feature point within the preset range according to the brightness feature change value of the target image within the preset range of the feature point;

[0023] Obtaining a feature point width according to a distance between the extreme point and the feature point in the target image;

[0024] The widths of the feature points in the target image are counted to obtain a histogram of the feature point widths of the target image.

[0025] In some embodiments, obtaining the definition of the target image according to the similarity between the first edge statistical feature and the second edge statistical feature includes:

[0026] Calculating the similarity between the first edge statistical feature and the second edge statistical feature;

[0027] The similarity is mapped according to a preset mapping function to obtain the clarity of the target image.

[0028] In some of the embodiments, after extracting edge information of the target image to be detected, the method further includes:

[0029] In the case that the edge information does not satisfy a preset edge condition, the clarity of the target image is set to a preset clarity abnormality value.

[0030] In a second aspect, an image clarity detection device is provided in this embodiment, comprising: an extraction module, a feature acquisition module, a statistics module, and a clarity calculation module; wherein:

[0031] The extraction module is used to extract edge information of the target image to be detected;

[0032] The feature acquisition module is used for obtaining feature points of the target image based on the edge information in response to the edge information satisfying a preset edge condition, and performing blur processing on the target image to obtain a target blurred image;

[0033] The statistical module is used to obtain a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the feature points;

[0034] The clarity calculation module is used to obtain the clarity of the target image according to the similarity between the first edge statistical feature and the second edge statistical feature.

[0035] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image clarity detection method described in the first aspect when executing the computer program.

[0036] In a fourth aspect, in this embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the image clarity detection method described in the first aspect is implemented.

[0037] The present embodiment provides an image clarity detection method, device, electronic device and storage medium, wherein the image clarity detection method extracts edge information of a target image to be detected, obtains feature points of the target image based on the edge information in response to the edge information satisfying a preset edge condition, and performs blurring processing on the target image to obtain a target blurred image, obtains a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the feature points, and obtains the clarity of the target image based on the similarity between the first edge statistical feature and the second edge statistical feature. It uses the similarity of the edge statistical features between the target image and the blurred image as an evaluation of the clarity of the target image, thereby avoiding the influence of the content of the target image itself on the clarity detection and improving the accuracy of the image clarity detection.

[0038] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0040] Figure 1 is a hardware structure block diagram of a terminal of the image definition detection method of this embodiment;

[0041] Figure 2 is a flow chart of the image clarity detection method of this embodiment;

[0042] Figure 3 is a schematic diagram of a 5×5 Gaussian filter template provided in this embodiment;

[0043] Figure 4a is a video frame image A provided in this embodiment;

[0044] Figure 4b is the sobel feature map of the video frame image A in this embodiment;

[0045] Figure 4c is the sobel feature map after the video frame image A is blurred in this embodiment;

[0046] Figure 4d is a histogram of feature point widths corresponding to the video image A in this embodiment;

[0047] Figure 4e is a feature point width histogram corresponding to the video frame image A after blurring in this embodiment;

[0048] Figure 5a is a video frame image B provided in this embodiment;

[0049] Figure 5b is the sobel feature map of the video frame image B in this embodiment;

[0050] Figure 5c is the sobel feature map after the video frame image B is blurred in this embodiment;

[0051] Figure 5d is a feature point width histogram corresponding to the video image B in this embodiment;

[0052] Figure 5e is a feature point width histogram corresponding to the video frame image B after blurring in this embodiment;

[0053] Figure 6 is a flow chart of the image clarity detection method of the preferred embodiment;

[0054] Figure 7 It is a structural block diagram of the image clarity detection device of this embodiment. DETAILED DESCRIPTION

[0055] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0056] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0057] The method embodiment provided in this embodiment can be executed in a terminal, a computer, a server or a similar computing device. The following description is based on the example of running on a terminal. Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the image definition detection method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0058] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image clarity detection method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0059] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0060] In this embodiment, a method for detecting image clarity is provided. Figure 2 is a flow chart of the image clarity detection method of this embodiment, such as Figure 2 As shown, the process includes the following steps:

[0061] Step S210: extract edge information of the target image to be detected.

[0062] Specifically, the target image may be derived from a frame of video data collected by a video device to be subjected to definition detection. When collecting the target image, in order to improve the definition detection result of the target image, the video image may be collected based on the YUV sampling format, and the Y channel image may be used as the target image. In addition, the video image may also be collected in other formats, such as RGB format, which is not specifically limited here.

[0063] Alternatively, the target image may be processed by an edge information extraction operator to obtain the edge information. For example, the edge information may be obtained by calculating the Sobel feature map of the target image using the edge detection Sobel operator. Alternatively, the target image may be processed by other edge information extraction operators, such as the Canny operator. The specific edge information extraction method may be determined in combination with the actual application scenario and is not specifically limited here.

[0064] Step S220 , in response to the edge information satisfying a preset edge condition, obtaining feature points of a target image based on the edge information, and performing blurring processing on the target image to obtain a target blurred image.

[0065] The preset edge condition may specifically include a feature value threshold in the edge information and a number threshold greater than the feature value threshold. For example, after extracting the Sobel feature map of the target image as the edge information of the target image, if the point P on the target image has a Sobel feature value I corresponding to it, sobel (P) is the maximum value of the Sobel eigenvalue within the neighborhood range, and is greater than the preset Sobel eigenvalue threshold T0, then the point P is taken as a sharp point of the target image. If the number of all sharp points on the target image is greater than the preset first quantity threshold, it can be determined that the edge information meets the preset edge condition, and the sharp point is taken as the feature point of the target image. Further, if the number of all sharp points on the target image is less than the preset second quantity threshold, it can be determined based on the preset Sobel eigenvalue threshold T1 whether there is a point in the target image with a Sobel eigenvalue greater than T1. If so, the point with a Sobel eigenvalue greater than T1 is taken as a strong edge point of the target image. In the case where the number of strong edge points is greater than the preset second quantity threshold, it can be determined that the edge information meets the preset edge condition, and the strong edge point is taken as the feature point of the target image. If the number of sharp points in the target image is less than the first quantity threshold, and the number of strong edge points is less than the second quantity threshold, it can be determined that the edge information does not meet the preset edge condition.

[0066] When the edge information satisfies the preset edge condition, the target image can be Gaussian blurred to obtain a target blurred image. Specifically, the target image can be set according to a preset Gaussian filter template. Figure 3 This is a schematic diagram of a 5×5 Gaussian filter template provided in this embodiment. In addition, other Gaussian filter templates may also be set according to actual application scenarios, which are not specifically limited here.

[0067] Additionally, when the edge information does not satisfy a preset edge condition, the definition of the target image may be set to a predetermined definition abnormality value.

[0068] Step S230: obtaining a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the feature points.

[0069] Specifically, based on the coordinates of the feature point in the target image, the brightness change information within the preset range of the feature point can be determined, and the brightness change information corresponding to all feature points can be counted, so as to obtain the first edge statistical feature of the target image; and based on the coordinates of the feature point in the target blurred image, the brightness change information of the feature point within the preset range in the target blurred image can be determined, so as to obtain the second edge statistical feature of the target blurred image. Further, based on the coordinates of the feature point in the target image, it can be determined whether there is a minimum brightness change point and a maximum brightness change point within the preset range of the feature point in the target image after the first-order derivative of the brightness value, and the width of the feature point is calculated according to the distance between the corresponding minimum point and / or maximum point and the feature point in the target image and the size of the preset range, and then the feature point width histogram of the target image can be obtained by statistics.

[0070] Step S240: Obtain the definition of the target image according to the similarity between the first edge statistical feature and the second edge statistical feature.

[0071] This embodiment compares the similarity between the target image and the blurred image obtained after blurring itself. The higher the clarity of the target image, the lower the similarity between it and the corresponding blurred image. Therefore, by calculating the similarity between the first edge statistical feature and the second edge statistical feature, the similarity between the target image and its blurred image in the edge statistical feature can be determined, and then the clarity of the target image can be determined based on the similarity. Specifically, the similarity can be processed based on a preset mapping function to obtain the clarity corresponding to the target image. By collecting the average clarity of several frames of images in the video data, and according to the preset clarity abnormality threshold, it is determined that the video data has clarity abnormality. If so, the relevant system is triggered to alarm or generate a prompt message.

[0072] In the above steps S210 to S240, by extracting edge information of the target image to be detected, in response to the edge information satisfying the preset edge condition, the feature points of the target image are obtained based on the edge information, and the target image is blurred to obtain a target blurred image, and based on the feature points, the first edge statistical feature of the target image and the second edge statistical feature of the target blurred image are obtained, and the clarity of the target image is obtained according to the similarity between the first edge statistical feature and the second edge statistical feature. The similarity of the edge statistical feature between the target image and the blurred image is used as the evaluation of the clarity of the target image, thereby avoiding the influence of the content of the target image itself on the clarity detection, and improving the accuracy of the image clarity detection.

[0073] Further, in one embodiment, based on the above step S220, edge information of the target image to be detected is extracted, which specifically includes the following steps:

[0074] Step S221, the target image is processed according to a preset edge information extraction operator, and the obtained edge feature map is determined as the edge information of the target image. The edge information extraction operator can be a sobel operator or a canny operator, or other operators for extracting edge information of an image. By extracting edge information of the target image and evaluating the clarity of the target image based on the edge information, the accuracy of the clarity detection result can be improved.

[0075] Additionally, in one embodiment, based on the above step S220, obtaining feature points of the target image based on edge information specifically includes the following steps:

[0076] Step S221, obtaining the sharp points of the target image according to the local statistical information of the edge information and a preset first eigenvalue threshold.

[0077] The local statistical information may be the maximum eigenvalue of the edge information within a preset range. For example, the maximum Sobel eigenvalue within each n×n neighborhood of the target image. Specifically, when the Sobel operator is used to extract the edge information of the target image, it can be determined that for any point P in the target image, the corresponding Sobel eigenvalue I sobel (P) is the maximum value within the preset neighborhood range and is greater than the first eigenvalue threshold. If so, the point P is taken as a sharp point of the target image. The process of obtaining a sharp point set in the target image is shown in the following formula.

[0078] S1={P|IsLocalMax(I sobel (P)), and I sobel (P)>T0} (1)

[0079] Among them, S1 represents the sharp point set, IsLocalMax(I sobel (P)) represents the local maximum value on the target image, and T0 is the first eigenvalue threshold.

[0080] Step S222, in response to the number of sharp points being greater than a preset first number threshold, the sharp points are used as feature points of the target image. Specifically, when the number of sharp points is greater than the preset first number threshold, it can be determined that the edge information of the target image meets the preset edge condition, and the sharp points can be used as feature points of the target image, thereby obtaining a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the sharp points.

[0081] In the above steps S221 to S222, the sharp points in the edge information are determined based on the feature value threshold and the feature point quantity threshold, and the first edge statistical features of the target image and the second edge statistical features of the target blurred image are obtained based on the sharp points, thereby improving the accuracy of the edge information statistics and further improving the accuracy of the subsequent clarity recognition results.

[0082] Additionally, in one embodiment, based on the above step S220, the above image clarity detection method may further include the following steps:

[0083] Step S223, in response to the number of sharp points being less than the first number threshold, strong edge points of the target image are obtained based on the edge information and the preset second eigenvalue threshold. Specifically, when the number of sharp points is less than the first number threshold, feature points whose eigenvalues ​​of edge information in the target image are greater than the preset second eigenvalue threshold are obtained as strong edge points of the target image. For example, all strong edge points based on the Sobel feature in the target image can be obtained according to the following formula.

[0084] S2={P|I sobel (P)>T1} (2)

[0085] Among them, S2 represents the set of strong edge points, I sobel (P) represents the Sobel eigenvalue corresponding to any point P in the target image, and T1 represents the second eigenvalue threshold.

[0086] Step S224: In response to the number of strong edge points being greater than a preset second number threshold, the strong edge points are used as feature points of the target image.

[0087] Additionally, if the number of strong edge points is less than a preset second number threshold, it can be determined that the edge information of the target image does not meet the preset edge condition, and thus the target image can be determined to be an image with abnormal clarity.

[0088] In the above steps S223 to S224, in response to the number of sharp points being less than a preset first quantity threshold, strong edge points in the target image are acquired, and in response to the number of strong edge points being greater than a preset second quantity threshold, the strong edge points are used as feature points, thereby obtaining the first edge statistical features of the target image and the second edge statistical features of the target blurred image based on the strong edge points, thereby improving the accuracy of clarity detection.

[0089] Additionally, in one embodiment, based on the above step S230, obtaining the first edge statistical feature of the target image and the second edge statistical feature of the target blurred image based on the feature points specifically includes the following steps:

[0090] Step S231, based on the feature points, calculate the feature point width histogram of the target image to obtain the first edge statistical feature of the target image.

[0091] Specifically, determine whether there are minimum points or maximum points of brightness change in the target image within the preset range of feature points. If there are minimum points and maximum points, the distance between the minimum points and the maximum points within the preset range on the target image can be calculated to obtain the feature point width. If only a minimum point exists, the feature point width is obtained based on the distance between the minimum point and the feature point on the target image and the width of the preset range. If only a maximum point exists, the feature point width is obtained based on the distance between the maximum point and the feature point on the target image and the width of the preset range. The feature point width corresponding to each feature point on the target image is counted to obtain a feature point width histogram of the target image, and then the first edge statistical feature of the target image is obtained. Similarly, based on the coordinates corresponding to the feature points on the target blurred image, the second edge statistical feature on the target blurred image can be obtained in the above-mentioned manner of solving the first edge statistical feature.

[0092] Step S232: Calculate a feature point width histogram of the target blurred image based on the feature points to obtain a second edge statistical feature of the target blurred image.

[0093] The above steps S231 and S232 calculate the feature point width histogram of the target image and the feature point width histogram of the target blurred image based on the feature points, thereby achieving accurate characterization of the edge information of the target image and the corresponding blurred image based on the feature point width histogram, thereby improving the accuracy of extracting image edge statistical features.

[0094] Further, in one embodiment, based on the above step S231, based on the feature points, calculating the feature point width histogram of the target image specifically includes the following steps:

[0095] Step S2311, calculating the extreme value points of the feature points within the preset range according to the brightness feature change value of the target image within the preset range of the feature points;

[0096] Step S2312, obtaining the feature point width according to the distance between the extreme point and the feature point in the target image;

[0097] Step S2313, counting the widths of feature points in the target image to obtain a histogram of feature point widths of the target image.

[0098] The specific feature point width calculation process is shown in the following formula.

[0099]

[0100] Among them, W is the width of the feature point; is_find_small is the mark of the minimum value point within the preset range of the feature point; is_find_big is the mark of the maximum value point within the preset range of the feature point; small_r is the distance between the minimum value point and the feature value point; big_r is the distance between the maximum value point and the feature value point; MaxR is the distance from the feature point to the boundary of the range within the preset range. By counting the feature point widths corresponding to all feature points in the target image, a feature point width histogram is obtained.

[0101] Additionally, in one embodiment, based on the above step S240, the definition of the target image is obtained according to the similarity between the first edge statistical feature and the second edge statistical feature, which specifically includes the following steps:

[0102] Step S241, calculating the similarity between the first edge statistical feature and the second edge statistical feature.

[0103] Specifically, the first edge statistical feature and the second edge statistical feature can be normalized to the same scale space, and the distance between the two can be calculated to obtain the similarity. Further, the similarity between the two values ​​can be calculated using correlation comparison, chi-square comparison, crossover, and Bhattacharyya distance. The specific similarity calculation method can be set according to the actual application scenario and is not specifically limited here.

[0104] Among them, taking Bhattacharyya distance as an example, the calculation process of obtaining the similarity Similar is shown in the following formula:

[0105]

[0106] Wherein, Similar is the similarity between the first edge statistical feature and the second edge statistical feature; H1 is the first edge statistical feature; H2 is the second edge statistical feature; and I is the target image.

[0107] Step S242, mapping the similarity according to a preset mapping function to obtain the clarity of the target image.

[0108] Exemplarily, the mapping function is shown as follows:

[0109]

[0110] Where Similar is the similarity between the first edge statistical feature and the second edge statistical feature; S min , S mid , S max There are three similarity thresholds, where the similarity Similar calculated in step S241 is less than or equal to S minWhen Similar is equal to S mid When Similar is greater than S, the clarity is mapped to 50; max When the definition is mapped to 100. For other values ​​of Similar, the above formula can be referred to for calculation, which will not be repeated here. In addition, the above mapping function is only an example provided in this embodiment, and the setting of the specific mapping function can be determined according to the actual application scenario.

[0111] Based on the above method, the clarity of each frame of the collected video data can be calculated, and the average of the clarity of several consecutive frames can be taken to determine whether the video data has a clarity abnormality problem. For example, the clarity of three consecutive frames can be taken. If the average of the clarity of the three consecutive frames is greater than the preset clarity abnormality threshold, it can be determined that the video data has a clarity abnormality, thereby triggering the relevant system to issue an alarm or message prompt.

[0112] In the above steps S241 to S242, the similarity is mapped by a preset mapping function to obtain the definition of the target image, thereby avoiding definition detection based on the content of the image itself, thereby improving the accuracy of image definition detection.

[0113] Additionally, in one embodiment, after extracting edge information of the target image to be detected, the above-mentioned image clarity detection method further includes the following steps:

[0114] Step S250: When the edge information does not meet the preset edge condition, the definition of the target image is set to a preset definition abnormality value. For example, when the definition abnormality threshold is 50, the definition of the target image can be set to 100.

[0115] In one embodiment, Figure 4a A is a relatively clear video frame image; Figure 4b The Sobel feature map is obtained after the video frame image A is processed by the Sobel operator; Figure 4c After blurring the video frame image A, the Sobel feature map is extracted. Figure 4d is a feature point width histogram corresponding to the video frame image A calculated based on the above steps; Figure 4e is the feature point width histogram of the blurred image corresponding to the video frame image A calculated based on the above steps. Figure 4d and Figure 4e It can be seen that for an image with higher definition, the similarity between it and the blurred image obtained after blurring itself in the feature point width histogram is lower.

[0116] Additionally, in one embodiment, Figure 5a is a relatively blurred video frame image B; Figure 5b The Sobel feature map is obtained after the video frame image B is processed by the Sobel operator; Figure 5c After blurring the video frame image B, the Sobel feature map is extracted. Figure 5d is a feature point width histogram corresponding to the video frame image B calculated based on the above steps; Figure 5e is the feature point width histogram of the blurred image corresponding to the video frame image B calculated based on the above steps. Figure 5d and Figure 5e It can be seen that for a relatively blurred image, its similarity with the blurred image obtained after blurring itself in the feature point width histogram is relatively high.

[0117] The present embodiment is described and illustrated below through preferred embodiments.

[0118] Figure 6 FIG. 1 is a flow chart of the image clarity detection method of the preferred embodiment. Figure 6 As shown, the image clarity detection method includes the following steps:

[0119] Step S601, inputting the current video frame image;

[0120] Step S602, calculating a sharp point coordinate set in the current video frame image and the number m of the sharp point coordinates, and updating the feature points of the current frame image to sharp points;

[0121] Step S603, determining whether the number of sharp points m is less than a first number threshold thresh1; if so, executing step S604, otherwise, executing step S606;

[0122] Step S604, calculating a set of strong edge point coordinates in the current video frame image, that is, the number n of the strong edge point coordinates, and updating the feature points of the current frame image to strong edge points;

[0123] Step S605, determining whether the number n of strong edge points is greater than a second quantity threshold thresh2; if so, executing step S606, otherwise, executing step S609;

[0124] Step S606, performing Gaussian blur on the current video frame image to obtain a blurred image of the current video frame;

[0125] Step S607, calculating a feature point width histogram of the current frame video image and the current video frame blurred image;

[0126] Step S608, calculating the clarity of the current frame video image according to the similarity between the feature point width histogram of the current frame video image and the blurred image of the current frame video;

[0127] Step S609, setting the definition of the current frame video image to a preset definition abnormality value;

[0128] Step S610, outputting the definition of the current video frame image.

[0129] In this embodiment, an image clarity detection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0130] Figure 7 is a structural block diagram of the image clarity detection device 70 of this embodiment, as shown in Figure 7 As shown, the image definition detection device 70 includes: an extraction module 72, a feature acquisition module 74, a statistics module 76, and a definition calculation module 78; wherein:

[0131] An extraction module 72, used to extract edge information of the target image to be detected;

[0132] A feature acquisition module 74 is used to obtain feature points of a target image based on the edge information in response to the edge information satisfying a preset edge condition, and to perform blur processing on the target image to obtain a target blurred image;

[0133] A statistical module 76, used for obtaining a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the feature points;

[0134] The clarity calculation module 78 is used to obtain the clarity of the target image according to the similarity between the first edge statistical feature and the second edge statistical feature.

[0135] The image clarity detection device 70 extracts edge information of the target image to be detected, obtains feature points of the target image based on the edge information in response to the edge information satisfying a preset edge condition, and performs blurring processing on the target image to obtain a target blurred image, obtains a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the feature points, and obtains the clarity of the target image based on the similarity between the first edge statistical feature and the second edge statistical feature. It uses the similarity of the edge statistical features between the target image and the blurred image as an evaluation of the clarity of the target image, thereby avoiding the influence of the target image content itself on the clarity detection, and improving the accuracy of the image clarity detection.

[0136] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0137] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0138] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0139] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0140] Extract edge information of the target image to be detected;

[0141] In response to the edge information satisfying a preset edge condition, characteristic points of a target image are obtained based on the edge information, and the target image is blurred to obtain a target blurred image;

[0142] Based on the feature points, a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image are obtained;

[0143] The definition of the target image is obtained according to the similarity between the first edge statistical feature and the second edge statistical feature.

[0144] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0145] In addition, in combination with the image clarity detection method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the image clarity detection methods in the above embodiments is implemented.

[0146] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0147] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0148] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0149] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A method for detecting image clarity, characterized in that: include: Extract edge information of the target image to be detected; In response to the edge information satisfying a preset edge condition, obtaining feature points of the target image based on the edge information, and performing blurring processing on the target image to obtain a target blurred image; Based on the feature points, obtaining a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image; The first edge statistical feature is obtained by statistically analyzing the brightness change information of the feature point within a preset range in the target image; the second edge statistical feature is obtained by statistically analyzing the brightness change information of the feature point within a preset range in the target blurred image; Obtaining the clarity of the target image according to the similarity between the first edge statistical feature and the second edge statistical feature; wherein obtaining the feature points of the target image based on the edge information includes: Obtaining a sharp point of the target image according to the local statistical information of the edge information and a preset first eigenvalue threshold; In response to the number of the sharp points being greater than a preset first number threshold, taking the sharp points as feature points of the target image; In response to the number of the sharp points being less than the first number threshold, obtaining strong edge points of the target image according to the edge information and a preset second eigenvalue threshold; In response to the number of the strong edge points being greater than a preset second number threshold, the strong edge points are used as feature points of the target image.

2. The image clarity detection method according to claim 1, characterized in that: The step of extracting edge information of the target image to be detected includes: The target image is processed according to a preset edge information extraction operator, and the obtained edge feature map is determined as the edge information of the target image.

3. The image clarity detection method according to claim 1, characterized in that: The step of obtaining a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the feature points includes: Based on the feature points, a feature point width histogram of the target image is calculated to obtain a first edge statistical feature of the target image; Based on the feature points, a feature point width histogram of the target blurred image is calculated to obtain a second edge statistical feature of the target blurred image.

4. The image clarity detection method according to claim 3, characterized in that: The calculating, based on the feature points, a feature point width histogram of the target image comprises: Calculating the extreme value of the feature point within the preset range according to the brightness feature change value of the target image within the preset range of the feature point; Obtaining a feature point width according to a distance between the extreme point and the feature point in the target image; The widths of the feature points in the target image are counted to obtain a histogram of the feature point widths of the target image.

5. The image clarity detection method according to claim 1, characterized in that: The obtaining the definition of the target image according to the similarity between the first edge statistical feature and the second edge statistical feature includes: Calculating the similarity between the first edge statistical feature and the second edge statistical feature; The similarity is mapped according to a preset mapping function to obtain the clarity of the target image.

6. The image clarity detection method according to any one of claims 1 to 5, characterized in that: After extracting the edge information of the target image to be detected, it also includes: In the case that the edge information does not satisfy a preset edge condition, the clarity of the target image is set to a preset clarity abnormality value.

7. An image clarity detection device, characterized in that: include: Extraction module, feature acquisition module, statistics module, and clarity calculation module; wherein: The extraction module is used to extract edge information of the target image to be detected; The feature acquisition module is used for obtaining feature points of the target image based on the edge information in response to the edge information satisfying a preset edge condition, and performing blur processing on the target image to obtain a target blurred image; The statistical module is used to obtain a first edge statistical feature of the target image and a second edge statistical feature of the target blurred image based on the feature points; the first edge statistical feature is obtained by statistically analyzing brightness change information of the feature points within a preset range in the target image; the second edge statistical feature is obtained by statistically analyzing brightness change information of the feature points within a preset range in the target blurred image; The clarity calculation module is used to obtain the clarity of the target image according to the similarity between the first edge statistical feature and the second edge statistical feature; wherein obtaining the feature points of the target image based on the edge information includes: Obtaining a sharp point of the target image according to the local statistical information of the edge information and a preset first eigenvalue threshold; In response to the number of the sharp points being greater than a preset first number threshold, taking the sharp points as feature points of the target image; In response to the number of the sharp points being less than the first number threshold, obtaining strong edge points of the target image according to the edge information and a preset second eigenvalue threshold; In response to the number of the strong edge points being greater than a preset second number threshold, the strong edge points are used as feature points of the target image.

8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the image clarity detection method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image clarity detection method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and device for detecting image definition

    CN103093419A

  • Image definition determining method and device

    CN110827254A