Image quality detection method and device, electronic equipment and storage medium
By detecting reflection, brightness, sharpness, and angle during the image acquisition stage, image quality is determined, solving the problems of invalid image uploads and large data processing volume, and achieving efficient image quality control.
Patent Information
- Application Number
- CN202011194528.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-30
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2040-10-30
AI Technical Summary
In existing technologies, the lack of image quality detection during the image acquisition stage leads to a large number of invalid images being uploaded, resulting in a large amount of data processing required for invalid images.
By acquiring the reflection detection results, brightness detection results, sharpness detection results, and angle detection results of the current image captured by the shooting device, the quality of the current image is determined to be acceptable, thus avoiding the shooting and uploading of unacceptable images.
This reduces the amount of invalid images uploaded and the amount of data processed, improves image capture quality, and reduces the burden of subsequent recognition or detection.
Smart Images

Figure CN114529491B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to an image quality detection method and device, electronic equipment and a computer readable storage medium. BACKGROUND
[0002] With the rapid development of image processing technology, the application of images is also increasing, and specific business detection or recognition can be performed based on images. For example, in the logistics field, it is usually necessary for a courier to take a picture of a logistics package signed by a customer, so as to subsequently check whether the logistics package is damaged or not.
[0003] Image quality is of great significance for subsequent recognition. The higher the quality of the collected image, the more conducive it is to subsequent image detection or recognition. Image reflection, image over-brightness or over-darkness, image blur, or image tilt will all affect subsequent business detection or recognition. Therefore, the collection of such images with unqualified quality should be reduced to reduce the processing of invalid data for such images.
[0004] However, in the prior art, no quality detection is performed on the image during the image collection stage, resulting in a large number of invalid images being uploaded, a large amount of invalid image data being uploaded, and a large amount of invalid image data being processed. SUMMARY
[0005] The present application provides an image quality detection method, device, electronic equipment and computer readable storage medium, which aims to solve the problem of a large amount of invalid image data being uploaded and processed due to the lack of quality detection on the image being taken.
[0006] In a first aspect, the present application provides an image quality detection method, which comprises:
[0007] obtaining a current image captured by a shooting device;
[0008] obtaining a shooting quality parameter related to the current image, wherein the shooting quality parameter comprises at least one of a reflection detection result, a brightness detection result, a definition detection result and an angle detection result of the current image;
[0009] determining whether the quality of the current image is qualified according to the shooting quality parameter.
[0010] In a second aspect, the present application provides an image quality detection device, which comprises:
[0011] an acquisition unit configured to acquire a current image captured by a shooting device;
[0012] detecting a shooting quality parameter related to the current image, wherein the shooting quality parameter comprises at least one of a glare detection result, a brightness detection result, a definition detection result, and an angle detection result of the current image;
[0013] determining whether the quality of the current image is qualified according to the shooting quality parameter.
[0014] In a possible implementation of the present application, the detecting unit is specifically configured to:
[0015] obtain the saturation and the brightness of each pixel point in the current image;
[0016] determine a glare point in the current image according to the saturation, the brightness, and preset saturation and brightness thresholds;
[0017] determine a glare region of the current image according to the glare point, to obtain the glare detection result.
[0018] In a possible implementation of the present application, the detecting unit is specifically configured to:
[0019] obtain a historical image captured by the shooting device;
[0020] perform optical flow matching on the historical image and the current image, to obtain a motion direction of each pixel point in the current image;
[0021] cluster each pixel point in the current image according to the motion direction, to obtain a large set of clustered points with consistent motion directions and a small set of clustered points with inconsistent motion directions;
[0022] determine a glare point of the current image according to each point in the small set of clustered points, to obtain the glare detection result.
[0023] In a possible implementation of the present application, the determining unit is specifically configured to:
[0024] when the glare detection result is that the image has glare, determine that the quality of the current image is unqualified.
[0025] In a possible implementation of the present application, the detecting unit is specifically configured to:
[0026] obtain an N-color gray scale image of the current image, wherein N is a positive integer greater than 2;
[0027] obtain a proportion of pixel points of each color in the N-color gray scale image;
[0028] determine the brightness detection result according to the proportion of pixel points.
[0029] In a possible implementation of the present application, the determining unit is specifically configured to:
[0030] When the brightness detection result is that the image is too bright or the image is too dark, it is determined that the quality of the current image is unqualified.
[0031] In a possible implementation of the present application, the sharpness detection result includes image blur, and the detecting unit is further configured to:
[0032] perform edge detection processing on the current image to obtain an edge distribution variance of the current image;
[0033] determine whether the current image is blurred according to the edge distribution variance and a preset blur threshold, to obtain a sharpness detection result of the current image, wherein the blur threshold is related to the brightness detection result;
[0034] In a possible implementation of the present application, the determining unit is specifically configured to:
[0035] When the sharpness detection result is that the image is blurred, it is determined that the quality of the current image is unqualified.
[0036] In a possible implementation of the present application, the angle detection result includes image tilt, and the detecting unit is specifically configured to:
[0037] obtain a shooting device parameter related to the current image, wherein the shooting device parameter includes a deviation angle of the shooting device relative to a scene to be shot and acceleration of the shooting device;
[0038] determine whether the current image is tilted according to the shooting device parameter, to obtain the angle detection result;
[0039] In a possible implementation of the present application, the determining unit is specifically configured to:
[0040] When the angle detection result is that the image is tilted, it is determined that the quality of the current image is unqualified.
[0041] In a possible implementation of the present application, the image quality detection apparatus further includes a prompting unit, and the prompting unit is specifically configured to:
[0042] When it is determined that the quality of the current image is unqualified, output prompt information that the image quality is unqualified to the shooting device.
[0043] In a possible implementation of the present application, the image quality detection apparatus further includes a loading unit, and the loading unit is specifically configured to:
[0044] The image quality detection method is loaded through a wasm file format.
[0045] In a third aspect, the present application also provides an electronic device, which comprises a processor and a memory, and the memory stores a computer program, and the processor executes the steps of any of the image quality detection methods provided by the present application when invoking the computer program in the memory.
[0046] In a fourth aspect, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is loaded by a processor to execute the steps of the image quality detection method.
[0047] In the present application, when the shooting device captures an image, the shooting quality parameters such as the reflection detection result, the brightness detection result, the definition detection result and the angle detection result of the current image captured by the shooting device are obtained, and the shooting quality parameters reflecting the image quality of the current image such as the reflection detection result, the brightness detection result, the definition detection result and the angle detection result are used to determine whether the quality of the current image is qualified. Since whether the current image captured by the shooting device is qualified can be detected in time when the image is captured, the shooting of unqualified images can be avoided, and the uploading of unqualified images (i.e. invalid images) can be reduced, thereby achieving the purpose of reducing the data processing amount of invalid images. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0049] Figure 1 is a scene schematic diagram of the image quality detection system provided by the embodiments of the present application;
[0050] Figure 2 is a flowchart of the image quality detection method provided by the embodiments of the present application;
[0051] Figure 3 is a schematic diagram of the reflection area provided in the embodiments of the present application;
[0052] Figure 4 is an embodiment flowchart of the reflection detection provided in the embodiments of the present application;
[0053] Figure 5 is an embodiment schematic diagram of the N-color gray scale provided in the embodiments of the present application;
[0054] Figure 6 is an embodiment schematic diagram of a shooting scene provided in an embodiment of the present application;
[0055] Figure 7 is an embodiment structure schematic diagram of an image quality detection device provided in an embodiment of the present application;
[0056] Figure 8 is an embodiment structure schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, any person skilled in the art can obtain all other embodiments without creative work.
[0058] In the description of the embodiments of the present application, it should be understood that the terms “first”, “second” are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with “first”, “second” can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of “multiple” is two or more, unless otherwise specifically limited.
[0059] The following description is presented to enable any person skilled in the art to practice the present application. In the following description, details are set forth for the purpose of explanation. It will be appreciated that one of ordinary skill in the art can realize and implement the present application without using these specific details. In other instances, well-known processes have not been described in detail so as not to obscure the description of the embodiments of the present application. Accordingly, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
[0060] The embodiments of the present application provide an image quality detection method, device, electronic device and computer readable storage medium. The image quality detection device can be integrated in an electronic device, which can be a server, a terminal or other device.
[0061] First, before introducing the embodiments of the present application, the related content about the application background of the embodiments of the present application is introduced.
[0062] Image quality has important guiding significance for subsequent identification. The higher the quality of the collected image, the more conducive to subsequent image detection or identification. Without image quality detection in the image acquisition stage, more invalid images will be uploaded, causing more interference to subsequent image detection and identification.
[0063] For example, in the logistics field, when the express delivery personnel conducts business inspection and takes pictures, it is easy to take pictures with reflections, over-bright or over-dark images, blurred images, and tilted shooting angles, which brings great inconvenience to downstream image detection and identification. Therefore, it is necessary to perform real-time detection of image acquisition standardization (reflection, over-bright or over-dark, blur, and angle tilt) when taking pictures.
[0064] Based on the above defects of the existing related technologies, the embodiments of the present application provide an image quality detection method, which at least partially overcomes the defects of the existing related technologies.
[0065] The execution subject of the image quality detection method of the embodiments of the present application can be an image quality detection device provided by the embodiments of the present application, or a server device, a physical host, or a user equipment (User Equipment, UE) and other different types of electronic devices integrated with the image quality detection device, wherein the image quality detection device can be realized in hardware or software, and the UE can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a palm computer, a desktop computer, or a personal digital assistant (Personal Digital Assistant, PDA).
[0066] The electronic device can run in a separate mode or in a device cluster mode. By applying the image quality detection method provided by the embodiments of the present application, the quality of the image being taken can be detected, the upload amount of invalid images can be reduced, and the data processing amount of invalid images can be reduced.
[0067] Referring to Figure 1 , Figure 1 is a scene schematic diagram of an image quality detection system provided by the embodiments of the present application. The image quality detection system can include an electronic device 100, and the electronic device 100 is integrated with an image quality detection device. For example, the electronic device can obtain a current image captured by a shooting device; obtain a shooting quality parameter related to the current image, wherein the shooting quality parameter includes at least one of a reflection detection result, a brightness detection result, a definition detection result, and an angle detection result of the current image; and determine whether the quality of the current image is qualified according to the shooting quality parameter.
[0068] In addition, as Figure 1As shown, the image quality detection system can further include a memory 200 for storing data, such as storing image data, video data.
[0069] It should be noted that Figure 1 The scene diagram of the image quality detection system shown is only an example, and the image quality detection system and scene described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of the image quality detection system and the appearance of new business scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0070] Next, the image quality detection method provided by the embodiments of the present application will be introduced. In the embodiments of the present application, an electronic device is used as the execution subject. In order to simplify and facilitate the description, the execution subject will be omitted in the subsequent method embodiments.
[0071] Referring to Figure 2 , Figure 2 is a flow diagram of the image quality detection method provided by the embodiments of the present application. It should be noted that although a logical sequence is shown in the flow diagram, in some cases, the steps shown or described herein can be performed in an order different from that shown. The image quality detection method includes steps S10-S30, wherein:
[0072] S10, acquiring a current image captured by a shooting device.
[0073] The current image refers to the picture of the scene to be photographed. For example, if the picture of the scene to be photographed is a courier package, the picture of the courier package captured by the shooting device when it is ready to shoot the courier package is the current image.
[0074] The shooting device is used to shoot images to provide images for subsequent business scenarios.
[0075] In actual application, the shooting device can establish a communication connection with the electronic device. Alternatively, the electronic device of the embodiments of the present application can include a camera in hardware, i.e., the electronic device can also directly serve as a shooting device. The current image of the scene to be photographed can be captured by the shooting device.
[0076] In some embodiments, the shooting device can capture the current image based on an H5 page, a mini-program page or an APP page. The H5 page or the mini-program page can be carried on the electronic device. For example, the shooting device can capture the current image of a package based on a mini-program of a certain express company.
[0077] S20, acquiring a shooting quality parameter related to the current image.
[0078] The shooting quality parameter includes at least one of a reflection detection result, a brightness detection result, a definition detection result, and an angle detection result of the current image.
[0079] The reflection detection result is used to indicate whether the current image captured by the shooting device has reflection. For example, the reflection detection result can include that the image has reflection, and the image has no reflection. Here, the reflection detection result is only an example, and the level of the reflection detection result can be further divided according to actual conditions, which is not limited thereto. For example, the reflection detection result can be further divided into “large-area reflection”, “small-area reflection”, and “no reflection”. Further, according to the image reflection degree requirement of the business scenario, it is determined in step S30 whether the quality of the current image is qualified according to the reflection detection result (for example, when the reflection detection result is “large-area reflection”, it is determined that the quality of the current image is unqualified, and when the reflection detection result is “small-area reflection” or “no reflection”, it is determined that the quality of the current image is qualified).
[0080] The brightness detection result is used to indicate whether the current image captured by the shooting device is too bright or too dark. For example, the brightness detection result can include that the image is too bright, the image is too dark, and the image brightness is normal. Here, the brightness detection result is only an example, and the level of the brightness detection result can be further divided according to actual conditions, which is not limited thereto. For example, the brightness detection result can be further divided into “first-level high brightness”, “second-level high brightness”, “normal brightness”, “first-level dark”, and “second-level dark”. Further, according to the image brightness requirement of the business scenario, it is determined in step S30 whether the quality of the current image is qualified according to the brightness detection result (for example, when the brightness detection result is “first-level high brightness” or “first-level dark”, it is determined that the quality of the current image is unqualified, and when the brightness detection result is “second-level high brightness”, “normal brightness”, or “second-level dark”, it is determined that the quality of the current image is qualified).
[0081] The definition detection result is used to indicate whether the current image captured by the shooting device is blurred. For example, the definition detection result can include that the image is blurred and the image is clear. Here, the definition detection result is only an example, and the level of the definition detection result can be further divided according to actual conditions, which is not limited thereto. For example, the definition detection result can be further divided into “first-level definition”, “second-level definition”, and “third-level definition”. Further, according to the definition requirement of the business scenario, it is determined in step S30 whether the quality of the current image is qualified according to the definition detection result (for example, when the definition detection result is “first-level definition”, it is determined that the quality of the current image is unqualified, and when the definition detection result is “second-level definition” or “third-level definition”, it is determined that the quality of the current image is qualified).
[0082] The angle detection result is used to indicate whether the current image captured by the shooting device is tilted. For example, the angle detection result can include that the image is tilted, and the image is not tilted. Here, the angle detection result is only an example, and the level division of the angle detection result can also be made according to actual conditions, which is not limited thereto; for example, the angle detection result can also be divided into “0°<tilt angle≤10°”, “10°<tilt angle≤20°”, and “20°<tilt angle”. Further, according to the shooting angle requirement of the business scenario, it is determined in step S30 whether the quality of the current image is qualified according to the angle detection result (for example, when the angle detection result is “20°<tilt angle”, it is determined that the quality of the current image is not qualified, and when the angle detection result is “0°<tilt angle≤10°” or “10°<tilt angle≤20°”, it is determined that the quality of the current image is qualified).
[0083] S30, determining whether the quality of the current image is qualified according to the shooting quality parameter.
[0084] In some embodiments, the shooting quality parameter is a reflection detection result, and at this time, step S30 can specifically include: when the reflection detection result indicates that the current image captured by the shooting device has reflection, it is determined that the quality of the current image is not qualified. For example, in a specific example, the reflection detection result includes that the image has reflection, and step S30 can specifically include:
[0085] When the reflection detection result is that the image has reflection, it is determined that the quality of the current image is not qualified.
[0086] Since the image with reflection will affect the normal recognition of the subsequent image, by detecting whether the image has reflection to determine whether the quality of the current image is qualified, the shooting of the image with reflection can be reduced, the shooting quality of the image is improved, and the data processing amount of identifying or detecting the unqualified image is reduced.
[0087] In some embodiments, the shooting quality parameter is a brightness detection result, and at this time, step S30 can specifically include: when the brightness detection result indicates that the current image captured by the shooting device is too bright or too dark, it is determined that the quality of the current image is not qualified. For example, in a specific example, the brightness detection result includes that the image is too bright or the image is too dark, and step S30 can specifically include:
[0088] When the brightness detection result is that the image is too bright or the image is too dark, it is determined that the quality of the current image is not qualified.
[0089] Since the image that is too bright or the image that is too dark will affect the normal recognition of the subsequent image, by detecting whether the image is too bright or too dark to determine whether the quality of the current image is qualified, the shooting of the image that is too bright or too dark can be reduced, the shooting quality of the image is improved, and the data processing amount of identifying or detecting the unqualified image is reduced.
[0090] In some embodiments, the shooting quality parameter is a sharpness detection result, and step S30 can specifically include: determining that the current image quality is unqualified when the sharpness detection result indicates that the current image captured by the shooting device is blurred. For example, in a specific example, the sharpness detection result includes image blur, and step S30 can specifically include:
[0091] When the sharpness detection result is image blur, it is determined that the current image quality is unqualified.
[0092] Since image blur will affect the normal recognition of subsequent images, by detecting whether the image is blurred to determine whether the quality of the current image is qualified, the shooting of blurred images can be reduced, the shooting quality of the image can be improved, and the data processing amount of identifying or detecting unqualified images can be reduced.
[0093] In some embodiments, the shooting quality parameter is an angle detection result, and step S30 can specifically include: determining that the current image quality is unqualified when the angle detection result indicates that the current image captured by the shooting device is tilted. For example, in a specific example, the angle detection result includes image tilt, and step S30 can specifically include:
[0094] When the angle detection result is image tilt, it is determined that the quality of the current image is unqualified.
[0095] Since image tilt will affect the normal recognition of subsequent images, by detecting whether the image is tilted to determine whether the quality of the current image is qualified, the shooting of tilted images can be reduced, the shooting quality of the image can be improved, and the data processing amount of identifying or detecting unqualified images can be reduced.
[0096] As can be seen from the above, when the shooting device captures an image, the shooting quality parameters such as the reflection detection result, the brightness detection result, the sharpness detection result and the angle detection result of the current image captured by the shooting device are obtained, and whether the quality of the current image is qualified is determined according to the shooting quality parameters reflecting the image quality of the current image such as the reflection detection result, the brightness detection result, the sharpness detection result and the angle detection result. Since it can be detected in time whether the current image captured by the shooting device is qualified when the image is shot, the shooting of unqualified images can be avoided, and the uploading of unqualified images (i.e. invalid images) can be reduced, thereby achieving the purpose of reducing the data processing amount of invalid images.
[0097] In some embodiments of the present application, the reflection of the current image captured by the shooting device can also be directly detected, that is, step S20 can specifically include: performing reflection detection processing on the current image to obtain the reflection detection result of the current image.
[0098] In some embodiments, the step of "performing a reflection detection process on the current image to obtain a reflection detection result of the current image" can specifically include the following steps a1-a3, wherein:
[0099] a1, obtaining the saturation and brightness of each pixel point in the current image.
[0100] The current image captured by the shooting device can be an image in color format (e.g., BRG image format, RGB image format, etc.).
[0101] Specifically, the current image is decomposed into HSV (Hue, Saturation, Value) to obtain the H channel value (i.e., hue), S channel value (i.e., saturation), and V channel value (i.e., brightness) of each pixel point i in the current image, thereby obtaining the hue, saturation, and brightness of each pixel point in the current image. Wherein H represents hue, S represents saturation, and V represents brightness.
[0102] Taking the hue value range of 0°-360°, the saturation value range of 0%-100%, and the brightness of 0%-100% as an example. For example, the image format of the current image is BRG, the current image is converted from BRG to HSV to obtain the hue, saturation, and brightness of each pixel point in the current image (e.g., the hue of pixel point i in the current image is 30°, the saturation is 20%, and the brightness is 50%). For another example, the image format of the current image is RGB, and the current image is converted from BRG to HSV to obtain the hue, saturation, and brightness of each pixel point in the current image. Wherein, the conversion from BRG to HSV or the conversion from RGB to HSV is a prior art algorithm, and specific reference can be made to the prior art algorithm of BRG to HSV conversion or the prior art algorithm of RGB to HSV conversion, which will not be described here.
[0103] a2, determining the reflection point in the current image according to the saturation, the brightness, and the preset saturation threshold and brightness threshold.
[0104] The reflection point refers to a pixel point in the current image whose saturation and brightness both satisfy the preset value range.
[0105] Specifically, in some embodiments, from the current image, find out the pixel point whose saturation is less than the preset saturation threshold and whose brightness is greater than the preset brightness threshold as the reflection point of the current image, to obtain the set F of reflection points in the current image.
[0106] For example, the preset saturation threshold is 20%, and the preset lightness threshold is 90%. The saturation of the pixel points 1, 2, 3, 4, and 5 in the current image is 18%, 10%, 10%, 50%, and 50% respectively, and the lightness is 95%, 50%, 97%, 91%, and 60% respectively. It can be determined that the pixel points 1 and 3 are the reflection points in the current image.
[0107] The above saturation threshold and lightness threshold are only examples, and can be adjusted according to actual needs, without being limited thereto. The above “saturation less than the preset saturation threshold and lightness greater than the preset lightness threshold” is only an example of the value range that the saturation and lightness of the reflection point should satisfy, and the value range that the saturation and lightness of the reflection point should satisfy can be adjusted according to actual needs, without being limited thereto.
[0108] a3. determining a reflection region of the current image according to the reflection point, to obtain the reflection detection result.
[0109] The reflection region refers to a region formed by the reflection points that are connected in the current image. There can be multiple reflection regions j, and the number of reflection points in each reflection region j is greater than or equal to 1.
[0110] Specifically, according to the set F of reflection points in the current image, the reflection region j formed by the reflection points that are connected in the current image is determined, and thus the reflection detection result of the current image is obtained.
[0111] For example, in step a2, for the pixel point i in the current image, if the pixel point i is a reflection point, the pixel value of the pixel point i is set to 1; if the pixel point i is not a reflection point, the pixel value of the pixel point i is set to 0. Then, the connected pixel points with a pixel value of 1 are taken as the reflection region of the current image.
[0112] As can be seen from the above, by detecting whether the saturation, lightness, etc. of each pixel point in the current image meets the preset value range, the reflection point in the current image can be found, and thus the reflection detection result of the current image is obtained.
[0113] Further, in order to reduce the misjudgment rate of the reflection detection result, in some embodiments of the present application, in view of the characteristic that “the image reflection is generally the reflection of a region with a certain area”, after determining the reflection region j in the current image, it is further detected whether the area of the reflection region j is less than a preset area threshold. If it is detected that the area of the reflection region j is less than the preset area threshold, the reflection region j with an area less than the preset area threshold is discarded; if it is detected that the area of the reflection region j is greater than or equal to the preset area threshold, the reflection region j with an area greater than or equal to the preset area threshold is retained.
[0114] For example, if the preset area threshold is 9 pixels, and the areas of reflective areas a, b, and c are 5 pixels, 7 pixels, and 20 pixels respectively, then reflective areas a and b are discarded, and reflective area c is retained.
[0115] It is evident that filtering out reflective areas smaller than a preset area threshold can reduce the false positive rate of reflective detection results. Furthermore, since small areas of reflection have no impact on subsequent image recognition or detection, they can be ignored to avoid placing excessively high demands on the image quality required for subsequent detection or recognition, which would make image capture more difficult.
[0116] Furthermore, in order to reduce the false judgment rate of reflection detection results, in some embodiments of this application, based on the characteristic that "the closer the pixel is to the center point in the reflection area, the greater the reflection degree", after determining the reflection area j, the reliability of the reflection area is further verified.
[0117] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a reflective area provided in an embodiment of this application.
[0118] One method for verifying the reliability of a reflective area is to obtain the center point C of the reflective area j. j And in the reflective area j, excluding the center point C j Find any point P outside the boundary. Then, obtain the center point C. j Any point P0 between P and the line formed by P. Finally, compare point C. j Does the lightness of point C (denoted as V1), the lightness of point P (denoted as V2), and the lightness of point P0 (denoted as V3) satisfy the following condition: V1 > V3 > V2? If point C... j If the brightness relationship between points P and P0 satisfies V1>V3>V2, then the detection of reflective area j is accurate. If point C... j If the brightness relationship between point P and point P0 does not satisfy V1>V3>V2, then the detection of reflective area j is incorrect, and reflective area j is discarded.
[0119] Because the reflection detection methods provided in steps a1 to a3 above can only detect strong reflections in an image, such as sunlight and strong light, it is difficult to detect weak reflections, such as those from plastic film. To improve the detection capability of reflective areas in an image, in some embodiments, the step of "performing reflection detection processing on the current image to obtain the reflection detection result of the current image" may specifically include the following steps b1 to b4, wherein:
[0120] b1. Obtain historical images captured by the shooting device.
[0121] The historical image is acquired in a similar manner to the current image, and details can be referred to the above description of the acquisition of the current image, which will not be repeated here. The difference is that the capture time of the current image lags behind the capture time of the historical image.
[0122] For example, when the shooting device normally shoots an image, it will capture a to-be-shot picture in advance. The to-be-shot picture captured by the shooting device at t1 is the historical image, and the to-be-shot picture captured by the shooting device at t2 is the current image; wherein t2 lags behind t1. The to-be-shot picture captured by the shooting device refers to a picture that has not been shot, rather than an image picture that has been shot, that is, both the current image and the historical image are pictures that have not been shot.
[0123] In the embodiments of the present application, in order to detect whether the image quality is qualified in time when the image is shot, the current image and the historical image are taken as examples of the to-be-shot picture captured by the shooting device. It can be understood that the current image and the historical image can also be images shot by the shooting device, that is, the method provided in the embodiments of the present application is also applicable to detecting whether the image that has been shot is qualified.
[0124] b2, performing optical flow matching on the historical image and the current image to obtain the motion direction of each pixel point in the current image.
[0125] The optical flow method is a commonly used algorithm for detecting object motion through images. By performing optical flow matching on the historical image and the current image, the motion direction of each pixel point i in the current image can be obtained. The detection of the object motion direction through the optical flow method is an existing algorithm, and details can be referred to the existing optical flow method. For the sake of simplicity, details will not be repeated here.
[0126] Further, in order to reduce the data processing amount, in some embodiments, in view of the characteristic that "there is an obvious pixel boundary between the reflective light area and the non-reflective light area", the corner points in the historical image and the current image are further extracted, and then the motion direction of the corner points in the current image is determined based on the corner points. Here, the corner point refers to a junction point of pixel value mutation in the image, specifically, a pixel point at the junction of pixel value mutation in the image. For example, the corner points in the historical image can be extracted through the existing FAST corner point detection algorithm.
[0127] For example, first, the corner points in the historical image and the current image are extracted based on the existing FAST corner point detection algorithm. Then, the motion direction of the corner points in the current image is determined by performing optical flow matching on the pyramid LK algorithm.
[0128] The pyramid LK algorithm is based on the assumptions of gray-scale invariance, small motion, and spatial consistency, and establishes a pyramid to track and match (optical flow) the image.
[0129] b3, clustering each pixel in the current image according to the motion direction, to obtain a large set of clustered points with consistent motion direction, and a small set of clustered points with inconsistent motion direction with each point in the large set of clustered points.
[0130] In the embodiments of the present application, in view of the characteristics that the motion direction of the light reflection area is different from that of the non-light reflection area, and the area of the light reflection area is smaller than that of the non-light reflection area, the pixel points with consistent motion direction and relatively large pixel point proportion are detected as the non-light reflection area, and the pixel points with inconsistent motion direction with the non-light reflection area are detected as the light reflection points, so as to detect the light reflection points in the current image.
[0131] Specifically, step b3 can include the following steps (1)-(3), wherein:
[0132] (1) clustering each pixel point i in the current image to obtain a set of clustered points Qk with consistent motion direction k , wherein k is in the range of 1-N, and N represents the number of the set of clustered points Q k . The number of pixel points in each set of clustered points Q k is a positive integer greater than or equal to 1.
[0133] (2) comparing the number of pixel points in the N sets of clustered points Q k , and selecting the set of clustered points Q0 with the largest number of pixel points from the N sets of clustered points Q k as the large set of clustered points. The pixel points in the large set of clustered points represent the non-light reflection points in the current image.
[0134] (3) taking the set of pixel points other than those in the set of clustered points Q0 in the N sets of clustered points Q k as the small set of clustered points with inconsistent motion direction with each point in the large set of clustered points. The pixel points in the small set of clustered points represent the light reflection points in the current image.
[0135] The large set of clustered points refers to the set of clustered points Q0 with the largest number of pixel points in the N sets of clustered points Q k with consistent motion direction.
[0136] The small set of clustered points refers to the set of pixel points with inconsistent motion direction with the pixel points in the set of clustered points Q0 in the N sets of clustered points Q k .
[0137] Further, in order to reduce the data processing amount, the motion direction of the corner points in the current image is determined in step b2. At this time, the pixel points in steps (1)-(3) above refer to the corner points.
[0138] b4. determining the specular reflection points of the current image according to each point in the small set of clustered points, to obtain the specular reflection detection result.
[0139] In some embodiments, each pixel point in the small set of clustered points determined in step (3) is directly determined as a specular reflection point of the current image, to obtain the specular reflection detection result of the current image.
[0140] As can be seen from the above, for the characteristics that the motion direction of the specular reflection region is different from that of the non-specular reflection region, and the area of the specular reflection region is smaller than that of the non-specular reflection region, by means of optical flow matching, the pixel points with consistent motion direction and relatively large pixel point proportion are detected as the non-specular reflection region, and the pixel points with different motion direction from the non-specular reflection region are detected as the specular reflection points, so that the specular reflection points in the current image can be accurately detected.
[0141] Further, in order to reduce the misjudgment rate of the specular reflection points, in some embodiments, based on any pixel point (denoted as i0) in the large set of clustered points Q0 determined in step (2) and each pixel point (denoted as i x ) in the small set of clustered points determined in step (3), the target included angle (hereinafter referred to as the target included angle) formed by the pixel point i x and the pixel point i0 in the motion direction is further compared. It is detected whether the target included angle is greater than a preset included angle threshold. If the target included angle is greater than the preset included angle threshold, it is proved that the pixel point i x is a specular reflection point in the current image. If the target included angle is less than or equal to the preset included angle threshold, it is proved that the pixel point i x is not a specular reflection point in the current image.
[0142] By detecting whether the target included angle formed by the pixel point i x and the pixel point i0 in the motion direction is greater than the preset included angle threshold, it is determined whether the pixel point i x is a specular reflection point, so that some interference points in the current image can be filtered out, and the misjudgment rate of the specular reflection points is reduced.
[0143] Further, after determining the specular reflection points of the current image in step b4, the implementation manner of reducing the misjudgment rate of the specular reflection detection result in step a3 can be referred to, and the specular reflection detection result is optimized based on the specular reflection points of the current image determined in step b4, so that the purpose of further reducing the misjudgment rate of the specular reflection detection result can also be achieved.
[0144] Please refer to Figure 4 , Figure 4is an embodiment flow diagram of the reflection detection provided in the embodiments of the present application. In some embodiments, the reflection detection methods of steps a1-a3 and b1-b4 can be used in combination. Specifically, first, the reflection detection method of steps a1-a3 determines whether the current image has reflection. When the reflection detection method of steps a1-a3 determines that the current image has no reflection, the reflection detection method of steps b1-b4 is further enabled to determine whether the current image has reflection. When the reflection detection method of steps b1-b4 determines that the current image has no reflection, it is finally determined that the reflection detection result of the current image is that the image has no reflection. Otherwise, it is determined that the reflection detection result of the current image is that the image has reflection.
[0145] Since the reflection detection method of steps a1-a3 is relatively simple, it can quickly detect strong reflection in the image; the reflection detection method of steps b1-b4 can also detect weak reflection and has high detection accuracy; by combining the reflection detection method of steps a1-a3 and the reflection detection method of steps b1-b4 to detect reflection in the current image, the accuracy of reflection detection can be considered on the basis of quickly detecting whether the image has reflection.
[0146] In some embodiments of the present application, the current image captured by the shooting device can also be directly detected for whether it is too bright or too dark, that is, step S20 can specifically include: performing brightness detection processing on the current image to obtain a brightness detection result of the current image.
[0147] In some embodiments, the step of "performing brightness detection processing on the current image to obtain a brightness detection result of the current image" can specifically include steps c1-c3, wherein:
[0148] c1, obtaining an N-color gray scale diagram of the current image.
[0149] The N-color gray scale diagram refers to a distribution diagram reflecting the gray scale values of the pixel points in the current image. N is a positive integer greater than 2, and N represents the number of divisions of the gray scale value range of the pixel points in the current image.
[0150] Please refer to Figure 5 , Figure 5 is an embodiment diagram of the N-color gray scale diagram provided in the embodiments of the present application.
[0151] For example, the value range of the gray value of I pixel points in the current image is 0-255, the value range of the original gray value is divided into 16 equal gray value ranges: 0-15, 16-31,..., 240-255. Then, the number of pixel points in each gray value range in the current image is counted, such as the number of pixel points in 0-15, 16-31,..., 240-255 is 10, 20,..., 30. Finally, the number of pixel points in each gray value range can form a histogram (reflecting the number of pixel points in each gray value range of 16 equal parts in the current image), that is, a 16-color gray image.
[0152] c2, obtaining the pixel point proportion of each color in the N-color gray image.
[0153] Finally, the proportion of pixel points in each gray value range in the N-color gray image is counted, thereby obtaining the proportion of pixel points of each color in the N-color gray image.
[0154] c3, determining the brightness detection result according to the proportion of pixel points.
[0155] Wherein, the greater the gray value, the brighter the image; the smaller the gray value, the darker the image.
[0156] For example, when the proportion of pixel points with a gray value in the gray value range 0-15 is greater than a preset first proportion threshold, it is determined that the brightness detection result of the current image is that the image is too dark. When the proportion of pixel points with a gray value in the gray value range 240-255 is greater than a preset second proportion threshold, it is determined that the brightness detection result of the current image is that the image is too bright. When the proportion of pixel points with a gray value in the gray value range 0-15 is less than or equal to the preset first proportion threshold, and the proportion of pixel points with a gray value in the gray value range 240-255 is less than or equal to the preset second proportion threshold, it is determined that the brightness detection result of the current image is that the image is normal.
[0157] The above-mentioned way of determining the brightness detection result of the current image according to the proportion of pixel points is only an example, and can be adjusted and set according to actual conditions, without being limited thereto. For example, it can also be set that when the total proportion of pixel points with a gray value in the gray value range 0-15 and 16-31 is greater than a preset first proportion threshold, it is determined that the brightness detection result of the current image is that the image is too dark.
[0158] From the above, it can be seen that the greater the gray value, the brighter the image; the smaller the gray value, the darker the image. By obtaining the N-color gray image of the current image, the distribution of the gray value of the current image can be intuitively and quickly detected, and whether the current image is too bright or too dark can be intuitively and quickly detected.
[0159] In some embodiments of the present application, it is also possible to directly detect whether the current image captured by the shooting device is blurred, that is, step S20 can specifically include: performing edge detection processing on the current image to obtain an edge distribution variance of the current image; determining whether the current image is blurred according to the edge distribution variance and a preset blur threshold, to obtain a clarity detection result of the current image.
[0160] Specifically, first, edge detection processing is performed on the current image by a Laplace operator to obtain the number of edge pixels of various edges of the current image. Then, the edge distribution variance of the current image is calculated according to the number of edge pixels of the current image. Finally, whether the current image is blurred is determined according to the size relationship between the edge distribution variance and the preset blur threshold, so as to obtain the clarity detection result of the current image.
[0161] The edge distribution variance refers to the distribution variance of the number of edge pixels of various edges in the current image.
[0162] The edge detection by the Laplace algorithm is an existing edge detection algorithm, and is not described herein again for the sake of simplicity.
[0163] For example, if the edge distribution variance 20 is greater than the preset blur threshold 10, it is determined that the clarity detection result of the current image is image blur. If the edge distribution variance 5 is less than or equal to the preset blur threshold 10, the clarity detection result of the current image is image clarity.
[0164] The above-described preset blur threshold is only an example, and can be set according to actual needs, without being limited thereto.
[0165] In some embodiments, in order to improve the accuracy of the clarity detection result of the current image, the setting of the above-described preset blur threshold is related to the brightness detection result. Specifically, when the brightness detection result is image normal, the preset blur threshold is set as a first blur threshold; when the brightness detection result is image too bright or image too dark, the preset blur threshold is set as a second blur threshold. The first blur threshold is greater than the second blur threshold. When the brightness detection result is image too bright or image too dark, by lowering the preset blur threshold, it is possible to make a comprehensive judgment of different blur thresholds in combination with the brightness detection results in the three cases of too bright, too dark and normal, so as to improve the accuracy of the clarity detection result of the current image.
[0166] In some embodiments of the present application, the detection of whether the current image captured by the photographing device is tilted can also be directly performed, that is, step S20 can specifically include: obtaining photographing device parameters related to the current image; determining whether the current image is tilted according to the photographing device parameters to obtain the angle detection result. The photographing device parameters include a deviation angle of the photographing device relative to the scene to be photographed and an acceleration of the photographing device.
[0167] For example, the photographing device can further be built-in with an acceleration sensor and a gravity sensor. The photographing device can obtain the acceleration of the photographing device through the built-in acceleration sensor and obtain the deviation angle of the photographing device relative to the scene to be photographed through the built-in gravity sensor.
[0168] In some embodiments, the deviation angle of the photographing device relative to the scene to be photographed can be determined by formula (1) as follows:
[0169]
[0170] wherein, O x represents the deviation angle of the photographing device in the x-axis direction of the geographical coordinate system, O y represents the deviation angle of the photographing device in the y-axis direction of the geographical coordinate system, O z represents the deviation angle of the photographing device in the z-axis direction of the geographical coordinate system, V x represents the acceleration of the photographing device in the x-axis direction of the camera coordinate, V y represents the acceleration of the photographing device in the y-axis direction of the camera coordinate, V z represents the acceleration of the photographing device in the z-axis direction of the camera coordinate.
[0171] Then, according to the acceleration of the photographing device, it is determined whether the photographing device is shaken. If the photographing device is not shaken, further detection of whether the current image captured by the photographing device is tilted is performed.
[0172] Specifically, the detection of whether the current image captured by the photographing device is tilted specifically includes: determining whether the deviation angle of the photographing device relative to the scene to be photographed is less than a preset angle deviation threshold. If the deviation angle of the photographing device relative to the scene to be photographed is less than the preset angle deviation threshold, it is determined that the angle detection result of the current image is that the image is not tilted. If the deviation angle of the photographing device relative to the scene to be photographed is greater than or equal to the preset angle deviation threshold, it is determined that the angle detection result of the current image is that the image is tilted.
[0173] The specific manner of determining whether the photographing device shakes is: detecting whether the acceleration of the photographing device is less than a preset acceleration threshold value, if yes, determining that the photographing device is approximately static, that is, the photographing device does not shake. If no, determining that the photographing device shakes. For example, whether to further perform the step of detecting whether the current image captured by the photographing device is tilted is determined by the following formula (2).
[0174] Flag = V < V0 (formula 2)
[0175] Wherein, V is the acceleration of the photographing device (such as the modulus value of three-axis acceleration data); V0 is a preset acceleration threshold value; Flag is used to indicate whether V < V0 is true, when Flag is true, the step of detecting whether the current image captured by the photographing device is tilted is further performed; when Flag is false, the step of detecting whether the current image captured by the photographing device is tilted is not performed.
[0176] Please refer to Figure 6 , Figure 6 is an embodiment of the photographing scene provided in the embodiment of the present application. In some cases, the scene to be photographed is a vertical scene, that is, the picture to be photographed needs to be perpendicular (or close to perpendicular) to the ground, such as Figure 6 (a) shown. At this time, the specific manner of determining whether the current image is tilted can be determined by the following formula (3):
[0177] F1 = (fabs (O z -90) < T0) && (fabs (O x -90) < T0) || (fabs (O y -90) < T0) formula (3)
[0178] Wherein: T0 is a preset angle deviation threshold value (such as 15 degrees), O x represents the deviation angle of the photographing device in the x-axis direction of the geographical coordinate system, O y represents the deviation angle of the photographing device in the y-axis direction of the geographical coordinate system, and O z represents the deviation angle of the photographing device in the z-axis direction of the geographical coordinate system, F1 is used to indicate whether (fabs (O z -90) < T0) && (fabs (O x -90) < T0) || (fabs (O y -90) < T0) is true, when F1 is true, it is determined that the angle detection result of the current image is that the image is not tilted; when F1 is false, it is determined that the angle detection result of the current image is that the image is tilted.
[0179] In some cases, the scene to be photographed is a horizontal scene, i.e., the image to be photographed is parallel (or close to parallel) to the ground, such as Figure 6 (b) is shown. At this time, the specific manner of determining whether the current image is tilted can be determined by the following formula (4):
[0180] F2 = (fabs (O x -90) < T0) && (fabs (O y -90) < T0) formula (4)
[0181] Wherein: T0 is a preset angle deviation threshold (such as 15 degrees), O x represents the deviation angle of the shooting device in the x-axis direction of the geographic coordinate system, O y represents the deviation angle of the shooting device in the y-axis direction of the geographic coordinate system, O z represents the deviation angle of the shooting device in the z-axis direction of the geographic coordinate system, F2 is used to indicate whether (fabs (O x -90) < T0) && (fabs (O y -90) < T0) is true, F2 is true, and it is determined that the angle detection result of the current image is that the image is not tilted; F2 is false, and it is determined that the angle detection result of the current image is that the image is tilted.
[0182] As can be seen from the above, by obtaining the shooting device parameters related to the current image and determining whether the current image is tilted, it can be accurately detected whether the current image is tilted, thereby providing accurate data basis for subsequent determination of whether the image quality is qualified.
[0183] In order to improve the shooting quality of the image, in some embodiments of the present application, the image quality detection method further comprises: when it is determined that the quality of the current image is unqualified, outputting prompt information of unqualified image quality to the shooting device.
[0184] Further, in order to enable the user of the shooting device to more intuitively and quickly determine the reason why the current image is unqualified in image quality, the attribution reason information of unqualified current image quality can be further output. For example, when the reflection detection result is that the image has reflection, the shooting device is outputted with the prompt information of "the current image has reflection, and the image quality is unqualified". When the brightness detection result is that the image is too bright, and the angle detection result is that the image is tilted, the shooting device is outputted with the prompt information of "the current image is too dark and tilted, and the image quality is unqualified".
[0185] In addition, when it is determined that the quality of the current image is qualified, the shooting device can also be outputted with the prompt information of qualified image quality, so that the user of the shooting device can timely shoot high-quality images.
[0186] From the above, when it is determined that the quality of the current image is unqualified, by outputting prompt information of unqualified image quality to the shooting device, the user of the shooting device can discover the image quality problem in time, thereby further improving the shooting quality of the image.
[0187] In addition, since the applet and the H5 page do not support direct calling of some algorithms (such as C++ algorithms), in order to improve the performance of the image quality detection method provided in the embodiments of the present application, in the embodiments of the present application, the image quality detection method further includes: loading the image quality detection method through a wasm file format.
[0188] Specifically, the file format of the image quality detection method can be converted into a wasm file format, and the image quality detection method is implemented by executing the wasm file format.
[0189] Since the wasm file format is a binary format file for web pages, it has a machine code and has the characteristics of efficient loading and running, so by loading the image quality detection method in the wasm file format, the image quality detection method can be called in the applet and the H5 page, and the performance of the image quality detection method is improved.
[0190] In order to better implement the image quality detection method in the embodiments of the present application, based on the image quality detection method, the embodiments of the present application further provide an image quality detection device, as shown in Figure 7 The image quality detection device 700 includes:
[0191] The acquisition unit 701 is configured to acquire a current image captured by a shooting device.
[0192] The detection unit 702 is configured to acquire a shooting quality parameter related to the current image, wherein the shooting quality parameter includes at least one of a highlight detection result, a brightness detection result, a sharpness detection result and an angle detection result of the current image.
[0193] The discrimination unit 703 is configured to determine whether the quality of the current image is qualified according to the shooting quality parameter.
[0194] In some embodiments of the present application, the detection unit 702 is specifically configured to:
[0195] Acquire the saturation and brightness of each pixel point in the current image.
[0196] Determine a highlight point in the current image according to the saturation, the brightness and preset saturation threshold and brightness threshold.
[0197] determine a reflection region of the current image according to the reflection points, to obtain the reflection detection result.
[0198] In some embodiments of the present application, the detection unit 702 is specifically configured to:
[0199] obtain a historical image captured by the photographing device;
[0200] perform optical flow matching according to the historical image and the current image, to obtain a motion direction of each pixel point in the current image;
[0201] cluster each pixel point in the current image according to the motion direction, to obtain a large set of clustered points with consistent motion directions and a small set of clustered points with inconsistent motion directions;
[0202] determine reflection points of the current image according to each point in the small set of clustered points, to obtain the reflection detection result.
[0203] In some embodiments of the present application, the discrimination unit 703 is specifically configured to:
[0204] when the reflection detection result is that the image has reflection, determine that the quality of the current image is unqualified.
[0205] In some embodiments of the present application, the detection unit 702 is specifically configured to:
[0206] obtain an N-color gray scale image of the current image, where N is a positive integer greater than 2;
[0207] obtain a proportion of pixel points of each color in the N-color gray scale image;
[0208] determine the brightness detection result according to the proportion of pixel points.
[0209] In some embodiments of the present application, the discrimination unit 703 is specifically configured to:
[0210] when the brightness detection result is that the image is too bright or the image is too dark, determine that the quality of the current image is unqualified.
[0211] In some embodiments of the present application, the clarity detection result includes image blur, and the detection unit 702 is further configured to:
[0212] perform edge detection processing on the current image, to obtain an edge distribution variance of the current image;
[0213] According to the edge distribution variance and a preset blur threshold, it is determined whether the current image is blurred, to obtain a definition detection result of the current image, wherein the blur threshold is related to the brightness detection result.
[0214] In some embodiments of the present application, the determining unit 703 is specifically configured to:
[0215] When the definition detection result is that the image is blurred, it is determined that the quality of the current image is unqualified.
[0216] In some embodiments of the present application, the angle detection result includes image tilt, and the detecting unit 702 is specifically configured to:
[0217] Obtain a shooting device parameter related to the current image, wherein the shooting device parameter includes a deviation angle of the shooting device relative to a scene to be shot and acceleration of the shooting device.
[0218] According to the shooting device parameter, it is determined whether the current image is tilted, to obtain the angle detection result.
[0219] In some embodiments of the present application, the determining unit 703 is specifically configured to:
[0220] When the angle detection result is that the image is tilted, it is determined that the quality of the current image is unqualified.
[0221] In some embodiments of the present application, the image quality detection apparatus 700 further includes a prompting unit (not shown in the figure), which is specifically configured to:
[0222] When it is determined that the quality of the current image is unqualified, prompt information that the quality of the image is unqualified is output to the shooting device.
[0223] In some embodiments of the present application, the image quality detection apparatus 700 further includes a loading unit (not shown in the figure), which is specifically configured to:
[0224] The image quality detection method is loaded in a wasm file format.
[0225] In implementation, each of the above units can be implemented as an independent entity, or can be combined as the same or several entities, and the specific implementation of each of the above units can refer to the method embodiments in the foregoing method embodiments, which will not be described here.
[0226] Since the image quality detection apparatus can execute the image quality detection method of the present application, the image quality detection apparatus can have the advantages of the image quality detection method of the present application. Figures 1 to 6 Corresponding to the steps in the image quality detection method in any embodiment, the image quality detection apparatus can have the advantages of the image quality detection method of the present application. Figures 1 to 6The beneficial effects that can be achieved by the image quality detection method in any embodiment are described above, and will not be repeated here.
[0227] In addition, in order to better implement the image quality detection method in the embodiments of the present application, based on the image quality detection method, the embodiments of the present application further provide an electronic device, which is described below with reference to Figure 8 , Figure 8 A structural schematic diagram of the electronic device in the embodiments of the present application is shown. Specifically, the electronic device provided by the embodiments of the present application includes a processor 801, which is configured to implement the image quality detection method as described above when executing a computer program stored in a memory 802. Figures 1 to 6 corresponding to the steps of the image quality detection method in any embodiment; or the processor 801 is configured to implement the functions of the units in the embodiments when executing the computer program stored in the memory 802. Figure 7 corresponding to the functions of the units in the embodiments.
[0228] For example, the computer program can be divided into one or more modules / units, which are stored in the memory 802 and executed by the processor 801 to complete the embodiments of the present application. One or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the computer device.
[0229] The electronic device can include, but is not limited to, the processor 801 and the memory 802. Those skilled in the art can understand that the schematic diagram is only an example of the electronic device and does not constitute a limitation on the electronic device, which can include more or fewer components than the schematic diagram, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, etc. The processor 801, the memory 802, the input / output device, and the network access device are connected through the bus.
[0230] The processor 801 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The processor is the control center of the electronic device, which connects all parts of the electronic device through various interfaces and lines.
[0231] The memory 802 can be used to store computer programs and / or modules, and the processor 801 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 802, and calling data stored in the memory 802. The memory 802 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), and the like; and the data storage area can store data created according to the use of the electronic device (such as audio data, video data, etc.), and the like. In addition, the memory can include a high-speed random access memory, and can also include a nonvolatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0232] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the image quality detection device, the electronic device and the corresponding units described above can be referred to as Figures 1 to 6 Corresponding to the description of the image quality detection method in any embodiment, the specific operation will not be repeated here.
[0233] Those 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 instructions, or by instructions controlling related hardware, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0234] Therefore, the embodiments of the present application provide a computer readable storage medium, which stores a plurality of instructions. The instructions can be loaded by a processor to execute the embodiments of the present application, such as Figures 1 to 6 Corresponding to the steps in the image quality detection method in any embodiment, the specific operation can be referred to as Figures 1 to 6 Corresponding to the description of the image quality detection method in any embodiment, the specific operation will not be repeated here.
[0235] The computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0236] Due to the instructions stored in the computer readable storage medium, the embodiments of the present application, such as Figures 1 to 6 Corresponding to the steps in the image quality detection method in any embodiment, the specific operation can be referred to as Figures 1 to 6Corresponding to the beneficial effects that can be achieved by the image quality detection method in any embodiment, the details are described above, and will not be repeated here.
[0237] The above describes in detail the image quality detection method, device, electronic equipment and computer readable storage medium provided by the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples. The above embodiment description is only used to help understand the method and core idea of the present application. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. An image quality detection method, characterized by, The method comprises: acquiring a current image captured by a shooting device; acquiring a shooting quality parameter related to the current image, wherein the shooting quality parameter comprises at least one of a reflection detection result, a brightness detection result, a definition detection result and an angle detection result of the current image; determining whether the quality of the current image is qualified according to the shooting quality parameter; wherein the acquiring of the shooting quality parameter related to the current image comprises: acquiring a historical image captured by the shooting device; performing optical flow matching according to the historical image and the current image to obtain a motion direction of each pixel point in the current image; clustering each pixel point in the current image according to the motion direction to obtain a large set of clustered points with consistent motion directions and a small set of clustered points with inconsistent motion directions; determining a reflection point of the current image according to each point in the small set of clustered points to obtain the reflection detection result.
2. The image quality detection method of claim 1, wherein the reflection detection result comprises that the image has reflection, and before the acquiring of the historical image captured by the shooting device, the method further comprises: acquiring a saturation and a lightness of each pixel point in the current image; determining a reflection point in the current image according to the saturation, the lightness and preset saturation and lightness thresholds; determining that the current image does not have a reflection region according to the reflection point; the determining of whether the quality of the current image is qualified according to the shooting quality parameter comprises: when the reflection detection result is that the image has reflection, determining that the quality of the current image is unqualified.
3. The image quality detection method of claim 1, wherein the brightness detection result comprises that the image is over-bright or over-dark, and the acquiring of the shooting quality parameter related to the current image comprises: acquiring an N-color gray scale image of the current image, wherein N is a positive integer greater than 2; acquiring a proportion of pixel points of each color in the N-color gray scale image; determining the brightness detection result according to the proportion of pixel points; the determining of whether the quality of the current image is qualified according to the shooting quality parameter comprises: when the brightness detection result is that the image is over-bright or over-dark, determining that the quality of the current image is unqualified.
4. The image quality detection method of claim 1, wherein the definition detection result comprises that the image is blurred, and the acquiring of the shooting quality parameter related to the current image comprises: performing edge detection processing on the current image to obtain an edge distribution variance of the current image; determining whether the current image is blurred according to the edge distribution variance and a preset blur threshold to obtain the definition detection result of the current image, wherein the blur threshold is related to the brightness detection result; the determining of whether the quality of the current image is qualified according to the shooting quality parameter comprises: when the definition detection result is that the image is blurred, determining that the quality of the current image is unqualified. 5. The image quality detection method of claim 1, wherein the angle detection result comprises image tilt, and the obtaining the shooting quality parameter related to the current image comprises: obtaining a shooting device parameter related to the current image, wherein the shooting device parameter comprises a deviation angle of the shooting device relative to a scene to be shot and acceleration of the shooting device; and determining whether the current image is tilted according to the shooting device parameter to obtain the angle detection result.
6. The image quality detection method of claim 1, wherein the method further comprises: when it is determined that the quality of the current image is unqualified, outputting prompt information of unqualified image quality to the shooting device.
7. The image quality detection method of any one of claims 1-6, wherein the image quality detection method is loaded in a wasm file format.
8. An image quality detection apparatus, comprising: an obtaining unit configured to obtain a current image captured by a shooting device; a detection unit configured to obtain a shooting quality parameter related to the current image, wherein the shooting quality parameter comprises at least one of a highlight detection result, a brightness detection result, a definition detection result and an angle detection result of the current image; and a discrimination unit configured to determine whether the quality of the current image is qualified according to the shooting quality parameter.
9. An electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor invokes the computer program in the memory to execute the image quality detection method of any one of claims 1-7.
10. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is loaded by a processor to execute the steps in the image quality detection method of any one of claims 1-7.
Citation Information
Patent Citations
License camera capable of giving shooting environment shooting prompt and shooting environment detection method
CN105049734A
Exposure parameter adjustment method and device, electronic device and readable memory medium
CN107592473A
Charging pile working state detection method and device
CN110082620A
Image quality detection method, device and equipment and storage medium
CN111340749A
Cited By
System for judging the roundness of beef balls
CN122574836A