Image detection method, device, computer equipment and readable storage medium

The image detection method enhances image validation accuracy by dividing images into regions, calculating pixel means, and comparing ratios and overall means against thresholds, ensuring only high-quality images are displayed.

CN115049849BActive Publication Date: 2024-12-06BEIJING WANDONG MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210806139.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-08
Publication Date
2024-12-06
Estimated Expiration
2042-07-08

Smart Images

  • Figure CN115049849B_ABST
    Figure CN115049849B_ABST
Patent Text Reader

Abstract

The present application provides an image detection method, apparatus, computer equipment and readable storage medium, wherein four non-overlapping regions are determined from a candidate image; the pixel mean of each region is calculated; it is determined whether the first mean ratio of the first pixel mean to the second pixel mean is within a threshold range, and whether the second mean ratio of the third pixel mean to the fourth pixel mean is within a threshold range; if the first mean ratio of the first pixel mean to the second pixel mean is within the threshold range, and the second mean ratio of the third pixel mean to the fourth pixel mean is within the threshold range, then the overall pixel mean of the candidate image is calculated according to the pixel value of each pixel in the candidate image; it is determined whether the overall pixel mean is within the threshold range; if the overall pixel mean is within the threshold range, the candidate image is regarded as a qualified image. The above method is used to improve the accuracy of determining the validity of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to an image detection method, an apparatus, a computer device and a readable storage medium. Background Art

[0002] In the prior art, when checking the validity of an image obtained after exposure using a tube radiation source, an operator who performs image exposure usually observes the image with human eyes and judges the validity of the image based on the operator's experience.

[0003] The inventors found in their research that since each person's eyes have different recognition of image pixels, and different people have different experiences with the same thing, different operators may mistakenly judge images that are not clear enough or do not meet the pixel uniformity requirements as valid images when using their eyes to judge the validity of images due to poor eyesight or lack of experience, thereby reducing the accuracy of determining the validity of the image. Summary of the invention

[0004] In view of this, an object of the present invention is to provide an image detection method, apparatus, computer device and readable storage medium, which are conducive to improving the accuracy of determining the validity of an image.

[0005] In a first aspect, an embodiment of the present application provides an image detection method, the method comprising:

[0006] Determine a first region, a second region, a third region, and a fourth region from a candidate image, wherein the candidate image is a rectangular image having an upper edge, a lower edge, a left edge, and a right edge, the center point of the first region is located at a position a first preset distance below the upper edge, the center point of the second region is located at a position a first preset distance above the lower edge, the center point of the third region is located at a position the first preset distance to the right of the left edge, the center point of the fourth region is located at a position the first preset distance to the left of the right edge, the first region, the second region, the third region, and the fourth region have the same region size, and the first region, the second region, the third region, and the fourth region do not overlap;

[0007] Calculating a first pixel mean of the first area, calculating a second pixel mean of the second area, calculating a third pixel mean of the third area, and calculating a fourth pixel mean of the fourth area;

[0008] Determine whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range;

[0009] If a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range, calculating the overall pixel mean of the candidate image according to the pixel value of each pixel point in the candidate image;

[0010] Determining whether the overall pixel mean is within a third preset threshold range;

[0011] If the overall pixel mean is within a third preset threshold range, the candidate image is displayed to the target user as a qualified image.

[0012] Optionally, before determining the first area, the second area, the third area and the fourth area from the candidate image, the method further includes:

[0013] For each target area in the image to be detected, a target pixel mean value of the target area is calculated according to the pixel value of each pixel point in the target area, wherein the target area is the area within the template range when the image to be detected is filtered using a template filter;

[0014] Determine whether a target pixel deviation value between a target pixel mean value of the target area and a target pixel mean value of the entire image to be detected of the image to be detected is less than a fourth preset threshold value;

[0015] If the target pixel deviation values ​​between the target pixel mean of each target area and the target pixel mean of the entire image to be detected are both smaller than the fourth preset threshold, the image to be detected is stored as a candidate image.

[0016] Optionally, before calculating the target pixel mean of each target area in the image to be detected according to the pixel value of each pixel point in the target area, the method further includes:

[0017] According to a preset image grayscale value and a distance between a detector panel and a tube radiation source for acquiring the image to be detected, a working current value and a working voltage value input to the tube radiation source are determined, so that the tube radiation source acquires an image of the component to be exposed at the working current value and the working voltage value to obtain the image to be detected, wherein the component to be exposed is placed between the detector panel and the tube radiation source.

[0018] Optionally, after determining whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range, the method further includes:

[0019] If the first mean ratio is outside the first preset threshold range, or the second mean ratio is outside the second preset threshold range, the candidate image is displayed to the target user as an unqualified image.

[0020] Optionally, after determining whether the overall pixel mean is within a third preset threshold range, the method further includes:

[0021] If the overall pixel mean is outside a third preset threshold range, the candidate image is displayed to the target user as an unqualified image.

[0022] Optionally, after determining whether a target pixel deviation value between a target pixel mean of the target area and a target pixel mean of the entire image to be detected of the image to be detected is less than a fourth preset threshold, the method further includes:

[0023] If the target pixel deviation value between the target pixel mean of at least one target area in each target area and the overall pixel mean of the image to be detected is greater than the fourth preset threshold, the image to be detected is displayed to the target user as an unqualified image.

[0024] Optionally, after presenting the candidate image as a qualified image to a target user, the method further includes:

[0025] The first pixel mean, the second pixel mean, the third pixel mean, the fourth pixel mean and the overall pixel mean are displayed to the target user.

[0026] In a second aspect, an embodiment of the present application provides an image detection device, the device comprising:

[0027] a region determination module, configured to determine a first region, a second region, a third region, and a fourth region from a candidate image, wherein the candidate image is a rectangular image having an upper edge, a lower edge, a left edge, and a right edge, the center point of the first region is located at a position a first preset distance below the upper edge, the center point of the second region is located at a position a first preset distance above the lower edge, the center point of the third region is located at a position the first preset distance to the right of the left edge, the center point of the fourth region is located at a position the first preset distance to the left of the right edge, the first region, the second region, the third region, and the fourth region have the same region size, and the first region, the second region, the third region, and the fourth region do not overlap;

[0028] A regional pixel mean determination module, configured to calculate a first pixel mean of the first region, calculate a second pixel mean of the second region, calculate a third pixel mean of the third region, and calculate a fourth pixel mean of the fourth region;

[0029] a regional pixel mean comparison module, configured to determine whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range;

[0030] an overall pixel mean determination module, configured to calculate an overall pixel mean of the candidate image according to a pixel value of each pixel in the candidate image if a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range;

[0031] An overall pixel mean comparison module is used to determine whether the overall pixel mean is within a third preset threshold range;

[0032] The qualified image determination module is used to display the candidate image as a qualified image to the target user if the overall pixel mean is within a third preset threshold range.

[0033] Optionally, the device comprises:

[0034] A target pixel mean value determination module is used to calculate the target pixel mean value of each target region in the image to be detected according to the pixel value of each pixel point in the target region before determining the first region, the second region, the third region and the fourth region from the candidate image, wherein the target region is the region within the template range when the image to be detected is filtered using a template filter;

[0035] A target pixel mean comparison module is used to determine whether a target pixel deviation value between a target pixel mean of the target area and a target pixel mean of the entire image to be detected of the image to be detected is less than a fourth preset threshold;

[0036] The candidate image determination module is used to store the image to be detected as a candidate image if the target pixel mean of each target area and the target pixel deviation value of the overall pixel mean of the image to be detected are both less than the fourth preset threshold.

[0037] Optionally, the device comprises:

[0038] The module for determining an image to be detected is used to determine the working current value and the working voltage value input to the tube ray source for collecting the image to be detected according to a preset image grayscale value and the distance between a detector panel and the tube ray source for collecting the image to be detected, before calculating the target pixel mean value of the target area according to the pixel value of each pixel point in the target area, so that the tube ray source collects the image of the component to be exposed under the working current value and the working voltage value to obtain the image to be detected, wherein the component to be exposed is placed between the detector panel and the tube ray source.

[0039] Optionally, the device comprises:

[0040] The first unqualified image determination module is used to determine whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range. If the first mean ratio is outside the first preset threshold range, or the second mean ratio is outside the second preset threshold range, the candidate image is displayed to the target user as an unqualified image.

[0041] Optionally, the device comprises:

[0042] The second unqualified image determination module is used to determine whether the overall pixel mean is within a third preset threshold range. If the overall pixel mean is outside the third preset threshold range, the candidate image is displayed to the target user as an unqualified image.

[0043] Optionally, the device comprises:

[0044] The third unqualified image determination module is used to determine whether the target pixel deviation value between the target pixel mean of the target area and the overall pixel mean of the image to be detected is less than a fourth preset threshold. If the target pixel deviation value between the target pixel mean of at least one target area in each target area and the overall pixel mean of the image to be detected is greater than the fourth preset threshold, the image to be detected is displayed to the target user as an unqualified image.

[0045] Optionally, the device comprises:

[0046] A target user display module is used to display the first pixel mean, the second pixel mean, the third pixel mean, the fourth pixel mean and the overall pixel mean to the target user after displaying the candidate image as a qualified image to the target user.

[0047] In a third aspect, an embodiment of the present application provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of an image detection method described in any optional implementation manner of the first aspect above are performed.

[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of an image detection method described in any optional implementation manner in the above-mentioned first aspect are executed.

[0049] The technical solution provided by this application includes but is not limited to the following beneficial effects:

[0050] Since the higher the image pixel value and pixel uniformity, the better the image clarity and imaging effect will be, when the user views the image, the image with a higher pixel value and a higher pixel uniformity can provide the user with more useful information in the image. In other words, the image with a higher pixel value and a higher pixel uniformity is more effective.

[0051] An image detection method, apparatus, computer equipment and readable storage medium provided by an embodiment of the present invention, in order to analyze pixel uniformity, firstly, four regions of the same area are respectively determined from the upper half, lower half, left half and right half of the candidate image, and the pixel means of the four regions are respectively calculated. Through the above steps, the pixel mean of the typical region in each part of the image can be calculated to obtain the pixel approximation of each part of the image; then, the pixel ratio of the upper and lower regions and the pixel ratio of the left and right regions are compared with the preset standard value, so as to determine whether the pixel uniformity of the upper half of the image and the lower half of the image meets the preset requirements, and whether the pixel uniformity of the left half of the image and the right half of the image meets the preset requirements.

[0052] When the pixel uniformity meets the preset requirements, determine whether the overall pixel mean of the image meets the preset requirements. When the overall pixel mean of the image meets the preset requirements, the image is displayed to the user as a qualified image. Through the above steps, on the basis of the imaging effect meeting the requirements, the image whose pixel value meets the requirements is determined as a qualified image. The image with insufficient clarity can be filtered out, and the image with clarity meeting the requirements and imaging effect meeting the requirements can be displayed to the user.

[0053] By adopting the above method, the pixel ratio between the areas of each part of the image is compared with the preset standard value, and the overall pixel mean of the image with better imaging effect whose pixel ratio meets the preset standard is calculated. The image whose overall pixel mean meets the preset standard is regarded as a qualified image, which is beneficial to improve the accuracy of determining the validity of the image.

[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0056] Figure 1 A flow chart of an image detection method provided by Embodiment 1 of the present invention is shown;

[0057] Figure 2 A schematic diagram showing a region in a candidate image provided by the first embodiment of the present invention is shown;

[0058] Figure 3A schematic diagram of determining a first pixel mean value by using a coordinate system provided in the first embodiment of the present invention is shown;

[0059] Figure 4 A flowchart of a method for determining a candidate image provided by the first embodiment of the present invention is shown;

[0060] Figure 5 A schematic diagram showing a target area in an image to be detected provided by the first embodiment of the present invention;

[0061] Figure 6 A schematic diagram of the structure of an image detection device provided by Embodiment 2 of the present invention is shown;

[0062] Figure 7 A schematic diagram showing the structure of another image detection device provided by the second embodiment of the present invention is shown;

[0063] Figure 8 A schematic diagram showing the structure of another image detection device provided by the second embodiment of the present invention is shown;

[0064] Fig. 9 A schematic diagram showing the structure of another image detection device provided by the second embodiment of the present invention is shown;

[0065] Fig.10 A schematic diagram showing the structure of another image detection device provided by the second embodiment of the present invention is shown;

[0066] Fig.11 A schematic diagram showing the structure of another image detection device provided by the second embodiment of the present invention is shown;

[0067] Fig.12 A schematic diagram showing the structure of another image detection device provided by the second embodiment of the present invention is shown;

[0068] Fig.13 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention is shown. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0070] Embodiment 1

[0071] To facilitate understanding of this application, Figure 1 The flowchart of an image detection method provided in the first embodiment of the present invention is shown to describe the contents of the first embodiment of the present application in detail.

[0072] See also Figure 1 As shown, Figure 1 A flowchart of an image detection method provided in Embodiment 1 of the present invention is shown, and the method comprises steps S101 to S105:

[0073] S101: Determine a first region, a second region, a third region and a fourth region from a candidate image, wherein the candidate image is a rectangular image having an upper edge, a lower edge, a left edge and a right edge, the center point of the first region is located at a first preset distance below the upper edge, the center point of the second region is located at a first preset distance above the lower edge, the center point of the third region is located at a first preset distance to the right of the left edge, and the center point of the fourth region is located at a first preset distance to the left of the right edge, the first region, the second region, the third region and the fourth region have the same region size, and the first region, the second region, the third region and the fourth region do not overlap.

[0074] Specifically, in the selection of the shape of the area, the first area, the second area, the third area and the fourth area can be rectangles, circles, or other irregular figures of the same shape. The shape, area and size of each area are the same, but the angles and positions are different; in the selection of the angle of the area, the first area and the second area are symmetrical to each other with the horizontal central axis of the candidate image as the axis of symmetry, and the third area and the fourth area are symmetrical to each other with the vertical central axis of the candidate image as the axis of symmetry. When the four areas are rectangles, the angle is selected so that the long sides of the four rectangles are parallel to the edges of the candidate image at the same time, or the short sides of the four rectangles are parallel to the edges of the candidate image at the same time; in the selection of the position of the area, the image center points of the first area and the second area are located on the vertical central axis of the candidate image, and the image center points of the third area and the fourth area are located on the horizontal central axis of the candidate image.

[0075] For ease of understanding, a specific example is used to illustrate the selection of the first area, the second area, the third area and the fourth area in the candidate area. Figure 2 As shown, Figure 2 A schematic diagram of a region in a candidate image provided by Embodiment 1 of the present invention is shown, wherein the first region is a rectangle of length M and width N, and the distance between the center point of the first region and the upper edge of the candidate image is L; the second region is selected as a rectangle of length M and width N, and the distance between the center point of the second region and the lower edge of the candidate image is L; the third region is selected as a rectangle of length M and width N, and the distance between the center point of the third region and the left edge of the candidate image is L; the fourth region is selected as a rectangle of length M and width N, and the distance between the center point of the fourth region and the right edge of the candidate image is L. It can be seen that the first region, the second region, the third region and the fourth region have the same shape, area and size, and the center points of the first region and the second region are located on the vertical central axis of the candidate figure, the center points of the third region and the fourth region are located on the horizontal central axis of the candidate figure, and the long sides of the first region and the second region are parallel to the upper and lower edges, and the long sides of the third region and the fourth region are parallel to the left and right edges.

[0076] S102: Calculate a first pixel mean of the first area, calculate a second pixel mean of the second area, calculate a third pixel mean of the third area, and calculate a fourth pixel mean of the fourth area.

[0077] Specifically, for each region, when calculating the pixel mean of the region, it is calculated based on the pixel value of each pixel in the region, see Figure 3 As shown, Figure 3A schematic diagram of determining a first pixel mean value by using a coordinate system provided by the first embodiment of the present invention is shown, wherein, taking the first region as an example, before calculating the first pixel mean value, a two-dimensional plane coordinate system is first established, the origin of the coordinate system is O, the horizontal axis is the X axis, and the vertical axis is the Y axis. The length of the rectangular region is placed parallel to the X axis and the width is parallel to the Y axis, or the length of the rectangular region is placed parallel to the Y axis and the width is parallel to the X axis, and then the pixel mean value of each region is calculated respectively using the following formula:

[0078]

[0079] Among them, x is the horizontal coordinate within the rectangular area, y is the vertical coordinate within the rectangular area, Gray (x, y) is the pixel value of a pixel point on the rectangular area; x0 is the left edge of the rectangular area, x n is the right boundary of the rectangular area, y0 is the upper boundary of the rectangular area, and y n is the lower boundary of the rectangular area.

[0080] S103: Determine whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range.

[0081] Specifically, the first preset threshold range includes a minimum limit and a maximum limit, that is, to determine whether the first mean ratio of the first pixel mean and the second pixel mean satisfies the first minimum limit ≤ first mean ratio ≤ first maximum limit, and whether the second mean ratio satisfies the second minimum limit ≤ second mean ratio ≤ second maximum limit.

[0082] For example, when the first minimum limit of the first preset threshold range is 0.8, the first maximum limit is 1.2, the second minimum limit of the second preset threshold range is 0.8, and the second maximum limit is 1.2, assuming that the first pixel mean is 4.5, the second pixel mean is 5, the third pixel mean is 5, and the fourth pixel mean is 5.2 calculated by step S102, then the first mean ratio = first pixel mean: second pixel mean = 4.5:5 = 0.9; the second mean ratio = third pixel mean: fourth pixel mean = 5.5:5 = 1.1, then it can be determined whether 0.9 is greater than or equal to 0.8 and less than or equal to 1.2, and whether 1.1 is greater than or equal to 0.8 and less than or equal to 1.2.

[0083] S104: If a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range, then the overall pixel mean of the candidate image is calculated based on the pixel value of each pixel point in the candidate image.

[0084] Specifically, when the first mean ratio of the first pixel mean to the second pixel mean is within the first preset threshold range, and the second mean ratio of the third pixel mean to the fourth pixel mean is within the second preset threshold range, the overall pixel mean of all areas of the candidate image can be calculated with reference to the method of calculating the first pixel mean of the first area in S102. The only difference is that when calculating the overall pixel mean, the entire candidate graphic is taken as a rectangular area, and the overall pixel mean is calculated using the formula for calculating the first pixel mean in S102.

[0085] S105: Determine whether the overall pixel mean is within a third preset threshold range.

[0086] Specifically, the third preset threshold range includes a third minimum limit and a third maximum limit, so it is necessary to determine whether the overall pixel mean satisfies the third minimum limit ≤ overall pixel mean ≤ third maximum limit.

[0087] S106: If the overall pixel mean is within a third preset threshold range, the candidate image is displayed to the target user as a qualified image.

[0088] Specifically, if the overall pixel mean is within a third preset threshold range, the candidate image is determined to be valid, and the qualified image is displayed.

[0089] When exposing an image, some areas of the image may suffer from image quality loss due to light path obstruction or uneven light source. Image quality loss will cause excessive pixel differences between different areas, making the image as a whole look unclear. Therefore, the degree of pixel difference between different areas of the image is an indicator for judging the effectiveness and availability of the image. When exposing an image, the greater the difference between the light emitted by the light source received by the areas farther apart, the more likely it is that the pixel difference will be greater. Therefore, when analyzing the pixel difference between areas, the farthest area in the figure can be directly selected for pixel difference degree analysis. For rectangular images, in order to facilitate calculation and enable the area selection to cover a larger range, the pixel mean values ​​of the first area below the upper edge and the second area above the lower edge are calculated by ratio, and the pixel mean values ​​of the third area to the right of the left edge and the fourth area to the left of the right edge are calculated by ratio. When the ratio is closer to 1, it means that the degree of difference between the areas is smaller, and the clarity of each part of the image is more the same.

[0090] Since the clarity of an image is also related to the overall pixel mean of the image, the higher the overall pixel mean, the higher the overall clarity of the image. When the pixel difference between regions in the image and the overall pixel mean can meet user needs, it means that the visual effect presented by the image can meet user needs.

[0091] In an alternative embodiment, see Figure 4 As shown, Figure 4 A flowchart of a method for determining a candidate image provided by the first embodiment of the present invention is shown, wherein before determining the first region, the second region, the third region and the fourth region from the candidate image, the method further includes steps S401 to S403:

[0092] S401: For each target area in the image to be detected, a target pixel mean of the target area is calculated according to the pixel value of each pixel point in the target area, wherein the target area is the area within the template range when the image to be detected is filtered using a template filter.

[0093] For details, see Figure 5 As shown, Figure 5 A schematic diagram of a target area in an image to be detected provided in Embodiment 1 of the present invention is shown, wherein, in order to detect whether there is pixel missing in the image to be detected due to foreign matter blocking rays within the exposure field of view, a template filter can be used to search the entire image, and each area within the template range is taken as a target area, and the regional pixel mean within all target areas is calculated.

[0094] It is worth noting that the size of the template filter (equivalent to the size of each target area) can be set according to actual needs. The smaller the size, the greater the retrieval workload and the more accurate the retrieval result. The retrieval direction can be set according to actual needs, including but not limited to horizontal retrieval and vertical retrieval, so that all areas in the image to be detected can be searched.

[0095] S402: Determine whether a target pixel deviation value between a target pixel mean value of the target area and a target pixel mean value of the entire image to be detected of the image to be detected is less than a fourth preset threshold.

[0096] Specifically, the target pixel deviation value is a difference difference, or a difference ratio; first, the overall pixel mean of the image to be detected of the image to be detected is calculated with reference to the method for calculating the pixel mean of the rectangular area in step S102, and the difference difference between the target pixel mean of each target area calculated in step S401 and the overall pixel mean of the image to be detected (target pixel mean-overall pixel mean of the image to be detected), or the difference ratio between the target pixel mean of each target area and the overall pixel mean of the image to be detected (target pixel mean / overall pixel mean of the image to be detected) is calculated; then, it is determined whether the difference difference is less than a fourth preset threshold, or it is determined whether the difference ratio is less than the fourth preset threshold.

[0097] S403: If the target pixel deviation values ​​between the target pixel mean of each target area and the overall pixel mean of the image to be detected are both smaller than the fourth preset threshold, the image to be detected is stored as a candidate image.

[0098] Specifically, if the target pixel deviation values ​​between the target pixel mean of each target area and the overall pixel mean of the image to be detected are both less than the fourth preset threshold, it means that there is no large-area pixel missing in the image or there is no foreign object obstructing the exposure path, then the detection image is used as the candidate image in step S101 for subsequent image detection.

[0099] The image to be detected after exposure is retrieved using a template filter, and images that may be blocked by foreign objects are discarded. Images without foreign object occlusion are used as candidate images for subsequent detection. This can exclude images with pixel loss due to light path obstruction and reduce the workload of subsequent image retrieval.

[0100] In an optional embodiment, before calculating the target pixel mean of each target area in the image to be detected according to the pixel value of each pixel point in the target area, the method further includes:

[0101] According to a preset image grayscale value and a distance between a detector panel and a tube radiation source for acquiring the image to be detected, a working current value and a working voltage value input to the tube radiation source are determined, so that the tube radiation source acquires an image of the component to be exposed at the working current value and the working voltage value to obtain the image to be detected, wherein the component to be exposed is placed between the detector panel and the tube radiation source.

[0102] Specifically, before exposing the component to be exposed, it is necessary to determine the power supply parameters of the working power supply used to control the radiation source of the tube to emit radiation. The power supply parameters include the working current, the product of the exposure current and time, and the working voltage value, wherein the working voltage value is preset according to the properties of the tube, and the working current mA cur and the exposure current-time product mAs cur It can be calculated according to the following formula:

[0103]

[0104] Among them, mA ref is the reference exposure current, mAs, preset according to the tube properties ref The reference exposure current-time product, SID, is preset according to the tube properties. ref The reference distance between the tube radiation source and the detector panel preset according to the tube properties, Gray ref Gray is the gray value of the reference image preset according to the tube properties. cur is the grayscale value of the image expected after this exposure, SID cur It is the distance between the current tube ray source and the detector panel.

[0105] In an optional embodiment, after determining whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range, the method further includes:

[0106] If the first mean ratio is outside the first preset threshold range, or the second mean ratio is outside the second preset threshold range, the candidate image is displayed to the target user as an unqualified image.

[0107] Specifically, if the first mean ratio is outside the first preset threshold range, or the second mean ratio is outside the second preset threshold range, there may be three situations, the first situation is that the first mean ratio is outside the first preset threshold range but the second mean ratio is within the second preset threshold range, the second situation is that the first mean ratio is within the first preset threshold range and the second mean ratio is outside the second preset threshold range, the third situation is that the first mean ratio is within the first preset threshold range and the second mean ratio is outside the second preset threshold range; in the above three situations, it is indicated that the pixel difference between the areas in the image is too large, and there may be uneven exposure, so the candidate images with the above three situations are determined as unqualified images or invalid images and displayed to the user.

[0108] In an optional implementation, after determining whether the overall pixel mean is within a third preset threshold range, the method further includes:

[0109] If the overall pixel mean is outside a third preset threshold range, the candidate image is displayed to the target user as an unqualified image.

[0110] Specifically, if the overall pixel mean is outside the range of the third preset threshold, two situations may occur. The first situation is that the overall pixel mean is less than the minimum limit of the third preset threshold, indicating that the image may have too low resolution and too low clarity. The second situation is that the overall pixel mean is greater than the maximum limit of the third preset threshold, indicating that although the image has a high resolution and high clarity, the image occupies a large memory size. Since some application scenarios do not require high-resolution images, or some devices do not support the display of high-resolution images, or the device cannot provide sufficient memory space to store high-resolution images, the candidate images in the above two situations will be displayed to the user as unqualified images or ineffective images.

[0111] In an optional embodiment, after determining whether the target pixel mean of the target area and the target pixel deviation value of the overall pixel mean of the image to be detected are less than a fourth preset threshold, the method further includes:

[0112] If the target pixel deviation value between the target pixel mean of at least one target area in each target area and the overall pixel mean of the image to be detected is greater than the fourth preset threshold, the image to be detected is displayed to the target user as an unqualified image.

[0113] Specifically, if in each target area, there is one or more target pixel deviation values ​​greater than the fourth preset threshold, it means that there is foreign matter blocking the ray path, and the image to be detected is displayed to the target user as an unqualified image or an invalid image, wherein the target pixel deviation value is the difference or ratio between the target pixel mean of the target area and the overall pixel mean of the image to be detected.

[0114] In an optional embodiment, after presenting the candidate image as a qualified image to the target user, the method further includes:

[0115] The first pixel mean, the second pixel mean, the third pixel mean, the fourth pixel mean and the overall pixel mean are displayed to the target user.

[0116] Specifically, in addition to displaying the first pixel mean, the second pixel mean, the third pixel mean, the fourth pixel mean obtained by step S102, and the overall pixel mean obtained by step S104 to the user, the target pixel mean of each target area, the overall pixel mean of the image to be detected obtained by executing step S403, and the power supply parameters of the working power supply of the tube radiation source can also be displayed to the target user after executing step S401.

[0117] Before displaying, all the above data to be displayed can be put into a table document to form a detection list, and then the detection list is displayed to the user, wherein the detection list also includes the detection time and the like.

[0118] After querying the above data, the user can analyze and judge the reasons leading to the image detection results based on each data, which is helpful for image correction of unqualified images.

[0119] Embodiment 2

[0120] See also Figure 6 As shown, Figure 6 FIG. 4 shows a schematic diagram of the structure of an image detection device provided by Embodiment 2 of the present invention, wherein Figure 6 As shown, an image detection device 600 provided in the second embodiment of the present invention includes:

[0121] The region determination module 601 is used to determine a first region, a second region, a third region and a fourth region from a candidate image, wherein the candidate image is a rectangular image having an upper edge, a lower edge, a left edge and a right edge, the center point of the first region is located at a position a first preset distance below the upper edge, the center point of the second region is located at a position a first preset distance above the lower edge, the center point of the third region is located at a position the first preset distance to the right of the left edge, the center point of the fourth region is located at a position the first preset distance to the left of the right edge, the first region, the second region, the third region and the fourth region have the same region size, and the first region, the second region, the third region and the fourth region do not overlap;

[0122] A regional pixel mean determination module 602, configured to calculate a first pixel mean of the first region, calculate a second pixel mean of the second region, calculate a third pixel mean of the third region, and calculate a fourth pixel mean of the fourth region;

[0123] A regional pixel mean comparison module 603 is used to determine whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range;

[0124] an overall pixel mean determination module 604, configured to calculate an overall pixel mean of the candidate image according to the pixel value of each pixel in the candidate image if a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range;

[0125] The overall pixel mean comparison module 605 is used to determine whether the overall pixel mean is within a third preset threshold range;

[0126] The qualified image determination module 606 is used to display the candidate image as a qualified image to the target user if the overall pixel mean is within a third preset threshold range.

[0127] In an alternative embodiment, see Figure 7 As shown, Figure 7 FIG. 1 shows a schematic diagram of the structure of another image detection device provided in Embodiment 2 of the present invention, wherein the another image detection device 700 provided in Embodiment 2 of the present invention further includes:

[0128] The target pixel mean determination module 701 is used to calculate the target pixel mean of each target region in the image to be detected according to the pixel value of each pixel point in the target region before determining the first region, the second region, the third region and the fourth region from the candidate image, wherein the target region is the region within the template range when the image to be detected is filtered using the template filter;

[0129] A target pixel mean comparison module 702 is used to determine whether a target pixel deviation value between a target pixel mean of the target area and a target pixel mean of the entire image to be detected of the image to be detected is less than a fourth preset threshold;

[0130] The candidate image determination module 703 is used to store the image to be detected as a candidate image if the target pixel mean of each target area and the target pixel deviation value of the overall pixel mean of the image to be detected are both less than the fourth preset threshold.

[0131] In an alternative embodiment, see Figure 8 As shown, Figure 8 FIG. 8 is a schematic diagram showing the structure of another image detection device provided by Embodiment 2 of the present invention, wherein the another image detection device 800 provided by Embodiment 2 of the present invention further includes:

[0132] The module 801 for determining the image to be detected is used to determine the working current value and the working voltage value input to the tube ray source for collecting the image to be detected according to a preset image grayscale value and the distance between the detector panel and the tube ray source for collecting the image to be detected, before calculating the target pixel mean value of the target area according to the pixel value of each pixel point in the target area, so that the tube ray source collects the image of the component to be exposed under the working current value and the working voltage value to obtain the image to be detected, wherein the component to be exposed is placed between the detector panel and the tube ray source.

[0133] In an alternative embodiment, see Fig. 9 As shown, Fig. 9 FIG. 1 shows a schematic diagram of the structure of another image detection device provided in Embodiment 2 of the present invention, wherein the another image detection device 900 provided in Embodiment 2 of the present invention further includes:

[0134] The first unqualified image determination module 901 is used to determine whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range. If the first mean ratio is outside the first preset threshold range, or the second mean ratio is outside the second preset threshold range, the candidate image is displayed to the target user as an unqualified image.

[0135] In an alternative embodiment, see Fig.10 As shown, Fig.10 FIG. 1 shows a schematic diagram of the structure of another image detection device provided in Embodiment 2 of the present invention, wherein the another image detection device 1000 provided in Embodiment 2 of the present invention further includes:

[0136] The second unqualified image determination module 1001 is used to determine whether the overall pixel mean is within a third preset threshold range. If the overall pixel mean is outside the third preset threshold range, the candidate image is displayed to the target user as an unqualified image.

[0137] In an alternative embodiment, see Fig.11 As shown, Fig.11 FIG. 1 shows a schematic diagram of the structure of another image detection device provided in Embodiment 2 of the present invention, wherein the another image detection device 1100 provided in Embodiment 2 of the present invention further includes:

[0138] The third unqualified image determination module 1101 is used to determine whether the target pixel deviation value between the target pixel mean of the target area and the overall pixel mean of the image to be detected is less than a fourth preset threshold. If the target pixel deviation value between the target pixel mean of at least one target area in each target area and the overall pixel mean of the image to be detected is greater than the fourth preset threshold, the image to be detected is displayed to the target user as an unqualified image.

[0139] In an alternative embodiment, see Fig.12 As shown, Fig.12 FIG. 1 shows a schematic diagram of the structure of another image detection device provided in Embodiment 2 of the present invention, wherein the another image detection device 1200 provided in Embodiment 2 of the present invention further includes:

[0140] The target user display module 1201 is used to display the first pixel mean, the second pixel mean, the third pixel mean, the fourth pixel mean and the overall pixel mean to the target user after displaying the candidate image as a qualified image to the target user.

[0141] Embodiment 3

[0142] Based on the same application concept, see Fig.13 As shown, Fig.13 FIG. 4 shows a schematic diagram of the structure of a computer device provided by Embodiment 3 of the present invention, wherein: Fig.13 As shown, a computer device 1300 provided in Embodiment 3 of the present application includes:

[0143] A processor 1301, a memory 1302 and a bus 1303, wherein the memory 1302 stores machine-readable instructions executable by the processor 1301. When the computer device 1300 is running, the processor 1301 communicates with the memory 1302 via the bus 1303, and the machine-readable instructions are executed by the processor 1301 to execute the steps of an image detection method shown in the above-mentioned embodiment 1.

[0144] Embodiment 4

[0145] Based on the same application concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of an image detection method described in any one of the above embodiments are executed.

[0146] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0147] The computer program product for performing the image detection method provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0148] An image detection device provided in an embodiment of the present invention may be specific hardware on a device or software or firmware installed on a device. The device provided in an embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment. Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.

[0149] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0150] The units described 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.

[0151] In addition, each functional unit in the embodiment provided by the present invention 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.

[0152] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0153] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0154] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. An image detection method, characterized in that: The method comprises: Determine a first region, a second region, a third region, and a fourth region from a candidate image, wherein the candidate image is a rectangular image having an upper edge, a lower edge, a left edge, and a right edge, the center point of the first region is located at a position a first preset distance below the upper edge, the center point of the second region is located at a position a first preset distance above the lower edge, the center point of the third region is located at a position the first preset distance to the right of the left edge, the center point of the fourth region is located at a position the first preset distance to the left of the right edge, the first region, the second region, the third region, and the fourth region have the same region size, and the first region, the second region, the third region, and the fourth region do not overlap; Calculating a first pixel mean of the first area, calculating a second pixel mean of the second area, calculating a third pixel mean of the third area, and calculating a fourth pixel mean of the fourth area; Determine whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range; If a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range, calculating the overall pixel mean of the candidate image according to the pixel value of each pixel point in the candidate image; Determining whether the overall pixel mean is within a third preset threshold range; If the overall pixel mean is within a third preset threshold range, the candidate image is displayed to the target user as a qualified image.

2. The method according to claim 1, characterized in that Before determining the first area, the second area, the third area and the fourth area from the candidate image, the method further includes: For each target area in the image to be detected, a target pixel mean value of the target area is calculated according to the pixel value of each pixel point in the target area, wherein the target area is the area within the template range when the image to be detected is filtered using a template filter; Determine whether a target pixel mean of the target area and a target pixel deviation value of the overall pixel mean of the image to be detected are less than a fourth preset threshold; If the target pixel deviation values ​​between the target pixel mean of each target area and the overall pixel mean of the image to be detected are both smaller than the fourth preset threshold, the image to be detected is stored as a candidate image.

3. The method according to claim 2, characterized in that Before calculating the target pixel mean of each target area in the image to be detected according to the pixel value of each pixel point in the target area, the method further includes: According to a preset image grayscale value and a distance between a detector panel and a tube radiation source for acquiring the image to be detected, a working current value and a working voltage value input to the tube radiation source are determined, so that the tube radiation source acquires an image of the component to be exposed at the working current value and the working voltage value to obtain the image to be detected, wherein the component to be exposed is placed between the detector panel and the tube radiation source.

4. The method according to claim 1, characterized in that After determining whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range, the method further includes: If the first mean ratio is outside the first preset threshold range, or the second mean ratio is outside the second preset threshold range, the candidate image is displayed to the target user as an unqualified image.

5. The method according to claim 1, characterized in that After determining whether the overall pixel mean is within a third preset threshold range, the method further includes: If the overall pixel mean is outside a third preset threshold range, the candidate image is displayed to the target user as an unqualified image.

6. The method according to claim 2, characterized in that After determining whether the target pixel mean of the target area and the target pixel deviation value of the overall pixel mean of the image to be detected are less than a fourth preset threshold, the method further includes: If the target pixel deviation value between the target pixel mean of at least one target area in each target area and the overall pixel mean of the image to be detected is greater than the fourth preset threshold, the image to be detected is displayed to the target user as an unqualified image.

7. The method according to claim 1, characterized in that After presenting the candidate image as a qualified image to a target user, the method further includes: The first pixel mean, the second pixel mean, the third pixel mean, the fourth pixel mean and the overall pixel mean are displayed to the target user.

8. An image detection device, characterized in that: The device comprises: a region determination module, configured to determine a first region, a second region, a third region, and a fourth region from a candidate image, wherein the candidate image is a rectangular image having an upper edge, a lower edge, a left edge, and a right edge, the center point of the first region is located at a position a first preset distance below the upper edge, the center point of the second region is located at a position a first preset distance above the lower edge, the center point of the third region is located at a position the first preset distance to the right of the left edge, the center point of the fourth region is located at a position the first preset distance to the left of the right edge, the first region, the second region, the third region, and the fourth region have the same region size, and the first region, the second region, the third region, and the fourth region do not overlap; A regional pixel mean determination module, configured to calculate a first pixel mean of the first region, calculate a second pixel mean of the second region, calculate a third pixel mean of the third region, and calculate a fourth pixel mean of the fourth region; a regional pixel mean comparison module, configured to determine whether a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and whether a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range; an overall pixel mean determination module, configured to calculate an overall pixel mean of the candidate image according to a pixel value of each pixel in the candidate image if a first mean ratio of the first pixel mean to the second pixel mean is within a first preset threshold range, and a second mean ratio of the third pixel mean to the fourth pixel mean is within a second preset threshold range; An overall mean comparison module, used to determine whether the overall pixel mean is within a third preset threshold range; The qualified image determination module is used to display the candidate image as a qualified image to the target user if the overall pixel mean is within a third preset threshold range.

9. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of an image detection method as described in any one of claims 1 to 7 are performed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of an image detection method as claimed in any one of claims 1 to 7 are executed.