Image detection method and device, electronic equipment and storage medium

By calculating the sharpness fluctuation values ​​of multiple images captured by the camera, and using the Laplacian operator to determine whether the camera is out of focus, it solves the problems of misjudgment and low efficiency in manual subjective evaluation, and achieves more accurate and efficient out of focus judgment. .

CN118628468APending Publication Date: 2024-09-10SHANGHAI WINGTECH INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410834883.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Manual subjective evaluation of photo clarity is prone to misjudgment and is inefficient, especially in scenes that are difficult to distinguish with the naked eye, affecting subsequent debugging work.

Method used

By obtaining multiple images of the target scene to be tested, use the Laplacian operator to calculate the sharpness value of each image, and determine whether the camera is out of focus based on the sharpness fluctuation value between images. If the fluctuation value is less than the preset threshold Then it is determined that it is not out of focus.

Benefits of technology

It improves the accuracy and efficiency of out-of-focus judgment, avoids accuracy differences in manual judgment, and saves time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628468A
    Figure CN118628468A
Patent Text Reader

Abstract

The embodiment of the invention discloses an image detection method and device, electronic equipment and a storage medium, and can solve the problems that misjudgment is easily generated and the efficiency is relatively low when the definition of each photo is evaluated manually and subjectively. The method comprises the following steps: acquiring a plurality of to-be-detected images corresponding to a target scene through a to-be-detected camera; according to a Laplace operator, obtaining a definition value of each to-be-detected image; according to a difference value between the definition value of the first to-be-detected image and the definition value of the second to-be-detected image and a difference value between the definition value of the second to-be-detected image and the definition value of the third to-be-detected image, determining a definition fluctuation value among the plurality of to-be-detected images, the first to-be-detected image, the second to-be-detected image and the third to-be-detected image are all any one of a plurality of to-be-detected images, and the first to-be-detected image, the second to-be-detected image and the third to-be-detected image are all different images; and when it is detected that the definition fluctuation value is smaller than a preset fluctuation threshold, determining that the to-be-detected camera is not out of focus in the target scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] During the Camera AF Tuning process, a large number of scene photos (more than 1,000) need to be classified to determine whether the current scene photo has been successfully focused. If it is determined to be out of focus, the Camera Tuning engineer needs to complete the subsequent AF debugging work. The current process of determining out of focus is mainly through manual subjective evaluation of the clarity of each photo. If the clarity is poor, it is considered out of focus. However, everyone's subjective feelings vary greatly, especially for some scenes that are difficult to distinguish with the naked eye, which is prone to misjudgment, affecting subsequent debugging work and low efficiency. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present application provide an image detection method, device, electronic device and storage medium to solve the problem that manual subjective evaluation of the clarity of each photo is prone to misjudgment and low efficiency.

[0004] In order to achieve the above purpose, the technical solutions provided by the embodiments of the present application are as follows:

[0005] In a first aspect, an embodiment of the present application provides an image detection method, the image detection method comprising: acquiring a plurality of images to be tested corresponding to a target scene through a camera to be tested;

[0006] According to the Laplace operator, the clarity value of each image to be tested is obtained;

[0007] Determine the clarity fluctuation value between the plurality of images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the clarity value of the second image to be tested and the clarity value of the third image to be tested, wherein the first image to be tested, the second image to be tested and the third image to be tested are any one of the plurality of images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are all different images;

[0008] When it is detected that the clarity fluctuation value is less than a preset fluctuation threshold, it is determined that the camera to be tested is not out of focus in the target scene.

[0009] As an optional implementation manner, in the first aspect of the embodiment of the present application, obtaining the clarity value of each image to be tested according to the Laplace operator includes:

[0010] Performing target object detection on each of the images to be tested to obtain a region detection frame corresponding to each of the images to be tested;

[0011] Obtaining a clarity value of the region detection frame according to the Laplace operator;

[0012] The clarity value of the area detection frame is determined as the clarity value of the image to be tested.

[0013] As an optional implementation manner, in the first aspect of the embodiment of the present application, obtaining the clarity value of the area detection frame according to the Laplace operator includes:

[0014] Obtaining a target pixel value for each pixel in the area detection frame;

[0015] The target pixel value of each pixel and the Laplace operator are weightedly calculated to obtain a clarity value of the area detection frame.

[0016] As an optional implementation manner, in the first aspect of the embodiment of the present application, performing weighted calculation on the target pixel value of each pixel and the Laplacian operator to obtain the clarity value of the area detection frame includes:

[0017] Performing weighted calculation on the target pixel value of each pixel and the Laplace operator to obtain a Laplace vector value corresponding to each pixel;

[0018] The Laplace vector value corresponding to each pixel point is normalized to obtain a clarity value of the area detection frame.

[0019] As an optional implementation manner, in the first aspect of the embodiment of the present application, obtaining the clarity value of each image to be tested according to the Laplace operator includes:

[0020] Performing grayscale processing on the multiple images to be tested to obtain multiple grayscale images;

[0021] According to the Laplace operator, the clarity value of each grayscale image is obtained.

[0022] As an optional implementation, in the first aspect of the embodiment of the present application, determining the clarity fluctuation value between the multiple images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested includes:

[0023] Respectively obtaining a first difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested, and a second difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested;

[0024] An average value of the first difference and the second difference is determined as a clarity fluctuation value between the plurality of images to be tested.

[0025] As an optional implementation manner, in the first aspect of the embodiment of the present application, the performing target object detection on each of the images to be tested to obtain a region detection frame corresponding to each of the images to be tested includes:

[0026] Performing target object detection on each of the images to be tested to obtain a target object detection result;

[0027] If the target object detection result indicates that a target object exists, generating a region detection frame corresponding to each image to be detected according to the target object, wherein the region detection frame includes the target object;

[0028] If the target object detection result indicates that the target object does not exist, a region detection frame corresponding to each of the images to be detected is generated according to a preset ratio, and the region detection frame is located at the center of the image to be detected.

[0029] In a second aspect, an embodiment of the present application provides an image detection device, the image detection device comprising: an acquisition module, configured to acquire a plurality of images to be tested corresponding to a target scene through a camera to be tested;

[0030] A processing module, used for obtaining a definition value of each image to be tested according to a Laplace operator;

[0031] The processing module is further used to determine the clarity fluctuation value between the multiple images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the clarity value of the second image to be tested and the clarity value of the third image to be tested, wherein the first image to be tested, the second image to be tested and the third image to be tested are any one of the multiple images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are different images;

[0032] The processing module is further configured to determine that the camera to be tested is not out of focus in the target scene when it is detected that the clarity fluctuation value is less than a preset fluctuation threshold.

[0033] As an optional implementation, in the second aspect of the embodiment of the present application, the processing module is specifically used to perform target object detection on each of the images to be tested to obtain a region detection frame corresponding to each of the images to be tested;

[0034] The processing module is specifically used to obtain the clarity value of the area detection frame according to the Laplace operator;

[0035] The processing module is specifically used to determine the clarity value of the area detection frame as the clarity value of the image to be tested.

[0036] As an optional implementation, in the second aspect of the embodiment of the present application, the acquisition module is specifically used to acquire a target pixel value of each pixel point in the area detection frame;

[0037] The processing module is specifically used to perform weighted calculation on the target pixel value of each pixel point and the Laplace operator to obtain the clarity value of the area detection frame.

[0038] As an optional implementation, in the second aspect of the embodiment of the present application, the processing module is specifically used to perform weighted calculation on the target pixel value of each pixel and the Laplace operator to obtain a Laplace vector value corresponding to each pixel;

[0039] The processing module is specifically used to normalize the Laplace vector value corresponding to each pixel point to obtain the clarity value of the area detection frame.

[0040] As an optional implementation, in the second aspect of the embodiment of the present application, the processing module is specifically used to perform grayscale processing on the multiple images to be tested to obtain multiple grayscale images;

[0041] The processing module is specifically used to obtain the clarity value of each grayscale image according to the Laplace operator.

[0042] As an optional implementation, in the second aspect of the embodiment of the present application, the acquisition module is specifically used to respectively acquire a first difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested, and a second difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested;

[0043] The processing module is specifically configured to determine an average value of the first difference and the second difference as a clarity fluctuation value between the plurality of images to be tested.

[0044] As an optional implementation, in the second aspect of the embodiment of the present application, the processing module is specifically used to perform target object detection on each of the images to be tested to obtain a target object detection result;

[0045] The processing module is specifically configured to generate a region detection frame corresponding to each image to be detected according to the target object if the target object detection result indicates that the target object exists, wherein the region detection frame includes the target object;

[0046] The processing module is specifically configured to generate a region detection frame corresponding to each image to be tested according to a preset ratio if the target object detection result indicates that the target object does not exist, and the region detection frame is located at the center of the image to be tested.

[0047] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0048] A memory storing executable program code;

[0049] a processor coupled to the memory;

[0050] The processor calls the executable program code stored in the memory to execute the image detection method in the first aspect of the embodiment of the present application.

[0051] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the image detection method in the first aspect of the embodiment of the present application. The computer-readable storage medium includes a ROM / RAM, a magnetic disk or an optical disk, etc.

[0052] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute part or all of the steps of any one of the methods of the first aspect.

[0053] In a sixth aspect, an embodiment of the present application provides an application publishing platform, which is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes part or all of the steps of any one method of the first aspect.

[0054] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0055] The embodiment of the present application provides an image detection method, device, electronic device and storage medium, which obtains multiple images to be tested corresponding to the target scene through the camera to be tested; obtains the clarity value of each image to be tested according to the Laplace operator; determines the clarity fluctuation value between the multiple images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested, wherein the first image to be tested, the second image to be tested and the third image to be tested are any one of the multiple images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are all different images; when it is detected that the clarity fluctuation value is less than the preset fluctuation threshold, it is determined that the camera to be tested is not out of focus in the target scene. Through this scheme, the Laplace operator can be used to quickly output the judgment of whether the photo in the scene is out of focus, saving time, improving efficiency, and avoiding the problem of large differences in the accuracy of manual judgment of whether it is out of focus, effectively improving the accuracy and efficiency of out-of-focus judgment. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 This is a schematic diagram of the process of an image detection method provided in an embodiment of the present application. Figure 1 ;

[0059] Figure 2 This is a schematic diagram of the process of an image detection method provided in an embodiment of the present application. Figure 2 ;

[0060] Figure 3 is a structural schematic diagram of an image detection device provided in an embodiment of the present application;

[0061] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0063] The terms “first”, “second” and the like in the description and claims of the present application are used to distinguish different objects rather than to describe a specific order of the objects.

[0064] The terms "including" and "having" and any variations thereof in the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.

[0065] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0066] Camera AF Tuning, or auto focus tuning, is one of the key steps in camera tuning. Auto focus (AF) is used to determine the best lens position for focus and trigger the motor to accurately move the lens to the in-focus position, where the image is clearest. During the imaging process, if the lens is not in the in-focus position, the image will be blurred, which is called defocus.

[0067] During the Camera AF Tuning process, a large number of scene photos (more than 1,000) must first be classified, and a subjective judgment must be made manually to determine whether the current scene photo has been successfully focused. If it is judged to be out of focus, the subsequent AF debugging work needs to be completed by the Camera Tuning engineer. The current manual judgment of out-of-focus is mainly based on subjective evaluation of the clarity of each photo. If the clarity is poor, it is considered out of focus. However, each person's subjective feelings vary greatly, especially for some scenes that are difficult to distinguish with the naked eye. Misjudgment is easy to occur, which affects the subsequent debugging work. In addition, due to the large number of scene photos, each photo needs to be manually checked and then an evaluation result is given, resulting in low efficiency.

[0068] In order to solve some or all of the above technical problems, the embodiments of the present application provide an image detection method, device, electronic device and storage medium, through the camera to be tested, a plurality of images to be tested corresponding to the target scene are obtained; according to the Laplace operator, the clarity value of each image to be tested is obtained; according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested, the clarity fluctuation value between the plurality of images to be tested is determined, the first image to be tested, the second image to be tested and the third image to be tested are any one of the plurality of images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are all different images; when it is detected that the clarity fluctuation value is less than the preset fluctuation threshold, it is determined that the camera to be tested is not out of focus in the target scene. Through this scheme, the Laplace operator can be used to quickly output the judgment of whether the photo in the scene is out of focus, save time, improve efficiency, and avoid the problem of large differences in the accuracy of manual judgment of whether it is out of focus, effectively improving the accuracy and efficiency of out-of-focus judgment.

[0069] like Figure 1 As shown, Figure 1 A flowchart of an image detection method provided in an embodiment of the present application, the method may include the following steps:

[0070] 101. Acquire a plurality of images to be tested corresponding to a target scene through a camera to be tested.

[0071] In the embodiment of the present application, in order to detect the autofocus performance of the camera to be tested, photos may be taken of a target scene to obtain a plurality of images to be tested corresponding to the target scene.

[0072] It should be noted that the number of the target scene can be one or more, and for each scene, multiple images corresponding to the scene need to be acquired. The number of images is at least two. Generally, in order to more accurately detect the focus of the camera, a large number of scene images need to be acquired, such as 500, 1000, etc.

[0073] In some embodiments, the multiple images to be tested corresponding to the target scene may be obtained by real-time capture by the camera to be tested, or may be pre-captured and stored, or may be obtained in other ways, which is not specifically limited in the embodiments of the present application.

[0074] 102. According to the Laplace operator, the clarity value of each image to be tested is obtained.

[0075] In the embodiment of the present application, the Laplace operator needs to be used when calculating the clarity value of each image to be tested.

[0076] It should be noted that the Laplacian operator can be understood as a matrix, and the pixel values ​​of the pixels in the image to be tested and the matrix are weighted to obtain the clarity value of the image to be tested.

[0077] In some embodiments, the Laplacian operator is used to measure the second-order derivative of the image, highlighting areas in the image where the intensity changes rapidly. If the image has a higher variance, it has a wider frequency response range, representing a normal, well-focused image. But if the image has a smaller variance, it has a narrower frequency response range, which means that there are few edges in the image. As we know, the blurrier the image, the fewer edges it has. Therefore, this scheme uses Laplacian as the core operator for evaluating image clarity. There are many other edge detection operators, such as the Sobel operator and the Scharr operator, which can be adjusted or used in combination in actual use to achieve the best effect.

[0078] The Laplacian operator is a commonly used second-order differential operator in image processing, mainly used for edge detection and image sharpening. The Laplacian operator can be defined as a second-order differential operator in n-dimensional Euclidean space, which is the divergence div of the gradient grad. If f is a second-order differentiable real function, the Laplacian operator of f can be expressed as the sum of all non-mixed second-order partial derivatives.

[0079] The Laplacian operator is isotropic, that is, it is independent of the direction of the coordinate axis. The gradient result remains unchanged after the coordinate axis is rotated, that is, rotation invariance. The Laplacian operator is a high-pass filter that is used to retain the high-frequency components of the image (the parts that change dramatically) and suppress the low-frequency components of the image (the parts that change slowly). Since the Laplacian operator is sensitive to noise, it is usually necessary to smooth the image before using it.

[0080] Since the Laplacian operator is very sensitive to areas with large changes in grayscale values ​​in an image, it can be used for edge detection. By enhancing the high-frequency components in an image, the Laplacian operator can be used for image sharpening to make the edges clearer. In addition, since blurred images have fewer high-frequency components, the Laplacian operator can also be used to determine the degree of blurriness of an image.

[0081] In some embodiments, when calculating the clarity value of each image to be tested, the clarity value can be characterized by a Sharpness value, which is a quantitative indicator used to describe the clarity of an image or video. In image processing, Sharpness generally refers to the clarity of the outline of an object in an image and the sharpness of its edges. A higher Sharpness value means that the edges and outlines of the image are clearer, and the details can be better displayed.

[0082] The numerical range and specific definition of Sharpness may vary depending on different application scenarios and technologies. In some software, such as Camera Raw settings, the adjustment range of Sharpness may be 0 to 100, with a default value of 10. However, in other cases, Sharpness may be quantified by more complex algorithms and metrics, such as using a Laplacian filter or gradient operator to calculate the intensity of high-frequency signals in an image to evaluate Sharpness.

[0083] In image quality assessment, the sharpness value may be related to some specific metrics, such as the MTF (Modulation Transfer Function) curve. The MTF curve describes the correspondence between spatial frequency and contrast, thus providing a quantitative assessment of image sharpness. The ISO 12233 bevel edge measurement method is a commonly used image sharpness measurement method. It quantifies the sharpness of the image by shooting a grayscale test card of a certain contrast and drawing an edge feature curve, and then using Fourier transform to obtain the MTF curve.

[0084] In addition, the sharpness value may also be related to the subjective feelings of the viewer. Although the objective sharpness evaluation method can provide certain quantitative indicators, the viewer's perception of image clarity may be affected by many factors, such as contrast, brightness, color saturation, etc. Therefore, in practical applications, it is necessary to combine objective evaluation and subjective feelings to comprehensively evaluate the sharpness of the image.

[0085] In summary, the sharpness value is a quantitative indicator used to describe the clarity of an image or video. Its specific definition and measurement method may vary depending on different application scenarios and technologies. In practical applications, it is necessary to combine objective evaluation and subjective feelings to comprehensively evaluate the sharpness of an image.

[0086] In some embodiments, grayscale processing is performed on a plurality of images to be tested to obtain a plurality of grayscale images; and a clarity value of each grayscale image is obtained according to a Laplace operator.

[0087] It should be noted that after obtaining the images to be tested, each image to be tested can be converted into a grayscale image, and then a Laplace operator and the grayscale value of each pixel are weightedly calculated to obtain the clarity value of each grayscale image.

[0088] 103. Determine clarity fluctuation values ​​between the plurality of images to be tested according to a difference between a clarity value of the first image to be tested and a clarity value of the second image to be tested and a difference between a clarity value of the second image to be tested and a clarity value of the third image to be tested.

[0089] In the embodiment of the present application, after obtaining the clarity value of each image to be tested, the clarity fluctuation value between the images to be tested may be calculated. Specifically, the calculation may be performed based on the clarity difference between any two images to be tested.

[0090] The first image to be tested, the second image to be tested and the third image to be tested are all any one of a plurality of images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are all different images.

[0091] It should be noted that the above description using the first image to be tested, the second image to be tested, and the third image to be tested does not mean that there are only the above three images to be tested. The number of the first image to be tested, the second image to be tested, and the third image to be tested is arbitrary. In fact, the difference between the sharpness of all two adjacent images to be tested is calculated. For example, there are N images to be tested, and the calculated sharpness values ​​are respectively expressed as S1, S2, ..., S N , then we can calculate the difference between S1 and S2, and the difference between S2 and S3, until S N-1 and S N The difference between .

[0092] In some embodiments, the clarity fluctuation value may indicate the change in the difference between the clarity values ​​of two adjacent images to be tested. Specifically, the clarity fluctuation value may be determined based on the average of multiple difference values, or based on the variance of multiple difference values. Of course, the clarity fluctuation value may also be determined based on other values ​​of multiple difference values.

[0093] 104. When it is detected that the clarity fluctuation value is less than a preset fluctuation threshold, it is determined that the camera to be tested is not out of focus in the target scene.

[0094] In the embodiment of the present application, the preset fluctuation threshold may be a preset threshold, and the preset fluctuation threshold may be numerically adjusted according to actual conditions and requirements. Generally, the preset fluctuation threshold may be 0.02 to 0.05. If the detected clarity fluctuation value is less than the preset fluctuation threshold, it can be determined that the camera under test is not out of focus in the target scene; if the detected clarity fluctuation value is greater than or equal to the preset fluctuation threshold, it can be determined that the camera under test is out of focus in the target scene.

[0095] An image detection method provided by an embodiment of the present application, through a camera to be tested, obtains multiple images to be tested corresponding to a target scene; obtains the clarity value of each image to be tested according to the Laplace operator; determines the clarity fluctuation value between the multiple images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested, wherein the first image to be tested, the second image to be tested and the third image to be tested are any one of the multiple images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are all different images; when it is detected that the clarity fluctuation value is less than a preset fluctuation threshold, it is determined that the camera to be tested is not out of focus in the target scene. Through this scheme, the Laplace operator can be used to quickly output the judgment of whether the photo in the scene is out of focus, saving time, improving efficiency, and avoiding the problem of large differences in the accuracy of manual judgment of whether it is out of focus, effectively improving the accuracy and efficiency of out-of-focus judgment.

[0096] like Figure 2 As shown, Figure 2 A flowchart of an image detection method provided in an embodiment of the present application, the method may also include the following steps:

[0097] 201. Acquire a plurality of images to be tested corresponding to a target scene through a camera to be tested.

[0098] In the embodiment of the present application, for the description of step 201, please refer to the detailed description of step 101 in the above embodiment, and the embodiment of the present application will not be repeated.

[0099] 202. Perform target object detection on each image to be tested to obtain a region detection frame corresponding to each image to be tested.

[0100] In the embodiment of the present application, since each image to be tested includes a large number of pixels, if each pixel is calculated with the Laplace operator, it will lead to the problem of excessive calculation and low efficiency. In addition, not all pixels at all positions in each image to be tested of the target scene need to be calculated, only important areas need to be calculated. Therefore, a region detection frame can be determined in each image to be tested, and only the pixels within the region detection frame need to be calculated subsequently.

[0101] In some embodiments, the area detection frame can be generated based on the target object in the image to be tested or a preset ratio. Specifically, target object detection is performed on each image to be tested to obtain a target object detection result; if the target object detection result indicates that there is a target object, a region detection frame corresponding to each image to be tested is generated based on the target object, and the target object is included in the region detection frame; if the target object detection result indicates that there is no target object, a region detection frame corresponding to each image to be tested is generated according to a preset ratio, and the region detection frame is located at the center of the image to be tested.

[0102] It should be noted that the target object can be a human face or a fixed object, that is, the object captured by the target scene. If the target object exists in the image to be tested, the area detection frame is generated according to the target object, so that the target object is included in the area detection frame; if the target object does not exist in the image to be tested, the area detection frame can be generated at the center of the image to be tested according to a preset ratio. The preset ratio can be 10%, 20%, etc. The preset ratio is the ratio between the size of the area detection frame and the size of the entire image to be tested.

[0103] In some embodiments, the region detection box may also be manually marked.

[0104] 203. According to the Laplace operator, a clarity value of the region detection frame is obtained.

[0105] In the embodiment of the present application, after the region detection frame of each image to be tested is generated, the clarity value of each region detection frame can be calculated according to the Laplacian operator.

[0106] In some embodiments, the clarity value of the area detection frame is obtained according to the Laplace operator, which may specifically include: obtaining the target pixel value of each pixel in the area detection frame; performing weighted calculation on the target pixel value of each pixel and the Laplace operator to obtain the clarity value of the area detection frame.

[0107] It should be noted that the target pixel value may be the pixel value of the R component of each pixel, where the R component is red (R) in RGB, that is, the R pixel value of each pixel is multiplied by the Laplace operator to obtain the clarity value of the area detection frame.

[0108] In some embodiments, the Laplacian operator can be in the form of a matrix. The order and elements of the matrix can be set according to actual conditions and requirements. However, in order to balance accuracy and efficiency, a third-order matrix can be used for calculation. For example, the Laplacian operator can be expressed as

[0109] Furthermore, the target pixel value of each pixel point and the Laplace operator are weightedly calculated to obtain the clarity value of the area detection frame, which may specifically include: weighted calculation of the target pixel value of each pixel point and the Laplace operator to obtain the Laplace vector value corresponding to each pixel point; normalizing the Laplace vector value corresponding to each pixel point to obtain the clarity value of the area detection frame.

[0110] It should be noted that, since the clarity value of each area detection frame needs to be compared in the future, the clarity value of each area detection frame needs to be in the same measurement standard. Therefore, after weighted calculation according to the Laplace operator, normalization processing is required to make the Laplace vector value of each image to be tested normalized to a value between 0 and 1. The value between 0 and 1 obtained after normalization can be expressed as the clarity value of the area detection frame.

[0111] Normalization is a data processing method that aims to scale data to a standard range, usually between [0, 1], to simplify calculations, eliminate scale differences, and improve model performance and training stability. Normalization is to scale the data so that it falls into a small specific interval, such as [0, 1]. Doing so can eliminate scale differences between different features and make all data have a uniform scale.

[0112] 204. Determine the clarity value of the area detection frame as the clarity value of the image to be tested.

[0113] 205 . Obtain a first difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested, and a second difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested.

[0114] In the embodiment of the present application, the difference between the clarity values ​​of two adjacent images to be tested is made, that is, the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested is made to obtain a first difference; the difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested is made to obtain a second difference.

[0115] It should be noted that the above only shows the first difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested, and the second difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested. It does not mean that only two differences are obtained, but it means that for all images to be tested, any two adjacent images to be tested are subjected to clarity difference to obtain the corresponding difference.

[0116] For example, assuming that there are N images to be tested, the calculated clarity values ​​can be expressed as S1, S2, S3, ..., S N-1 , S N , then we can calculate the first difference between S1 and S2, the second difference between S2 and S3, and the third difference between S3 and S4, until S N-2 and S N-1 The difference between the N-2th and S N-1 and S N The N-1th difference between them, thus N-1 differences can be obtained.

[0117] 206. Determine an average value of the first difference and the second difference as a clarity fluctuation value between the multiple images to be tested.

[0118] In the embodiment of the present application, an average value is calculated for the first difference and the second difference, and the average value is determined as the clarity fluctuation value between the multiple images to be tested.

[0119] 207. When it is detected that the clarity fluctuation value is less than a preset fluctuation threshold, it is determined that the camera to be tested is not out of focus in the target scene.

[0120] In the embodiment of the present application, for the description of step 207, please refer to the detailed description of step 104 in the above embodiment, which will not be repeated in the embodiment of the present application.

[0121] In some embodiments, multiple scenes can be analyzed in sequence to give the out-of-focus conditions of all scenes, and then an XML file or a CSV file can be output to display the output results and automatically calculate the statistics.

[0122] An image detection method provided in an embodiment of the present application can quickly output the judgment of whether a photo in a scene is out of focus through the Laplace operator through the camera to be tested, thereby saving time, improving efficiency, and avoiding the problem of large differences in the accuracy of manual judgment of whether it is out of focus, thereby effectively improving the accuracy and efficiency of out-of-focus judgment.

[0123] like Figure 3 As shown, an embodiment of the present application provides an image detection device, which may include:

[0124] The acquisition module 301 is used to acquire a plurality of images to be tested corresponding to the target scene through the camera to be tested;

[0125] The processing module 302 is used to obtain the clarity value of each image to be tested according to the Laplace operator;

[0126] The processing module 302 is further used to determine the clarity fluctuation value between the multiple images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested, wherein the first image to be tested, the second image to be tested and the third image to be tested are any one of the multiple images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are different images;

[0127] The processing module 302 is further configured to determine that the camera to be tested is not out of focus in the target scene when it is detected that the clarity fluctuation value is less than a preset fluctuation threshold.

[0128] As an optional implementation, in the second aspect of the embodiment of the present application, the processing module 302 is specifically used to perform target object detection on each image to be tested, and obtain a region detection frame corresponding to each image to be tested;

[0129] The processing module 302 is specifically used to obtain the clarity value of the area detection frame according to the Laplace operator;

[0130] The processing module 302 is specifically configured to determine the clarity value of the area detection frame as the clarity value of the image to be tested.

[0131] As an optional implementation, in the second aspect of the embodiment of the present application, the acquisition module 301 is specifically used to acquire the target pixel value of each pixel point in the area detection frame;

[0132] The processing module 302 is specifically used to perform weighted calculation on the target pixel value of each pixel point and the Laplace operator to obtain the clarity value of the area detection frame.

[0133] As an optional implementation, in the second aspect of the embodiment of the present application, the processing module 302 is specifically used to perform weighted calculation on the target pixel value of each pixel and the Laplace operator to obtain the Laplace vector value corresponding to each pixel;

[0134] The processing module 302 is specifically used to perform normalization processing on the Laplace vector value corresponding to each pixel point to obtain the clarity value of the area detection frame.

[0135] As an optional implementation, in the second aspect of the embodiment of the present application, the processing module 302 is specifically configured to perform grayscale processing on a plurality of images to be tested to obtain a plurality of grayscale images;

[0136] The processing module 302 is specifically configured to obtain a clarity value of each grayscale image according to a Laplace operator.

[0137] As an optional implementation, in the second aspect of the embodiment of the present application, the acquisition module 301 is specifically used to respectively acquire a first difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested, and a second difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested;

[0138] The processing module 302 is specifically configured to determine an average value of the first difference and the second difference as a clarity fluctuation value between the plurality of images to be tested.

[0139] As an optional implementation, in the second aspect of the embodiment of the present application, the processing module 302 is specifically configured to perform target object detection on each image to be tested to obtain a target object detection result;

[0140] The processing module 302 is specifically configured to generate a region detection frame corresponding to each image to be detected according to the target object if the target object detection result indicates that the target object exists, and the region detection frame includes the target object;

[0141] The processing module 302 is specifically configured to generate a region detection frame corresponding to each image to be detected according to a preset ratio if the target object detection result indicates that the target object does not exist, and the region detection frame is located at the center of the image to be detected.

[0142] In the embodiments of the present application, each module can implement the image detection method provided in the above method embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0143] like Figure 4 As shown, an embodiment of the present application further provides an electronic device, which may include:

[0144] A memory 401 storing executable program codes;

[0145] a processor 402 coupled to the memory 401;

[0146] The processor 402 calls the executable program code stored in the memory 401 to execute the image detection method executed by the electronic device in the above-mentioned method embodiments.

[0147] An embodiment of the present application 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 image detection method in the above method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0148] An embodiment of the present application also provides a computer program product, which stores a computer program. When the computer program is executed by a processor, the various processes of the image detection method in the above method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0149] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media that include computer-usable program code.

[0150] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0151] In the present application, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0152] In this application, memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0153] In this application, a person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the computer-readable medium includes permanent and non-permanent, removable and non-removable storage media. The storage medium can implement information storage by any method or technology, and the information can be a computer-readable instruction, a data structure, a module of a program, or other data. Examples of computer storage media include, but are not limited to, Parallel Random Access Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Programmable Read-only Memory (PROM), Erasable Programmable Read Only Memory (EPROM), other types of Random Access Memory (RAM), Read-Only Memory (ROM), One-time Programmable Read-Only Memory (OTPROM), Electrically-Erasable Programmable Read-Only Memory (EEPROM), flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0154] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0155] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application. The above-mentioned multiple embodiments are not necessarily multiple independent embodiments. Dividing into multiple embodiments is only used to highlight the different technical features in different embodiments. Those skilled in the art should be aware that the above-mentioned multiple embodiments can also be combined in any way.

[0156] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0157] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0158] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0159] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.

[0160] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image detection method, characterized in that: The method comprises: Acquire multiple images to be tested corresponding to the target scene through the camera to be tested; According to the Laplace operator, the clarity value of each image to be tested is obtained; Determine the clarity fluctuation value between the plurality of images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the clarity value of the second image to be tested and the clarity value of the third image to be tested, wherein the first image to be tested, the second image to be tested and the third image to be tested are any one of the plurality of images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are all different images; When it is detected that the clarity fluctuation value is less than a preset fluctuation threshold, it is determined that the camera to be tested is not out of focus in the target scene.

2. The method according to claim 1, characterized in that The method of obtaining the definition value of each image to be tested according to the Laplace operator includes: Performing target object detection on each of the images to be tested to obtain a region detection frame corresponding to each of the images to be tested; Obtaining a clarity value of the region detection frame according to the Laplace operator; The clarity value of the area detection frame is determined as the clarity value of the image to be tested.

3. The method according to claim 2, characterized in that The obtaining the clarity value of the area detection frame according to the Laplace operator includes: Obtaining a target pixel value for each pixel in the area detection frame; The target pixel value of each pixel and the Laplace operator are weightedly calculated to obtain a clarity value of the area detection frame.

4. The method according to claim 3, characterized in that The step of performing weighted calculation on the target pixel value of each pixel and the Laplace operator to obtain the clarity value of the area detection frame includes: Performing weighted calculation on the target pixel value of each pixel and the Laplace operator to obtain a Laplace vector value corresponding to each pixel; The Laplace vector value corresponding to each pixel point is normalized to obtain a clarity value of the area detection frame.

5. The method according to any one of claims 1 to 4, characterized in that: The method of obtaining the definition value of each image to be tested according to the Laplace operator includes: Performing grayscale processing on the multiple images to be tested to obtain multiple grayscale images; According to the Laplace operator, the clarity value of each grayscale image is obtained.

6. The method according to claim 1, characterized in that The step of determining the clarity fluctuation value between the plurality of images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the clarity value of the second image to be tested and the clarity value of the third image to be tested comprises: Respectively acquiring a first difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested, and a second difference between the clarity value of the second image to be tested and the clarity value of the third image to be tested; An average value of the first difference and the second difference is determined as a clarity fluctuation value between the plurality of images to be tested.

7. The method according to claim 2, characterized in that The performing target object detection on each of the images to be tested to obtain a region detection frame corresponding to each of the images to be tested includes: Performing target object detection on each of the images to be tested to obtain a target object detection result; If the target object detection result indicates that a target object exists, generating a region detection frame corresponding to each image to be detected according to the target object, wherein the region detection frame includes the target object; If the target object detection result indicates that the target object does not exist, a region detection frame corresponding to each of the images to be detected is generated according to a preset ratio, and the region detection frame is located at the center of the image to be detected.

8. An image detection device, characterized in that: include: An acquisition module is used to acquire a plurality of images to be tested corresponding to the target scene through the camera to be tested; A processing module, used for obtaining a definition value of each image to be tested according to a Laplace operator; The processing module is further used to determine the clarity fluctuation value between the multiple images to be tested according to the difference between the clarity value of the first image to be tested and the clarity value of the second image to be tested and the clarity value of the second image to be tested and the clarity value of the third image to be tested, wherein the first image to be tested, the second image to be tested and the third image to be tested are any one of the multiple images to be tested, and the first image to be tested, the second image to be tested and the third image to be tested are different images; The processing module is further configured to determine that the camera to be tested is not out of focus in the target scene when it is detected that the clarity fluctuation value is less than a preset fluctuation threshold.

9. An electronic device, characterized in that: include: A memory storing executable program code; and a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the image detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the image detection method according to any one of claims 1 to 7 is implemented.