Equipment out-of-focus identification method and device, electronic equipment and storage medium
By performing local clarity calculations on the image to be processed by the monitoring device and comprehensive analysis of the clarity of the object detection box, intelligent automatic recognition of the out-of-focus of the monitoring device is realized, solving the problems of inefficiency and strong subjectivity in the prior art.
Patent Information
- Application Number
- CN202310965186.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-01
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, monitoring equipment out of focus requires manual review of pictures or screening of images, resulting in inefficient and highly subjective.
By acquiring the image to be processed by the target device, local definition calculation is performed using a preset definition algorithm, and comprehensive analysis is performed in combination with the clarity of the target detection box to automatically identify whether the monitoring device is out of focus.
A fully intelligent automatic identification method of whether the monitoring device is out of focus is realized, which improves the efficiency of the monitoring device's out of focus detection and reduces the need for manual review.
Smart Images

Figure CN119450208A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent recognition technology, and in particular to a method, device, electronic device and storage medium for identifying device out-of-focus. Background Art
[0002] As people's safety awareness becomes increasingly stronger and the need for monitoring social security increases, the demand for monitoring equipment has greatly increased. Monitoring equipment will monitor the deployed area 24 hours a day, but the increasing monitoring time will cause the monitoring equipment to be out of focus, resulting in unclear monitoring images, which will affect the quality of snapshots or captured images when obtaining monitoring images. The existing method of identifying whether the monitoring equipment is out of focus is often through manual review of pictures or manual screening of images. Manual review and screening will lead to low efficiency and strong subjectivity. Therefore, how to provide a method for intelligent automatic identification of whether the monitoring equipment is out of focus has become a problem to be solved urgently. Summary of the invention
[0003] The embodiment of the present invention provides a method for identifying whether a monitoring device is out of focus, aiming to provide a method for fully intelligent and automatic identification of whether a monitoring device is out of focus, so as to solve the problem of low efficiency and strong subjectivity caused by manual image review or manual image screening. Whether a monitoring device is out of focus is determined by comprehensively analyzing and calculating the clarity of a target detection frame and multiple local sharpnesses, and the correlation coefficient relationship between multiple local sharpnesses and the clarity of a target detection frame is fully considered, thereby realizing automatic identification of whether a monitoring device is out of focus with high efficiency.
[0004] In a first aspect, an embodiment of the present invention provides a method for identifying a device out-of-focus state, the method comprising:
[0005] Acquire an image to be processed of a target device, wherein the image to be processed includes a target object;
[0006] Calculating the local clarity of the image to be processed by a preset clarity algorithm to obtain a plurality of local clarity corresponding to the image to be processed;
[0007] Performing target detection on the image to be processed to obtain a target detection frame corresponding to the target object;
[0008] Determining the clarity of the target detection frame according to a plurality of local clarity corresponding to the image to be processed;
[0009] Based on the local clarity and the clarity of the target detection frame, it is determined whether the target device is out of focus.
[0010] Optionally, the performing local definition calculation on the image to be processed by a preset definition algorithm to obtain a plurality of local definitions corresponding to the image to be processed includes:
[0011] Performing region division processing on the image to be processed to obtain a plurality of first image blocks;
[0012] Calculating the clarity of each of the first image blocks by using a preset clarity algorithm to obtain a first clarity corresponding to each of the first image blocks;
[0013] Based on the first sharpness corresponding to each of the first image blocks, a plurality of local sharpnesses corresponding to the image to be processed are determined.
[0014] Optionally, the determining, based on the first sharpness corresponding to each of the first image blocks, a plurality of local sharpnesses corresponding to the image to be processed includes:
[0015] Performing region division processing on the first image block whose first definition is less than a first definition threshold to obtain a plurality of second image blocks;
[0016] Calculating the clarity of each of the second image blocks by using a preset clarity algorithm to obtain a second clarity corresponding to each of the second image blocks;
[0017] Based on the second definition and the first definition that is greater than or equal to the first definition threshold, a plurality of local definitions corresponding to the image to be processed are determined.
[0018] Optionally, the performing definition calculation according to the first image block of the image to be processed to obtain a first definition of the first image block includes:
[0019] Determining a first decomposition level of the first image block, and performing decomposition processing on the first image block based on the first decomposition level to obtain a first high-frequency sub-band and a first low-frequency sub-band of the first image block;
[0020] Decomposing the first low-frequency sub-band based on the second decomposition level to obtain a second high-frequency sub-band and a second low-frequency sub-band of the first image block;
[0021] A first definition of the first image block is determined based on the first high frequency sub-band and the second high frequency sub-band.
[0022] Optionally, determining the first definition of the image block based on the first high frequency sub-band and the second high frequency sub-band includes:
[0023] determining a first wavelet coefficient of the first high frequency sub-band, and determining a second wavelet coefficient of the second high frequency sub-band;
[0024] A first definition of the first image block is determined according to the first wavelet coefficient and the second wavelet coefficient.
[0025] Optionally, determining the clarity of the target detection frame according to a plurality of local clarity corresponding to the image to be processed includes:
[0026] Determining the clarity of each pixel in the image to be processed according to a plurality of local clarity corresponding to the image to be processed;
[0027] The clarity of each pixel in the target detection frame is determined according to the clarity of each pixel in the image to be processed.
[0028] Optionally, determining whether the target device is out of focus based on the local clarity and the clarity of the target detection frame includes:
[0029] Determine a first clarity matrix corresponding to the image to be processed based on the clarity of each pixel in the image to be processed, and determine a second clarity matrix corresponding to the target detection frame based on the clarity of each pixel in the target detection frame;
[0030] Whether the target device is out of focus is determined based on a correlation coefficient between the first clarity matrix and the second clarity matrix.
[0031] In a second aspect, an embodiment of the present invention further provides a device for identifying out-of-focus of a device, the device for identifying out-of-focus of a device comprising:
[0032] A first acquisition module is used to acquire an image to be processed of a target device, wherein the image to be processed includes a target object;
[0033] A first calculation module, configured to perform local definition calculation on the image to be processed by using a preset definition algorithm to obtain a plurality of local definitions corresponding to the image to be processed;
[0034] A first detection module, used to perform target detection on the image to be processed to obtain a target detection frame corresponding to the target object;
[0035] A first determination module, configured to determine the clarity of the target detection frame according to a plurality of local clarity corresponding to the image to be processed;
[0036] The second determination module is used to determine whether the target device is out of focus based on the local clarity and the clarity of the target detection frame.
[0037] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the device out-of-focus identification method provided in an embodiment of the present invention when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the device out-of-focus identification method provided in the embodiment of the invention are implemented.
[0039] In an embodiment of the present invention, an image to be processed of a target device is obtained, the image to be processed includes a target object; local clarity calculation is performed on the image to be processed by a preset clarity algorithm to obtain multiple local clarity corresponding to the image to be processed; target detection is performed on the image to be processed to obtain a target detection frame corresponding to the target object; the clarity of the target detection frame is determined according to the multiple local clarity corresponding to the image to be processed; based on the local clarity and the clarity of the target detection frame, it is determined whether the target device is out of focus. Whether the monitoring device is out of focus is determined by comprehensively analyzing and calculating the clarity of the target detection frame and the multiple local clarity, and the correlation coefficient relationship between the multiple local clarity and the clarity of the target detection frame is fully considered, thereby realizing automatic identification of whether the monitoring device is out of focus, and improving the out-of-focus detection efficiency of the monitoring device. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 is a method flow chart of a method for identifying device out-of-focus provided by an embodiment of the present invention;
[0042] Figure 2 is a schematic diagram of an image segmentation method provided by an embodiment of the present invention;
[0043] Figure 3 is a schematic diagram of a correlation coefficient provided by an embodiment of the present invention;
[0044] Figure 4 is a method flow chart of another device out-of-focus recognition method provided by an embodiment of the present invention;
[0045] Figure 5 is a schematic diagram of the structure of a device out-of-focus recognition device provided by an embodiment of the present invention;
[0046] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] like Figure 1 As shown, Figure 1 : is a method flow chart of a device out-of-focus recognition method provided by an embodiment of the present invention. The device out-of-focus recognition method comprises the steps of:
[0049] 101. Obtain an image to be processed from a target device.
[0050] In an embodiment of the present invention, the above-mentioned device out-of-focus identification method can be deployed to a device management platform. The above-mentioned device management platform can be a server or server cluster with functions such as image recognition, image analysis, image processing, image storage, and data transmission. The above-mentioned target device can be any image acquisition device. The above-mentioned any image acquisition device can be an electronic device with integrated functions such as image acquisition, image recognition, image storage, and data transmission. The above-mentioned image to be processed can be any image or any image sequence acquired by the above-mentioned target device through the above-mentioned image acquisition function.
[0051] The above-mentioned image to be processed includes a target object. The above-mentioned target object can be any target collected by the above-mentioned target device when collecting. The above-mentioned any target can be any dynamic target or any static target collected by the above-mentioned target device when collecting. The above-mentioned dynamic target can be a walking person, a walking animal, a moving vehicle, a running mechanical equipment, a running animal, a flying animal and other targets. The above-mentioned static target can be a plant, a building, a stationary person, a stationary animal, a stationary vehicle and other targets. When the above-mentioned target device performs image collection, the target included in the image or image sequence collected during the above-mentioned collection is used as the target object.
[0052] In a possible embodiment, when the above-mentioned device management platform needs to obtain the out-of-focus state of the above-mentioned target device, the image acquired by the above-mentioned target device through the above-mentioned acquisition function is acquired through a data transmission protocol, and the above-mentioned image is used as the above-mentioned image to be processed. The above-mentioned image to be processed includes the above-mentioned target object, and the above-mentioned data transmission protocol can be FTP (File Transfer Protocol), HTTP (Hypertext Transfer Protocol), or SFTP (Secure File Transfer Protocol).
[0053] In another possible embodiment, when the device management platform needs to obtain the out-of-focus state of the target device, the device management platform sends a request for obtaining the image to be processed to the target device through the data transmission protocol. After receiving the request for obtaining the image to be processed, the target device acquires an image through the image acquisition function to obtain the acquired image. The acquired image is subjected to image recognition detection to detect whether the acquired image contains the target object. If the acquired image does not contain the target object, the image is acquired again. If the acquired image contains the target object, the acquired image is sent to the device management platform through the data transmission protocol.
[0054] 102. Perform local clarity calculation on the image to be processed by using a preset clarity algorithm to obtain multiple local clarity corresponding to the image to be processed.
[0055] In an embodiment of the present invention, the above-mentioned preset clarity algorithm can be based on the texture feature extraction of the above-mentioned image to be processed to obtain texture feature information, and the above-mentioned clarity algorithm is determined by the above-mentioned texture feature information. The above-mentioned texture feature extraction can be determined by a grayscale gradient operator of the above-mentioned image to be processed. The above-mentioned grayscale gradient operator can be a Sobel operator, a Prewitt operator, or a Roberts operator, and the above-mentioned texture feature extraction is performed based on the above-mentioned grayscale gradient. The above-mentioned local clarity can be the clarity of any part of the above-mentioned image to be processed. The above-mentioned any part can be an area of any size and any shape of the above-mentioned image to be processed, which is not limited here. The above-mentioned multiple local clarity combinations can be the overall clarity of the above-mentioned image to be processed.
[0056] For example, when it is necessary to determine the above-mentioned texture feature information, the horizontal gradient, vertical gradient and focus direction gradient of the above-mentioned image to be processed are determined by the above-mentioned grayscale gradient operator, and the texture feature information of the horizontal gradient, the texture feature information of the vertical gradient and the texture feature information of the focus direction gradient of the above-mentioned image to be processed are determined based on the horizontal gradient, vertical gradient and focus direction gradient of the above-mentioned image to be processed.
[0057] Specifically, the texture feature information of the horizontal gradient can be obtained by performing histogram processing based on the horizontal gradient of the image to be processed according to the gradient histogram method, or the texture feature information of the horizontal gradient can be obtained by performing histogram processing based on the horizontal gradient of the image to be processed according to the directional gradient histogram method, or the texture feature information of the horizontal gradient can be obtained by performing binary comparison processing based on the horizontal gradient of the image to be processed according to the local binary pattern to obtain a binary code corresponding to the horizontal gradient, and the texture feature information of the horizontal gradient is determined according to the binary code. The number of horizontal textures of the image to be processed is determined based on the texture feature information of the horizontal gradient, and the horizontal texture weight factor of the image to be processed is determined according to the number of horizontal textures of the image to be processed.
[0058] The texture feature information of the vertical gradient can be obtained by performing histogram processing based on the vertical gradient of the image to be processed according to the gradient histogram method, or the texture feature information of the vertical gradient can be obtained by performing histogram processing based on the vertical gradient of the image to be processed according to the directional gradient histogram method, or the texture feature information of the vertical gradient can be obtained by performing binary comparison processing based on the local binary pattern based on the vertical gradient of the image to be processed to obtain a binary code corresponding to the vertical gradient, and the texture feature information of the vertical gradient is determined according to the binary code. The number of vertical textures of the image to be processed is determined based on the texture feature information of the vertical gradient, and the vertical texture weight factor of the image to be processed is determined according to the number of vertical textures of the image to be processed.
[0059] The texture feature information of the focus direction gradient can be obtained by performing histogram processing based on the focus direction gradient of the above-mentioned image to be processed according to the gradient histogram method, or the texture feature information of the focus direction gradient can be obtained by performing histogram processing based on the focus direction gradient of the above-mentioned image to be processed according to the directional gradient histogram method, or the texture feature information of the focus direction gradient can be obtained by performing binary comparison processing based on the focus direction gradient of the above-mentioned image to be processed according to the local binary pattern to obtain a binary code corresponding to the focus direction gradient, and determining the texture feature information of the focus direction gradient according to the binary code. The number of focus direction textures of the above-mentioned image to be processed is determined based on the texture feature information of the focus direction gradient, and the focus direction texture weight factor of the above-mentioned image to be processed is determined according to the number of focus direction textures of the above-mentioned image to be processed.
[0060] The preset clarity algorithm is determined based on the horizontal texture weight factor, the vertical texture weight factor and the focus direction texture weight factor. The local clarity of the image to be processed is calculated using the preset clarity algorithm to obtain multiple local clarity corresponding to the image to be processed.
[0061] Specifically, the horizontal gradient, vertical gradient and focus gradient can be calculated according to the following formula:
[0062]
[0063] Among them, the above h is the horizontal gradient, v is the vertical gradient, d is the focus direction gradient, f(x, y) is the grayscale value of the unit pixel in the above image to be processed, x is the horizontal coordinate of the unit pixel in the above image to be processed, and y is the vertical coordinate of the unit pixel in the above image to be processed.
[0064] The above-mentioned horizontal texture weight factor, vertical texture weight factor and focus direction texture weight factor can be calculated according to the following formula:
[0065]
[0066]
[0067]
[0068] Among them, the above P(h) is the above horizontal texture weight factor, the above P(v) is the above vertical texture weight factor, the above P(d) is the above focus direction texture weight factor, the above Nh is the number of horizontal textures, the above Nv is the number of vertical textures, and the above Nd is the number of focus direction textures.
[0069] 103. Perform target detection on the image to be processed to obtain a target detection frame corresponding to the target object.
[0070] In an embodiment of the present invention, the target detection may be performed on the image to be processed by a target detection algorithm to obtain a target detection frame corresponding to the target object in the image to be processed. The target detection algorithm may be an R-CNN (Regions with CNN features) algorithm, a Fast R-CNN algorithm, a YOLOv4 algorithm, an SSD (Single Shot MultiBox Detector) algorithm, a RetinaNet algorithm, or an EfficientDet algorithm. The target detection frame may be a circle of lines surrounding the target object. The lines may be lines of any color. The target detection frame may be formed by surrounding the outer periphery of the target object with the lines. The target detection frame may be a completely closed frame or a frame with a gap. The target detection frame may also be a frame of any shape, such as a square frame, a circular frame, or a frame of irregular shape. Specifically, the image to be processed is input into the target detection algorithm model, and detection processing is performed by the target detection algorithm model to obtain a target detection frame corresponding to the target object.
[0071] For example, after obtaining multiple local sharpnesses corresponding to the above-mentioned image to be processed, the above-mentioned image to be processed is subjected to image preprocessing, and the above-mentioned image preprocessing can be grayscale preprocessing, denoising preprocessing, and enhancement preprocessing to obtain the preprocessed image to be processed. The above-mentioned preprocessed image to be processed is input into the above-mentioned target detection algorithm model for detection processing to obtain the target detection box corresponding to the target object in the above-mentioned image to be processed.
[0072] In a possible embodiment, after obtaining multiple local sharpnesses corresponding to the above-mentioned image to be processed, the above-mentioned image to be processed is pre-processed into grayscale to obtain a grayscale image to be processed, the above-mentioned grayscale image to be processed is pre-processed for enhancement to obtain an enhanced image to be processed, the above-mentioned enhanced image to be processed is denoised to obtain a pre-processed image to be processed, the above-mentioned pre-processed image to be processed is input into the above-mentioned target detection algorithm model for detection processing, and the target detection box corresponding to the target object in the above-mentioned image to be processed is obtained.
[0073] 104. Determine the clarity of the target detection frame according to multiple local clarity corresponding to the image to be processed.
[0074] In an embodiment of the present invention, the clarity of the target detection frame may be the clarity within the target detection frame, the multiple local clarity may include multiple local coordinates, the multiple local coordinates may be based on the pixel position in the image to be processed, determine the image coordinate system of the image to be processed, and determine the multiple local coordinates based on the image coordinate system, and determine the coordinates of the target detection frame based on the image coordinate system, and determine the clarity of the target detection frame based on the coordinates of the target detection frame and the multiple local coordinates.
[0075] In a possible embodiment, after obtaining the target detection frame corresponding to the target object in the above-mentioned image to be processed, the image coordinate system corresponding to the above-mentioned image to be processed is determined based on the pixel points in the above-mentioned image to be processed, and multiple local coordinates corresponding to multiple local clearnesses in the above-mentioned image coordinate system are determined based on the above-mentioned image coordinate system. The coordinates of the target detection frame corresponding to the target object in the above-mentioned image coordinate system are determined based on the above-mentioned image coordinate system, and the coordinates of the target detection frame based on the coordinates of the above-mentioned target detection frame and the above-mentioned multiple local coordinates are used to determine the overlapping part with the above-mentioned multiple local coordinates, and the local clarity corresponding to the above-mentioned overlapping part is determined as the clarity of the above-mentioned target detection frame.
[0076] 105. Determine whether the target device is out of focus based on the local clarity and the clarity of the target detection frame.
[0077] In an embodiment of the present invention, the determination of whether the target device is out of focus based on the local clarity and the clarity of the target detection frame may be by determining a local clarity matrix corresponding to the local clarity based on the local clarity and the local coordinates, determining a clarity matrix of the target detection frame corresponding to the clarity of the target detection frame based on the clarity of the target detection frame and the coordinates of the target detection frame, and determining whether the target device is out of focus based on the ratio of the local clarity matrix to the clarity matrix of the target detection frame.
[0078] Specifically, after determining the clarity of the target detection frame, the local clarity matrix corresponding to the local clarity is determined according to the local clarity and the local coordinates, the clarity matrix of the target detection frame corresponding to the clarity of the target detection frame is determined according to the clarity of the target detection frame and the coordinates of the target detection frame, and the defocus threshold corresponding to the ratio is set according to the ratio of the local clarity matrix to the clarity matrix of the target detection frame. If the ratio is less than the defocus threshold, it is determined that the device is not out of focus, and if the ratio is greater than the defocus threshold, it is determined that the device is out of focus. It should be noted that the closer the ratio is to 1, the stronger the correlation between the local clarity matrix and the clarity matrix of the target detection frame, and the strong correlation indicates that the device is not out of focus. For example, the defocus threshold may be |2|, if the ratio of the local clarity matrix to the clarity matrix of the target detection frame is greater than |2|, the target device is out of focus, and if the ratio of the local clarity matrix to the clarity matrix of the target detection frame is less than |2|, the target device is not out of focus.
[0079] The embodiment of the present invention provides a method for identifying whether a monitoring device is out of focus, aiming to provide a method for fully intelligent and automatic identification of whether a monitoring device is out of focus, so as to solve the problem of low efficiency and strong subjectivity caused by manual image review or manual image screening in the existing process. By acquiring an image to be processed of a target device, and performing local clarity calculation on the image to be processed through a preset clarity algorithm, a plurality of local clarity corresponding to the image to be processed is obtained, and at the same time, target detection is performed on the image to be processed to obtain a target detection frame corresponding to the target object in the image to be processed, and the clarity of the target detection frame is determined according to the plurality of local clarity, and finally, based on a comprehensive analysis of the clarity of the target detection frame and the plurality of local clarity, it is determined whether the target device is out of focus. The entire device out-of-focus identification process is a fully automatic identification process, so it does not require manual review and is highly efficient.
[0080] It should be noted that the device out-of-focus recognition method provided in the embodiment of the present invention can be applied to computers, servers and other devices that can perform device out-of-focus recognition.
[0081] Optionally, in the step of performing local clarity calculation on the image to be processed by a preset clarity algorithm to obtain multiple local clearnesses corresponding to the image to be processed, the image to be processed can be divided into regions to obtain multiple first image blocks; the clarity calculation is performed on each first image block by a preset clarity algorithm to obtain a first clarity corresponding to each first image block; and based on the first clarity corresponding to each first image block, multiple local clearnesses corresponding to the image to be processed are determined.
[0082] In the embodiment of the present invention, the above-mentioned region division processing of the image to be processed can be performed as follows: Figure 2The schematic diagram shown in the figure performs region division, the above-mentioned first image block may be a sub-image block corresponding to the above-mentioned image to be processed, the above-mentioned region division processing may be an average division processing based on the above-mentioned image to be processed, dividing the above-mentioned image to be processed into image blocks of the same size, and the above-mentioned image blocks of the same size may be image blocks of the same height and width.
[0083] For example, after obtaining the image to be processed of the target device, the image to be processed can be evenly divided into ten first image blocks of the same size, and the clarity of the ten first image blocks of the same size can be calculated by the preset clarity algorithm to obtain ten first clarity corresponding to the ten first image blocks of the same size, and multiple local clarity corresponding to the image to be processed can be determined based on the ten first clarity corresponding to the ten first image blocks.
[0084] Optionally, in the step of determining multiple local sharpnesses corresponding to the image to be processed based on the first sharpness corresponding to each first image block, the first image block whose first sharpness is less than the first sharpness threshold can be region-divided to obtain multiple second image blocks; the sharpness of each second image block is calculated by a preset sharpness algorithm to obtain the second sharpness corresponding to each second image block; and based on the second sharpness and the first sharpness that is greater than or equal to the first sharpness threshold, multiple local sharpnesses corresponding to the image to be processed are determined.
[0085] In an embodiment of the present invention, the first clarity threshold may be a corresponding threshold obtained by the device management platform through data analysis based on the first clarity, the multiple local clarity may include the corresponding first clarity, and the multiple local clarity may mean two or more. After obtaining the multiple local clarity corresponding to the image to be processed, the corresponding first clarity threshold may be set according to the multiple local clarity, and the multiple local clarity may be compared with the first clarity threshold. If the local clarity among the multiple local clarity is less than the first clarity threshold, the first image block corresponding to the local clarity less than the first clarity threshold needs to be re-divided until all image blocks are less than the first clarity threshold. The second image block may be an image block obtained by dividing the first image block, the second clarity corresponds to the second image block, and the second clarity may be obtained by calculating the second image block through the preset clarity algorithm.
[0086] In a possible embodiment, after determining multiple local clarity corresponding to the image to be processed based on the first clarity corresponding to the first image block, a corresponding first clarity threshold is set according to the multiple local clarity, and the multiple local clarity is compared with the first clarity threshold. If the multiple local clarity are all greater than the local clarity threshold, there is no need to perform secondary region division processing. If the local clarity among the multiple local clarity is less than the first clarity threshold, the first image block with the local clarity less than the first clarity threshold is subjected to region division processing again to obtain multiple second image blocks. The multiple second image blocks may be two or more image blocks. The clarity of each of the above-mentioned second image blocks is calculated by a preset clarity algorithm to obtain multiple second clarity corresponding to each second image block, and the multiple second clarity is compared with the above-mentioned first clarity threshold again. If the second clarity of the above-mentioned multiple second clarity is greater than the above-mentioned first clarity threshold, there is no need to perform a third region division process. If the second clarity of the above-mentioned multiple second clarity is less than the above-mentioned first clarity threshold, the second image block corresponding to the second clarity of the above-mentioned multiple second clarity is subjected to a third region division process until the clarity corresponding to the above-mentioned image blocks is greater than the above-mentioned first clarity threshold.
[0087] Optionally, in the step of calculating the clarity of the first image block of the image to be processed to obtain the first clarity of the first image block, a first decomposition level of the first image block can be determined, and the first image block can be decomposed based on the first decomposition level to obtain a first high-frequency sub-band and a first low-frequency sub-band of the first image block; the first low-frequency sub-band is decomposed based on the second decomposition level to obtain a second high-frequency sub-band and a second low-frequency sub-band of the first image block; and the first clarity of the first image block is determined based on the first high-frequency sub-band and the second high-frequency sub-band.
[0088] In an embodiment of the present invention, the first decomposition level may be determined based on an image decomposition method, and the image decomposition method may be an image pyramid, adaptive filtering, wavelet transform, or other methods that can be used for image decomposition. The sub-band may be determined based on the frequency domain, and the first image block may be decomposed into sub-bands of different frequency ranges by the first decomposition level, wherein the first high-frequency sub-band may include a higher-frequency portion of the first image block, and the first low-frequency sub-band may include a lower-frequency portion of the first image block. The higher-frequency portion of the first image block may be high-frequency features such as image details, textures, and edges in the first image block, and the lower-frequency portion of the first image block may be low-frequency features such as the overall structure and smooth changes in the first image block.
[0089] The second decomposition level may be determined based on the image decomposition method, the second high-frequency sub-band may include a higher-frequency portion of the first low-frequency sub-band, the second low-frequency sub-band may include a lower-frequency portion of the first low-frequency sub-band, the higher-frequency portion of the first low-frequency sub-band may be high-frequency features such as image details, textures and edges in the first low-frequency sub-band, and the lower-frequency portion of the first low-frequency sub-band may be low-frequency features such as overall structure and smooth changes in the first low-frequency sub-band.
[0090] In a possible embodiment, after the image to be processed is divided into regions to obtain multiple first image blocks, the first decomposition level and the second decomposition level are determined according to the above-mentioned decomposition method, and the first image block is decomposed based on the first decomposition level to obtain the first high-frequency sub-band and the first low-frequency sub-band of the first image block; the first low-frequency sub-band is decomposed based on the second decomposition level to obtain the second high-frequency sub-band and the second low-frequency sub-band of the first image block; and the first clarity of the first image block is determined based on the first high-frequency sub-band and the second high-frequency sub-band.
[0091] Optionally, in the step of determining the first clarity of the image block based on the first high-frequency sub-band and the second high-frequency sub-band, the first wavelet coefficient of the first high-frequency sub-band can be determined, and the second wavelet coefficient of the second high-frequency sub-band can be determined; based on the first wavelet coefficient and the second wavelet coefficient, the first clarity of the first image block is determined.
[0092] In an embodiment of the present invention, the above-mentioned first wavelet coefficient can be determined by an image decomposition method based on wavelet transform, and the above-mentioned second wavelet coefficient can also be determined by an image decomposition method based on wavelet transform. Specifically, the above-mentioned first decomposition level and the second decomposition level can be determined according to the above-mentioned wavelet change, and the above-mentioned first wavelet coefficient and the second wavelet coefficient can be determined based on the above-mentioned first decomposition level and the second decomposition level.
[0093] Specifically, the above wavelet coefficients can be calculated by the following formula:
[0094]
[0095] Wherein, A is the wavelet coefficient corresponding to the first image block, n is the decomposition level, x is the horizontal coordinate of the corresponding pixel point in the first image block, y is the vertical coordinate of the corresponding pixel point in the first image block, and f is the wavelet coefficient corresponding to the first image block. Ln (x, y) is the first high frequency sub-band, f Hn (x, y) is the second high frequency sub-band mentioned above.
[0096] Specifically, the clarity of the above image block can be calculated by the following formula:
[0097] F=P(h)×A n +P(v)×A n +P(d)×A n
[0098] Wherein, the above F is the clarity of the above image block, P(h) is the above horizontal texture weight factor, P(v) is the above vertical texture weight factor, P(d) is the above focus direction texture weight factor, A is the wavelet coefficient corresponding to the above first image block, and n is the decomposition level.
[0099] More specifically, the clarity of the above image block can be calculated by the following expansion formula:
[0100]
[0101] Wherein, F is the clarity of the above image block, P(h) is the above horizontal texture weight factor, P(v) is the above vertical texture weight factor, P(d) is the above focus direction texture weight factor, and f Ln (x, y) is the first high frequency sub-band, f Hn (x, y) is the second high frequency subband, n is the decomposition level, x is the horizontal coordinate of the corresponding pixel point in the first image block, and y is the vertical coordinate of the corresponding pixel point in the first image block.
[0102] Optionally, in the step of determining the clarity of the target detection frame according to multiple local sharpnesses corresponding to the image to be processed, the clarity of each pixel in the image to be processed can be determined according to the multiple local sharpnesses corresponding to the image to be processed; and the clarity of each pixel in the target detection frame can be determined according to the clarity of each pixel in the image to be processed.
[0103] In an embodiment of the present invention, the above-mentioned each pixel point may be the smallest unit in the above-mentioned image to be processed. According to the multiple local sharpnesses corresponding to the above-mentioned image to be processed, the sharpness of the pixel point corresponding to the above-mentioned multiple local sharpnesses may be determined, and the sharpness of each pixel point in the above-mentioned image to be processed may be determined based on the pixel point sharpnesses corresponding to the above-mentioned multiple local sharpnesses. The coordinates corresponding to each pixel point in the above-mentioned target detection frame may be determined in the above-mentioned image to be processed, and the sharpness of each pixel point inside the above-mentioned target detection frame may be determined based on the coordinates corresponding to each pixel point in the above-mentioned target detection frame. The coordinates of the above-mentioned pixel points may be image coordinates based on the above-mentioned image to be processed.
[0104] Optionally, in the step of determining whether the target device is out of focus based on local clarity and the clarity of the target detection frame, a first clarity matrix corresponding to the image to be processed can be determined based on the clarity of each pixel in the image to be processed, and a second clarity matrix corresponding to the target detection frame can be determined based on the clarity of each pixel in the target detection frame; and whether the target device is out of focus is determined based on the correlation coefficient between the first clarity matrix and the second clarity matrix.
[0105] In an embodiment of the present invention, the first clarity matrix and the second clarity matrix can be determined based on the coordinate system of the image to be processed to determine the first pixel point coordinates corresponding to the image to be processed, the first clarity matrix corresponding to the image to be processed can be determined based on the first pixel point coordinates corresponding to the image to be processed, and the second pixel point coordinates within the target detection frame in the image to be processed can be determined based on the coordinate system of the image to be processed, and the second clarity matrix corresponding to the target detection frame can be determined based on the second pixel point coordinates.
[0106] Furthermore, the first clarity matrix may be based on the first pixel coordinates as the coordinates of the first clarity matrix, and based on the pixel clarity corresponding to the first pixel coordinates as the clarity corresponding to the coordinates of the first clarity matrix. The second clarity matrix may be based on the second pixel coordinates as the coordinates of the second clarity matrix, and based on the pixel clarity corresponding to the second pixel coordinates as the clarity corresponding to the coordinates of the second clarity matrix. The first clarity matrix may be determined based on the first pixel coordinates and the clarity corresponding to the first pixel coordinates, and the second clarity matrix may be determined based on the second pixel coordinates and the clarity corresponding to the second pixel coordinates. Whether the target device is out of focus may be determined by comparing the ratio of the correlation coefficients between the first clarity matrix and the second clarity matrix with the defocus threshold. The closer the ratio is to 1, the stronger the correlation between the local clarity matrix and the clarity matrix of the target detection frame is, and a strong correlation indicates that the device is not out of focus. Figure 3 As shown in the schematic diagram of the correlation coefficient, the defocus threshold may be |5|. If the ratio of the local clarity matrix to the clarity matrix of the target detection frame is greater than |5|, the target device is defocused. If the ratio of the local clarity matrix to the clarity matrix of the target detection frame is less than |5|, the target device is not defocused.
[0107] Specifically, the correlation coefficient between the first clarity matrix and the second clarity matrix can be calculated according to the following formula:
[0108]
[0109] Among them, r is the correlation coefficient between the above-mentioned first clarity matrix and the second clarity matrix, cov(A,B) is the covariance between the above-mentioned first clarity matrix and the above-mentioned second clarity matrix, and σAσB is the standard deviation of the above-mentioned first clarity matrix and the above-mentioned second clarity matrix.
[0110] More specifically, the above cov(A,B) and σAσB can be calculated according to the following formula:
[0111]
[0112]
[0113]
[0114] Wherein, m is the first decomposition level of the first definition matrix, n is the second decomposition level of the first definition matrix, p is the first decomposition level of the second definition matrix, q is the second decomposition level of the second definition matrix, i is the horizontal coordinate of the pixel point, j is the vertical coordinate of the pixel point, A is the first definition matrix, B is the second definition matrix, is the mean of the first clarity matrix, is the mean value of the second clarity matrix.
[0115] More specifically, the mean of the first definition matrix and the mean of the second definition matrix can be calculated by the following formula:
[0116]
[0117]
[0118] in, is the mean value of the first clarity matrix, is the mean of the above-mentioned second clarity matrix, m is the first decomposition level of the first clarity matrix, n is the second decomposition level of the first clarity matrix, p is the first decomposition level of the second clarity matrix, q is the second decomposition level of the second clarity matrix, i is the horizontal coordinate of the pixel point, j is the vertical coordinate of the pixel point, A is the first clarity matrix, and B is the second clarity matrix.
[0119] like Figure 4 As shown, Figure 4 This is a method flow chart of a method for identifying device out-of-focus provided by an embodiment of the present invention. Figure 4 The method for identifying device out-of-focus is described in Figure 4In the figure, fi is the clarity of the image block, fa is the clarity threshold, fi(x, y) is the clarity coordinate corresponding to the clarity of the image block, and n is the total number of image blocks. After acquiring the image of the target device, the image is preprocessed. The preprocessing includes grayscale processing, denoising processing and enhancement processing to obtain a preprocessed image. The preprocessed image is divided into ten image blocks of equal size based on the image size of the preprocessed image. The image blocks of equal size may have equal image height and image width. Feature extraction is performed based on the image blocks to obtain feature information of each image block. The clarity fi of each image block is calculated based on the feature information of each image block. Based on the clarity fi of each image block, a clarity threshold fa corresponding to the clarity fi of each image block is established, and the clarity fi of each image block is compared with the clarity threshold fa. If the clarity fi of each image block is greater than the clarity threshold fa, the clarity fi of each image block and the clarity coordinate fi(x, y) corresponding to the clarity of each image block are recorded. Matrix A is determined according to the clarity fi of each image block and the clarity coordinates fi (x, y) corresponding to the clarity of each image block. The center coordinates of the preprocessed image are determined according to the clarity coordinates fi (x, y) corresponding to the clarity fi of each image block. The clarity of the center point of the preprocessed image is determined based on the center point coordinates of the preprocessed image. Matrix B is determined according to the clarity of the center point of the preprocessed image and the clarity fi of each image block. Whether the target device is out of focus is determined based on the ratio of the matrix A to the matrix B. The closer the ratio is to 1, the clearer it is. The corresponding defocus threshold is set according to the ratio. The defocus threshold can be |5|. If the ratio of the matrix A to the matrix B is greater than the defocus threshold, the target device is out of focus. If the ratio of the matrix A to the matrix B is less than the defocus threshold, the target device is not out of focus.
[0120] like Figure 5 As shown, an embodiment of the present invention provides a device for identifying out-of-focus of a device, and the device for identifying out-of-focus of a device includes:
[0121] A first acquisition module 501 is used to acquire an image to be processed of a target device, wherein the image to be processed includes a target object;
[0122] A first calculation module 502 is used to perform local definition calculation on the image to be processed by a preset definition algorithm to obtain multiple local definitions corresponding to the image to be processed;
[0123] A first detection module 503 is used to perform target detection on the image to be processed to obtain a target detection frame corresponding to the target object;
[0124] A first determination module 504 is used to determine the clarity of the target detection frame according to a plurality of local clarity corresponding to the image to be processed;
[0125] The second determination module 505 is configured to determine whether the target device is out of focus based on the local clarity and the clarity of the target detection frame.
[0126] Optionally, the second calculation module 502 includes:
[0127] A first division module, used for performing region division processing on the image to be processed to obtain a plurality of first image blocks;
[0128] A second calculation module, configured to perform clarity calculation on each of the first image blocks using a preset clarity algorithm to obtain a first clarity corresponding to each of the first image blocks;
[0129] The third determination module is used to determine multiple local sharpnesses corresponding to the image to be processed based on the first sharpnesses corresponding to the first image blocks.
[0130] Optionally, the third determining module includes:
[0131] A second division module, configured to perform region division processing on the first image block whose first definition is less than a first definition threshold, to obtain a plurality of second image blocks;
[0132] a third calculation module, configured to perform clarity calculation on each of the second image blocks by using a preset clarity algorithm to obtain a second clarity corresponding to each of the second image blocks;
[0133] The fourth determination module is used to determine a plurality of local sharpnesses corresponding to the image to be processed based on the second sharpness and the first sharpness that is greater than or equal to the first sharpness threshold.
[0134] Optionally, the second calculation module includes:
[0135] A first decomposition module, configured to determine a first decomposition level of the first image block, and decompose the first image block based on the first decomposition level to obtain a first high-frequency sub-band and a first low-frequency sub-band of the first image block;
[0136] A second decomposition module is used to determine a second decomposition level of the first low-frequency sub-band, and decompose the first low-frequency sub-band based on the second decomposition level to obtain a second high-frequency sub-band and a second low-frequency sub-band of the first image block;
[0137] The fifth determination module is configured to determine a first definition of the first image block based on the first high frequency sub-band and the second high frequency sub-band.
[0138] Optionally, the fifth determining module includes:
[0139] A first determining unit, configured to determine a first wavelet coefficient of the first high frequency sub-band, and to determine a second wavelet coefficient of the second high frequency sub-band;
[0140] The second determining unit is configured to determine a first definition of the first image block according to the first wavelet coefficient and the second wavelet coefficient.
[0141] Optionally, the first determining module 504 includes:
[0142] A third determining unit, configured to determine the clarity of each pixel in the image to be processed according to a plurality of local clarity corresponding to the image to be processed;
[0143] The fourth determining unit is used to determine the clarity of each pixel in the target detection frame according to the clarity of each pixel in the image to be processed.
[0144] Optionally, the second determining module 505 includes:
[0145] a fifth determining unit, configured to determine a first clarity matrix corresponding to the image to be processed based on the clarity of each pixel in the image to be processed, and to determine a second clarity matrix corresponding to the target detection frame based on the clarity of each pixel in the target detection frame;
[0146] A sixth determining unit is configured to determine whether the target device is out of focus based on a correlation coefficient between the first clarity matrix and the second clarity matrix.
[0147] It should be noted that the device for identifying device out-of-focus provided in the embodiment of the present invention can be applied to devices such as shooting devices, smart phones, computers, servers, etc. that can perform device out-of-focus identification.
[0148] The device for identifying device out of focus provided by the embodiment of the present invention can implement each process implemented by the device out of focus identification method in the above method embodiment, and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0149] See also Figure 6 , Figure 6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 6 As shown, it includes: a memory 602, a processor 601, and a computer program of a data ferrying method stored in the memory 602 and executable on the processor 601, wherein:
[0150] The processor 601 is used to call the computer program stored in the memory 602 to perform the following steps:
[0151] Acquire an image to be processed of a target device, wherein the image to be processed includes a target object;
[0152] Calculating the local clarity of the image to be processed by a preset clarity algorithm to obtain a plurality of local clarity corresponding to the image to be processed;
[0153] Performing target detection on the image to be processed to obtain a target detection frame corresponding to the target object;
[0154] Determining the clarity of the target detection frame according to a plurality of local clarity corresponding to the image to be processed;
[0155] Based on the local clarity and the clarity of the target detection frame, it is determined whether the target device is out of focus.
[0156] Optionally, the processor 601 performs the local definition calculation on the image to be processed by using a preset definition algorithm to obtain multiple local definitions corresponding to the image to be processed, including:
[0157] Performing region division processing on the image to be processed to obtain a plurality of first image blocks;
[0158] Calculating the clarity of each of the first image blocks by using a preset clarity algorithm to obtain a first clarity corresponding to each of the first image blocks;
[0159] Based on the first sharpness corresponding to each of the first image blocks, a plurality of local sharpnesses corresponding to the image to be processed are determined.
[0160] Optionally, the determining, based on the first definition corresponding to each of the first image blocks, a plurality of local definition corresponding to the image to be processed, performed by the processor 601 includes:
[0161] Performing region division processing on the first image block whose first definition is less than a first definition threshold to obtain a plurality of second image blocks;
[0162] Calculating the clarity of each of the second image blocks by using a preset clarity algorithm to obtain a second clarity corresponding to each of the second image blocks;
[0163] Based on the second definition and the first definition that is greater than or equal to the first definition threshold, a plurality of local definitions corresponding to the image to be processed are determined.
[0164] Optionally, the processor 601 performs the definition calculation according to the first image block of the image to be processed to obtain the first definition of the first image block, including:
[0165] Determining a first decomposition level of the first image block, and performing decomposition processing on the first image block based on the first decomposition level to obtain a first high-frequency sub-band and a first low-frequency sub-band of the first image block;
[0166] Decomposing the first low-frequency sub-band based on the second decomposition level to obtain a second high-frequency sub-band and a second low-frequency sub-band of the first image block;
[0167] A first definition of the first image block is determined based on the first high frequency sub-band and the second high frequency sub-band.
[0168] Optionally, the determining of the first definition of the image block based on the first high frequency sub-band and the second high frequency sub-band performed by the processor 601 includes:
[0169] determining a first wavelet coefficient of the first high frequency sub-band, and determining a second wavelet coefficient of the second high frequency sub-band;
[0170] A first definition of the first image block is determined according to the first wavelet coefficient and the second wavelet coefficient.
[0171] Optionally, the processor 601 determines the clarity of the target detection frame according to multiple local clarity corresponding to the image to be processed, including:
[0172] Determining the clarity of each pixel in the image to be processed according to a plurality of local clarity corresponding to the image to be processed;
[0173] The clarity of each pixel in the target detection frame is determined according to the clarity of each pixel in the image to be processed.
[0174] Optionally, the processor 601 determines whether the target device is out of focus based on the local clarity and the clarity of the target detection frame, including:
[0175] Determine a first clarity matrix corresponding to the image to be processed based on the clarity of each pixel in the image to be processed, and determine a second clarity matrix corresponding to the target detection frame based on the clarity of each pixel in the target detection frame;
[0176] Whether the target device is out of focus is determined based on a correlation coefficient between the first clarity matrix and the second clarity matrix.
[0177] It should be noted that the electronic device provided by the embodiment of the present invention can be applied to devices such as smart phones, computers, servers, etc. that can perform the device out-of-focus identification method.
[0178] The electronic device provided in the embodiment of the present invention can implement each process implemented by the device out-of-focus recognition method in the above method embodiment, and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0179] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the device out-of-focus identification method or the application-end device out-of-focus identification method provided by the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0180] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0181] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for identifying device out-of-focus, characterized in that: The method comprises the following steps: Acquire an image to be processed of a target device, wherein the image to be processed includes a target object; Calculating the local clarity of the image to be processed by a preset clarity algorithm to obtain a plurality of local clarity corresponding to the image to be processed; Performing target detection on the image to be processed to obtain a target detection frame corresponding to the target object; Determining the clarity of the target detection frame according to a plurality of local clarity corresponding to the image to be processed; Based on the local clarity and the clarity of the target detection frame, it is determined whether the target device is out of focus.
2. The device out-of-focus recognition method according to claim 1, characterized in that: The method of calculating the local definition of the image to be processed by a preset definition algorithm to obtain a plurality of local definitions corresponding to the image to be processed includes: Performing region division processing on the image to be processed to obtain a plurality of first image blocks; Calculating the clarity of each of the first image blocks by using a preset clarity algorithm to obtain a first clarity corresponding to each of the first image blocks; Based on the first sharpness corresponding to each of the first image blocks, a plurality of local sharpnesses corresponding to the image to be processed are determined.
3. The device out-of-focus recognition method according to claim 2, characterized in that: The determining, based on the first definition corresponding to each of the first image blocks, a plurality of local definition corresponding to the image to be processed includes: Performing region division processing on the first image block whose first definition is less than a first definition threshold to obtain a plurality of second image blocks; Calculating the clarity of each of the second image blocks by using a preset clarity algorithm to obtain a second clarity corresponding to each of the second image blocks; Based on the second definition and the first definition that is greater than or equal to the first definition threshold, a plurality of local definitions corresponding to the image to be processed are determined.
4. The device out-of-focus recognition method according to claim 2, characterized in that: The step of performing definition calculation according to the first image block of the image to be processed to obtain a first definition of the first image block includes: Determining a first decomposition level of the first image block, and performing decomposition processing on the first image block based on the first decomposition level to obtain a first high-frequency sub-band and a first low-frequency sub-band of the first image block; determining a second decomposition level of the first low-frequency sub-band, and performing decomposition processing on the first low-frequency sub-band based on the second decomposition level to obtain a second high-frequency sub-band and a second low-frequency sub-band of the first image block; A first definition of the first image block is determined based on the first high frequency sub-band and the second high frequency sub-band.
5. The device out-of-focus identification method according to claim 4, characterized in that: The determining, based on the first high frequency sub-band and the second high frequency sub-band, a first definition of the image block includes: determining a first wavelet coefficient of the first high frequency sub-band, and determining a second wavelet coefficient of the second high frequency sub-band; A first definition of the first image block is determined according to the first wavelet coefficient and the second wavelet coefficient.
6. The device out-of-focus identification method according to any one of claims 1 to 5, characterized in that: Determining the clarity of the target detection frame according to a plurality of local clarity corresponding to the image to be processed includes: Determining the clarity of each pixel in the image to be processed according to a plurality of local clarity corresponding to the image to be processed; The clarity of each pixel in the target detection frame is determined according to the clarity of each pixel in the image to be processed.
7. The device out-of-focus recognition method according to claim 6, characterized in that: Determining whether the target device is out of focus based on the local clarity and the clarity of the target detection frame includes: Determine a first clarity matrix corresponding to the image to be processed based on the clarity of each pixel in the image to be processed, and determine a second clarity matrix corresponding to the target detection frame based on the clarity of each pixel in the target detection frame; Whether the target device is out of focus is determined based on a correlation coefficient between the first clarity matrix and the second clarity matrix.
8. A device for identifying out-of-focus status of a device, characterized in that: The device out-of-focus recognition device comprises: A first acquisition module, used to acquire an image to be processed from a target device; A first calculation module, configured to perform local definition calculation on the image to be processed by using a preset definition algorithm to obtain a plurality of local definitions corresponding to the image to be processed; A first detection module, used to perform target detection on the image to be processed to obtain a target detection frame corresponding to the target object; A first determination module, configured to determine the clarity of the target detection frame according to a plurality of local clarity corresponding to the image to be processed; The second determination module is used to determine whether the target device is out of focus based on the local clarity and the clarity of the target detection frame.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the device out-of-focus identification method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the device out-of-focus identification method as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Target detection method and device, electronic equipment and storage medium
CN121505354A