An image processing method, device and storage medium
By comparing the difference in sharpness between target areas at the same location in the image, blurred areas in the image are automatically identified, solving the image blurring problem caused by poor CCD focusing height and improving the accuracy and efficiency of detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SKYVERSE TECH CO LTD
- Filing Date
- 2023-03-17
- Publication Date
- 2026-06-26
AI Technical Summary
In image detection, poor focus height of CCDs leads to image blurring, and existing technologies struggle to effectively determine and adjust the focus height to achieve clear detection.
By comparing the sharpness difference between target areas at the same location in multiple test images, blurry areas in the image are identified, and target parameters are obtained based on the sharpness difference to determine whether to adjust the focus height to achieve sharp detection.
It improves the efficiency and accuracy of identifying blurred areas in images, avoids erroneous judgments caused by background color differences, and achieves smooth focus height adjustment to ensure clear detection.
Smart Images

Figure CN118710509B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection, and in particular to an image processing method, apparatus, and storage medium. Background Technology
[0002] With the technological development of society, the technology in the field of image detection has also developed, especially for the detection and measurement of image defects.
[0003] In practical applications, charge-coupled devices (CCDs) are used to capture images of the object being inspected during image detection. During the capture process, the focusing height of the CCD affects the quality of the final image. For example, poor focusing height can cause blurring in certain areas of the image, a phenomenon known as out-of-focus blur. (See reference...) Figure 1 As shown.
[0004] Therefore, there is an urgent need for an image processing method to identify blurred areas in an image and to smoothly adjust the focus height to achieve clear detection during image detection. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide an image processing method, apparatus, device and storage medium that can determine blurred areas in an image so that, during image detection, the focus height can be smoothly adjusted to achieve clear detection.
[0006] This application provides an image processing method, the method comprising:
[0007] Acquire test images of each of multiple identical test objects, including a first test image and a second test image;
[0008] The sharpness difference between the first target region of the first image under test and the second target region of the second image under test is obtained, wherein the relative position of the first target region in the first image under test and the relative position of the second target region in the second image under test are the same;
[0009] The target parameters are obtained based on the sharpness difference.
[0010] If the target parameter is greater than the target threshold, then the first target region and / or the second target region are determined to be image blurred regions.
[0011] This application provides an image processing apparatus, the apparatus comprising:
[0012] The first acquisition unit is used to acquire test images of each test object among multiple identical test objects, the multiple test images including a first test image and a second test image;
[0013] The second acquisition unit is used to acquire the sharpness difference between the first target region of the first image to be tested and the second target region of the second image to be tested, wherein the relative position of the first target region in the first scanned region and the relative position of the second target region in the second scanned region are the same.
[0014] The third acquisition unit is used to acquire target parameters based on the sharpness difference;
[0015] The determining unit is configured to determine the first target region and / or the second target region as image blurred regions if the target parameter is greater than the target threshold.
[0016] This application provides an image processing device, the device including: a processor and a memory;
[0017] The memory is used to store instructions;
[0018] The processor is configured to execute the instructions in the memory and perform the method as described in any of the above embodiments.
[0019] This application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method described in any of the above embodiments.
[0020] This application provides an image processing method. The method includes acquiring test images of multiple identical test objects, including a first test image and a second test image. The method involves obtaining a sharpness difference between a first target region in the first test image and a second target region in the second test image. The first target region and the second target region are located at the same relative position in the first test image and the second target region in the second test image, respectively. A target parameter is obtained based on the sharpness difference. If the target parameter is greater than a target threshold, the first target region and / or the second target region are determined to be blurred regions. This application can determine blurred regions by comparing the sharpness difference between target regions at the same position in different test images, thus automatically identifying blurred regions, improving the efficiency of blurred region recognition, avoiding errors in image blur judgment due to background color differences, improving the accuracy of blurred region determination, and allowing for subsequent smooth adjustment of the focus height to achieve clear detection of the identified blurred regions. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A schematic diagram of a blurred area in an image is shown;
[0023] Figure 2 A schematic flowchart of an image processing method provided in an embodiment of this application is shown;
[0024] Figure 3 This illustration shows a schematic diagram of a wafer image provided in an embodiment of this application;
[0025] Figure 4 This illustration shows a schematic diagram of an image of a first region to be scanned, as provided in an embodiment of this application.
[0026] Figure 5 This illustration shows a gradient diagram of a first region to be scanned, provided in an embodiment of this application.
[0027] Figure 6 A schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application is shown. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0029] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0030] With the technological development of society, the technology in the field of image detection has also developed, especially for the detection and measurement of image defects.
[0031] In practical applications, charge-coupled devices (CCDs) are used to capture images of the object being inspected during image detection. During the capture process, the focusing height of the CCD affects the quality of the final image. For example, poor focusing height can cause blurring in certain areas of the image, a phenomenon known as out-of-focus blur. (See reference...) Figure 1 As shown.
[0032] Therefore, there is an urgent need for an image processing method to identify blurred areas in an image and to smoothly adjust the focus height to achieve clear detection during image detection.
[0033] Based on this, this application provides a method for determining blurred regions in an image. By comparing the sharpness difference between target regions at the same position in different test images, the blurred regions in the image can be determined. This method automatically determines blurred regions in the image, improves the recognition efficiency of blurred regions, avoids errors in image blur judgment caused by background color differences, improves the accuracy of determining blurred regions in the image, and allows for subsequent smooth adjustment of the focus height to achieve clear detection of the identified blurred regions.
[0034] To better understand the technical solution and effects of this application, the specific embodiments will be described in detail below with reference to the accompanying drawings.
[0035] See Figure 2 The figure is a flowchart illustrating an image processing method provided in an embodiment of this application.
[0036] The image processing method provided in this embodiment includes the following steps:
[0037] S101, acquire the test image of each test object among multiple identical test objects.
[0038] In the embodiments of this application, a test image can be obtained by scanning the test object, wherein multiple test objects have the same structure, that is, multiple test objects can be periodically repeated, and different test images may contain the same elements.
[0039] Multiple test objects can be located on the same object or on different objects. For example, multiple test objects can be located on the first object simultaneously, or they can be located on the first object and the second object respectively, where the first object and the second object are objects with the same structure.
[0040] If the first and second objects can be periodic, then the object to be tested can be a periodic structure of the first or second object.
[0041] As an example, the first object and the second object can be a wafer or a display panel, wherein the display panel can be a light-emitting diode (LED) display panel or a liquid crystal display (LCD) display panel.
[0042] For example, when the object is a wafer, the object under test can be a chip (die), and the image to be tested is a chip image, reference. Figure 3 The figure shows a schematic diagram of a wafer provided in an embodiment of this application. As can be seen from the figure, the wafer is circular and the chips are rectangular. The wafer includes multiple chips that are periodically distributed.
[0043] For example, when the object is a display panel, the object to be tested can be the display structure, and the image to be tested is the image of the display structure.
[0044] In the embodiments of this application, the image of each of the multiple test objects can be obtained using a single scan or multiple scans. This will be described in detail below:
[0045] The first possible implementation involves multiple objects under test located on a first object, such as multiple chips set on the same wafer. The test images of multiple objects under test on the first object can be directly obtained by scanning the first object once.
[0046] The second possible implementation involves multiple objects under test located on a first object, such as multiple chips set on the same wafer. The first object can be scanned multiple times, with each scan covering a portion of the first object. By scanning multiple times, images of the multiple objects under test on the first object can be obtained.
[0047] The third possible implementation involves multiple objects under test located on the first object and the second object, respectively. For example, multiple chips are set on two wafers respectively, which can scan the first object and the second object simultaneously to directly obtain the test images of multiple objects under test on the first object and the second object.
[0048] The fourth possible implementation involves multiple objects under test located on the first object and the second object, respectively. For example, multiple chips are set on two wafers respectively, and the first object and the second object can be scanned separately. Specifically, during the scan, the entire first object or a part of the first object can be scanned until the first object is completely scanned. Correspondingly, the entire second object or a part of the second object can be scanned until the second object is completely scanned. In other words, multiple scans can be performed to obtain images of multiple objects under test.
[0049] In practical applications, CCDs can be used to capture images of the objects to be tested.
[0050] In embodiments of this application, the test images of multiple test objects may include a first test image and a second test image, wherein the test object corresponding to the first test image and the test object corresponding to the second test image may be adjacent or not adjacent.
[0051] As an example, the chip corresponding to the first image under test and the chip corresponding to the second image under test are adjacent chips on the same wafer. Adjacent chips are relatively close in position, which has a better effect on the subsequent determination of image blur.
[0052] As another example, the chip corresponding to the first image under test and the chip corresponding to the second image under test are chips set on different wafers.
[0053] S102, obtain the sharpness difference between the first target region of the first image to be tested and the second target region of the second image to be tested.
[0054] In the embodiments of this application, a first image to be tested and a second image to be tested can be obtained by scanning the object to be tested. Simultaneously, images and image data of a first target region and a second target region are obtained. The relative position of the first target region in the first image to be tested and the relative position of the second target region in the second image to be tested are the same. The sharpness can be calculated based on the obtained images of the first target region and the second target region, respectively, to obtain the sharpness difference between the first target region and the second target region.
[0055] In the embodiments of this application, the first target area and the second target area are located at the same position of the first image to be tested and the second image to be tested, respectively. Since the first image to be tested and the second image to be tested are images of the same object, the content of the first image to be tested and the second image to be tested is also the same. Therefore, if the first target area and the second target area are located at the same position of the first image to be tested and the second image to be tested, the content of the first target area and the second target area is also the same. Therefore, if the first target area or the second target area is unclear, the clarity between the two can be used to reflect the situation.
[0056] In the embodiments of this application, the first target region and the second target region may include one or more location points, wherein the location points may be pixels or sub-pixels. The values calculated using one or more location points reflect the sharpness of the first target region and the second target region, which will be described in detail below:
[0057] The first sharpness can be obtained by obtaining the linear combination value of the sharpness characterization parameters of each location point in the first target area, and the second sharpness can be obtained by obtaining the linear combination value of the sharpness characterization parameters of each location point in the second target area. Then, the sharpness difference value is obtained based on the difference between the obtained first sharpness and second sharpness.
[0058] Specifically, sharpness representation parameters can include gradient values, Fourier function values, or cosine function values. Linear combination values include sums or weighted values, and weighted values include average values. In other words, the sharpness difference can be obtained using the average or sum of gradient values, Fourier function values, or cosine function values.
[0059] In practical applications, the first image to be tested may include one or more first target regions, and correspondingly, the second image to be tested may also include one or more second target regions. Before obtaining the sharpness difference between the first target region of the first image to be tested and the second target region of the second image to be tested, the first target region and the second target region that need to be compared in sharpness can be determined first.
[0060] Specifically, the first and second images to be tested can be matched to make each point of the first and second images to be tested correspond one-to-one. After matching the first and second images to be tested according to the position points, the similarity of the corresponding regions of the first and second images to be tested has a maximum value or is greater than a preset value, so that the first and second images to be tested can be compared for clarity. Then, according to the correspondence of each point of the first and second images to be tested, the one-to-one corresponding first and second target regions can be obtained.
[0061] In the embodiments of this application, when both the first target region and the second target region include only one location point, the sharpness difference can be obtained by using the gradient value included in the sharpness characterization parameter.
[0062] Specifically, the sharpness representation parameter is the gradient value. Gradient processing is performed on the location points of the first target region and the second target region, respectively. The gradient value of the location points of the first target region is used as the first sharpness, and the gradient value of the location points of the second target region is used as the second sharpness. The sharpness difference is obtained based on the difference between the first and second sharpness values obtained using the gradient values. The gradient processing can be performed using the Sobel operator to obtain the gradient values.
[0063] As an example, gradient calculations can be performed on multiple location points in the first target region and the second target region respectively to obtain gradient maps of the first target region and the second target region, that is, to obtain gradient values of the first target region and the second target region respectively.
[0064] As an example, see reference Figure 4 As shown, Figure 4 This application illustrates an image diagram of a first target region according to an embodiment of the present application. Gradient calculation is performed on the image of the first target region to obtain a gradient map of the first target region. (Refer to...) Figure 5 As shown. Figure 5 The gradient map shown includes a large area of black background color. However, this background color may not be a blurred area of the image. It may be a smooth area of the image itself. In this case, the clarity of other images under test can be compared to further determine whether it is a blurred area. This avoids the error in judging the image blur due to the presence of background color difference and improves the accuracy of the determination of the blurred area.
[0065] As another example, the sharpness characterization parameter is the Fourier function value. The first sharpness is obtained by summing the Fourier function values of each location point in the first target area, and the second sharpness is obtained by summing the Fourier function values of each location point in the second target area. The sharpness difference is obtained by the difference between the first sharpness and the second sharpness obtained by summing the Fourier function values.
[0066] In the embodiments of this application, when the location point is a pixel, the sharpness difference can be directly calculated using the sum or average of gradient values, Fourier function values, or cosine function values. When the location point is a sub-pixel, the sharpness characterization parameters of each pixel in the image under test can be interpolated or fitted to obtain the sharpness characterization parameters of each location point.
[0067] Specifically, the third sharpness is obtained by interpolating or fitting the sharpness characterization parameters of the first target region of the first test image, and the fourth sharpness is obtained by subtracting or fitting the sharpness characterization parameters of the second target region of the second test image. Then, the difference between the third sharpness and the fourth sharpness is obtained as the sharpness difference value. S103, the target parameters are obtained based on the sharpness difference value.
[0068] In the embodiments of this application, in order to facilitate the determination of whether an image is blurry based on the sharpness difference, a target parameter can be obtained based on the sharpness difference for subsequent comparison.
[0069] As an example, the ratio of the sharpness difference to the target sharpness can be obtained to get the target parameter. That is, the ratio is used as the target parameter, where the target sharpness can be the sharpness of a first target area, the sharpness of a second target area, or a fixed sharpness value.
[0070] As another example, the sharpness difference is determined as the target parameter, that is, the obtained sharpness difference is used directly for fuzzy judgment.
[0071] S104, if the target parameter is greater than the target threshold, then the first target region and / or the second target region are determined to be image blurred regions.
[0072] In the embodiments of this application, after obtaining the sharpness difference between the first target region and the second target region, and after determining the target parameters based on the sharpness difference, the parameters can be compared with the target threshold to obtain the result of whether the first target region and / or the second target region is a blurred region of the image.
[0073] The target threshold is determined based on the correspondence between the target parameters and the image blur probability. In other words, there is a corresponding relationship between the target parameters and the image blur probability. Specifically, there is a positive correlation between the target parameters and the image blur probability. That is, a larger target parameter means a larger difference in sharpness and a higher probability of image blur, while a smaller target parameter means a lower probability of image blur. The target threshold can be used as a boundary value to determine whether an image is blurred. In other words, the target threshold can be used to determine whether image blur exists. This provides a quantitative standard for determining image blur and assists in the determination of image blur.
[0074] When the target parameter is the ratio of the sharpness difference to the target sharpness, the target threshold can be in the range of 0.1-0.5.
[0075] As an example, the target threshold is 0.2, meaning that if the target parameter is greater than 0.2, then image blurring is determined to occur.
[0076] Therefore, when the target parameter is greater than the target threshold, the first target region and / or the second target region are determined to be the blurred region of the image.
[0077] In practical applications, when the difference in sharpness between the first target region and the second target region is large, the target region with lower sharpness is more likely to have image blur. The target region with a larger average or sum value can be further determined to have image blur by comparing its sharpness with that of other target regions.
[0078] In practical applications, when the test object corresponding to the first target area and the test object corresponding to the second target area are adjacent, the test image can be directly obtained by scanning once with a small error. At this time, the comparison of sharpness will be more accurate, which can improve the accuracy of judging image blur.
[0079] refer to Figure 5 As shown, if the difference in sharpness between the first target region pointed to by the arrow in the first test image and the second target region in the second test image is greater than the target threshold, then the first target region pointed to by the arrow is a blurred region of the image.
[0080] In the embodiments of this application, when the first image to be tested includes multiple first target regions and the second image to be tested also includes multiple second target regions, the steps of obtaining the sharpness difference between the first target regions and the second target regions can be repeated, obtaining the target parameter based on the sharpness difference, and determining the first target region and / or the second target region as image blur regions if the target parameter is greater than the target threshold, thereby determining whether the multiple first target regions and the multiple second target regions are image blur.
[0081] In the embodiments of this application, if the areas of the first target region and the second target region are large, they can be used as the initial determination of the blurred image region. Furthermore, the image blurred region can be further determined for the sub-regions at the same position in the first target region and the second target region, so as to further obtain the image blurred region and improve the accuracy of the image blurred region.
[0082] In the embodiments of this application, there may be a need for more precise determination of blurred areas in an image. Therefore, the areas of the first target area and the second target area can be smaller, which allows for more refined screening of blurred areas. However, smaller areas of the first target area and the second target area may lead to excessively long comparison time between the first and second images under test, affecting the efficiency of determining blurred areas in the entire image under test. Therefore, larger areas of the first target area and the second target area can be used to first determine the approximate area where image blur may exist, and then a smaller area can be selected from the first target area and the second target area for further image blur determination. This can reduce the determination time of blurred areas and improve the determination efficiency of blurred areas.
[0083] Specifically, the first target area includes a first sub-region, and the second target area includes a second sub-region. The relative positions of the first sub-region and the second sub-region in the first target area are the same, meaning that the image content of the first sub-region and the second sub-region is the same, which can be used to compare their sharpness.
[0084] The sharpness difference between the first and second sub-regions can be obtained. Both the first and second sub-regions include one or more location points. Therefore, the gradient values, Fourier function values, or cosine function values of multiple location points can be averaged to obtain the average values of the first and second sub-regions, respectively. Alternatively, the gradient values, Fourier function values, or cosine function values of multiple location points can be summed to obtain the sum values of the first and second sub-regions, respectively. Then, the sharpness difference is compared. If the target parameter is greater than the target threshold, the first and / or second sub-regions are determined to be blurred areas of the image.
[0085] In practical applications, when the difference in sharpness between the first and second sub-regions is large, the sub-region with the smaller average or sum value is more likely to have image blur. The sub-region with the larger average or sum value can be compared with the other sub-regions to further determine whether image blur exists.
[0086] In the embodiments of this application, after determining that the region with lower clarity is a blurred region by using the clarity difference between the first target region in the first image to be tested and the second target region in the second image to be tested, the region with higher clarity can be further compared with other images to be tested in order to determine whether the target region corresponding to the region with higher clarity also has image blur.
[0087] Specifically, the region with greater clarity in the first and second target regions can be designated as the region to be determined. Then, a third test image is obtained from multiple test images, and the clarity difference between the region to be determined and the third target region in the third test image is obtained. The relative position of the region to be determined in the first or second test image is the same as the relative position of the third target region in the third test image. The target parameter is obtained based on the clarity difference between the region to be determined and the third target region. If the target parameter is greater than the target threshold, the region to be determined and / or the third target region is determined as a blurred region of the image.
[0088] If the target parameter is greater than the target threshold, the steps for determining the undetermined region and / or the third target region as the blurred region of the image are the same as the steps for determining the first target region and / or the second target region as the blurred region of the image if the target parameter is greater than the target threshold, and will not be repeated here.
[0089] Therefore, this application can compare the sharpness of target areas at the same location in different test images to determine whether there is image blur. This enables automated determination of image blur and allows for the use of different precision determination methods according to actual needs, thus meeting diverse precision requirements for image blur determination.
[0090] In the embodiments of this application, before obtaining the sharpness difference between the first target region and the second target region, the size of the obtained image to be tested can be reduced, that is, downsampling is performed. After the image to be tested is reduced, the sharpness difference calculated is larger, which improves the speed when comparing the sharpness.
[0091] Specifically, downsampling can be used to reduce the size of the acquired image to be tested by a target factor.
[0092] In practical applications, the specific target magnification can be determined based on the size of the image to be measured. This allows the image to be reduced in size according to the actual situation, satisfying various reduction requirements.
[0093] As an example, the size of the image to be tested can be 20 cm × 20 cm, and the target magnification can be 64 times, that is, reducing the image to be tested to 2.5 cm × 2.5 cm.
[0094] In the embodiments of this application, when reducing the size of the image to be tested, a pyramid downsampling method can be used, that is, multiple reductions can be performed. This can avoid the interpolation effect caused by a one-time reduction, retain more image details, and ultimately improve the accuracy of image blur determination.
[0095] As one possible implementation, the image to be tested is downsampled first to reduce the size of the image to be tested by a first factor, and then the image to be tested is downsampled second to reduce the size of the image to be tested by a second factor. The target factor is the product of the first factor and the second factor, and both the first downsampling and the second downsampling are pyramid downsampling.
[0096] As another possible implementation, the size of the image to be tested is reduced by a first factor, a second factor, and a third factor in sequence, where the target factor is the product of the first factor, the second factor, and the third factor.
[0097] As an example, the target multiplier is 64x, and the first, second, and third multipliers are all 4x. That is, the size of the image to be tested is reduced three times, each time by a factor of 4.
[0098] This application provides an image processing method that can determine blurred areas in an image by comparing the sharpness difference between target areas at the same position in different test images. This method automatically determines blurred areas, improves the efficiency of blurry area recognition, avoids errors in image blur judgment due to background color differences, improves the accuracy of blurry area determination, and allows for subsequent smooth adjustment of focus height to achieve clear detection of the identified blurred areas.
[0099] Based on the image processing method provided in the above embodiments, this application also provides an image processing device, the working principle of which will be described in detail below with reference to the accompanying drawings.
[0100] See Figure 6 The figure is a schematic diagram of the structure of an image processing device provided in an embodiment of this application.
[0101] The image processing apparatus 600 provided in this embodiment includes:
[0102] The first acquisition unit 610 is used to acquire the test image of each of the multiple identical test objects, the multiple test images including the first test image and the second test image;
[0103] The second acquisition unit 620 is used to acquire the sharpness difference between the first target region of the first image to be tested and the second target region of the second image to be tested, wherein the relative position of the first target region in the first scanned region and the relative position of the second target region in the second scanned region are the same.
[0104] The third acquisition unit 630 is used to acquire target parameters based on the sharpness difference;
[0105] The determining unit 640 is configured to determine the first target region and / or the second target region as image blurred regions if the target parameter is greater than the target threshold.
[0106] Optionally, the device further includes a fourth acquisition unit, configured to acquire a target threshold based on the correspondence between the target parameters and the image blur probability.
[0107] Optionally, the first target region and the second target region include one or more location points, and the second acquisition unit 620 is used to:
[0108] The first sharpness is obtained by obtaining a linear combination of the sharpness characterization parameters of each location point in the first target area;
[0109] The second sharpness is obtained by obtaining a linear combination of the sharpness characterization parameters of each location point in the second target area;
[0110] The difference between the first and second sharpness values is obtained to obtain the sharpness difference value.
[0111] Optionally, the sharpness representation parameters include gradient values, Fourier function values, or cosine function values; the linear combination values include sums or weighted values, and the weighted values include average values.
[0112] Optionally, the first image to be tested includes one or more first target regions; the second image to be tested includes one or more second target regions.
[0113] Before the second acquisition unit 620 acquires the sharpness difference between the first target region of the first image to be tested and the second target region of the second image to be tested, it further includes: a matching unit, used to perform matching processing on the first image to be tested and the second image to be tested, so that each point of the first image to be tested and the second image to be tested corresponds one-to-one, and the similarity of the corresponding regions of the first image to be tested and the second image to be tested has a maximum value or greater than a preset value.
[0114] Based on the correspondence between points in the first and second test images, the first target region and the second target region are obtained, and the first target region and the second target region correspond one-to-one.
[0115] Optionally, the sharpness representation parameter includes a gradient value; the first target region and the second target region each include a location point;
[0116] The second acquisition unit 620 is used for:
[0117] Gradient processing is performed on the location points of the first target region to obtain the gradient values of the location points of the first target region; the gradient values are used as the first sharpness.
[0118] Gradient processing is performed on the location points of the second target region to obtain the gradient values of the location points of the second target region; the gradient values are used as the second sharpness.
[0119] The gradient calculation process includes obtaining the gradient value using the Sobel operator.
[0120] Optionally, the first image to be tested includes multiple first target regions; the second image to be tested includes multiple second target regions.
[0121] It also includes: a repetition unit, used to repeatedly acquire the sharpness difference between the first target region of the first image to be tested and the second target region of the second image to be tested, until the target parameter is greater than the target threshold, and then determine the first target region and / or the second target region as a blurred region of the image, and acquire whether multiple first target regions and / or multiple second target regions are blurred regions of the image.
[0122] Optionally, before acquiring the sharpness difference between the first target region of the first image under test and the second target region of the second image under test, the second acquisition unit 620 further includes: a downsampling unit, used for:
[0123] The image to be tested is downsampled to reduce its size by a target factor.
[0124] Optionally, the downsampling unit is used for:
[0125] The image to be tested is downsampled in the first way, reducing the size of the image to be tested by the first factor.
[0126] The image under test after the first downsampling is then downsampled a second time, and the image under test is reduced by a second factor; the first downsampling is pyramid downsampling, and the second downsampling is pyramid downsampling.
[0127] Optionally, the plurality of test objects are located on the first object, and the first acquisition unit 610 is used for:
[0128] By scanning the first object once or multiple times, multiple test images of the first object are obtained; the test object corresponding to the first test image and the test object corresponding to the second test image are adjacent.
[0129] Optionally, the first object is periodic, and the test object is one period of the first object.
[0130] Optionally, the determining unit 640 is configured to: obtain the region with lower clarity between the first target region and the second target region as the image blurred region, and the region with higher clarity between the first target region and the second target region as the region to be determined;
[0131] It also includes: a comparison unit, used for:
[0132] A third image to be tested is acquired from a plurality of images to be tested, and the sharpness difference between a region to be determined and a third target region in the third image to be tested is acquired; the relative position of the region to be determined in the first image to be tested or the second image to be tested is the same as the relative position of the third target region in the third image to be tested.
[0133] The target parameters are obtained based on the sharpness difference.
[0134] If the target parameter is greater than the target threshold, then the undetermined region and / or the third target region are determined to be image blurred regions.
[0135] Optionally, the third acquisition unit 630 is configured to include:
[0136] The target parameter is obtained by obtaining the ratio of the sharpness difference to the target sharpness; or, the sharpness difference is determined as the target parameter; the target sharpness is the sharpness of the first target area, the sharpness of the second target area, or a fixed sharpness value.
[0137] Optionally, when obtaining the target parameter by obtaining the ratio of the sharpness difference to the target sharpness, the target threshold ranges from 0.1 to 0.5.
[0138] Based on the image processing method provided in the above embodiments, this application also provides an image processing device, which includes:
[0139] The processor and memory may be present, and the number of processors may be one or more. In some embodiments of this application, the processor and memory may be connected via a bus or other means.
[0140] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include NVRAM. Memory stores the operating system and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof. The operating instructions may include a variety of operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic business functions and handling hardware-based tasks.
[0141] The processor controls the operation of the terminal device; the processor can also be called the CPU.
[0142] The methods disclosed in the embodiments of this application can be applied to a processor or implemented by a processor. A processor can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as execution by a hardware decoding processor, or as a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0143] This application also provides a computer-readable storage medium for storing program code that is used to execute any of the methods in the foregoing embodiments.
[0144] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0145] It should be noted that the computer-readable medium described above in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0146] When describing elements of various embodiments of this application, the articles “a,” “an,” “this,” and “described” are all intended to indicate that there are one or more elements. The words “comprising,” “including,” and “having” are inclusive and mean that there may be other elements in addition to those listed.
[0147] It should be noted that those skilled in the art will understand that all or part of the processes in the above method embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0148] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The units and modules described as separate components may or may not be physically separate. Furthermore, some or all of the units and modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0149] The above description is merely a preferred embodiment of this application. Although this application has disclosed preferred embodiments above, it is not intended to limit this application. Any person skilled in the art can make many possible variations and modifications to the technical solutions of this application using the methods and techniques disclosed above, or modify them into equivalent embodiments with equivalent changes, without departing from the scope of the technical solutions of this application. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of this application without departing from the content of the technical solutions of this application shall still fall within the protection scope of the technical solutions of this application.
Claims
1. An image processing method, characterized in that, The method includes: Acquire test images of each of a plurality of identical test objects, the plurality of test images including a first test image and a second test image, wherein the plurality of test objects are located on a first object, and the acquisition of test images of each of the plurality of identical test objects includes: By scanning the first object once or multiple times, multiple test images of the first object are obtained; the test object corresponding to the first test image and the test object corresponding to the second test image are adjacent; The sharpness difference between the first target region of the first image under test and the second target region of the second image under test is obtained, wherein the relative position of the first target region in the first image under test and the relative position of the second target region in the second image under test are the same; The target parameters are obtained based on the sharpness difference. If the target parameter is greater than the target threshold, then the first target region and / or the second target region are determined to be image blurred regions.
2. The method according to claim 1, characterized in that, The method further includes obtaining a target threshold based on the correspondence between the target parameters and the image blur probability.
3. The method according to claim 1, characterized in that, The first target region and the second target region include one or more location points, and obtaining the sharpness difference between the first target region of the first image under test and the second target region of the second image under test includes: The first sharpness is obtained by obtaining a linear combination of the sharpness characterization parameters of each location point in the first target area; The second sharpness is obtained by obtaining a linear combination of the sharpness characterization parameters of each location point in the second target area; The difference between the first and second sharpness values is obtained to obtain the sharpness difference value.
4. The method according to claim 3, characterized in that, The sharpness representation parameters include gradient values, Fourier function values, or cosine function values; the linear combination values include sum values or weighted values, and the weighted values include average values.
5. The method according to claim 1, characterized in that, The first image to be tested includes one or more first target regions; the second image to be tested includes one or more second target regions; Before obtaining the sharpness difference between the first target region of the first image to be tested and the second target region of the second image to be tested, the method further includes: performing matching processing on the first image to be tested and the second image to be tested, so that each point of the first image to be tested and the second image to be tested corresponds one-to-one, and the similarity of the corresponding regions of the first image to be tested and the second image to be tested has a maximum value or greater than a preset value. Based on the correspondence between points in the first and second test images, the first target region and the second target region are obtained, and the first target region and the second target region correspond one-to-one.
6. The method according to claim 4, characterized in that, The sharpness representation parameters include gradient values; the first target region and the second target region each include a location point; The first sharpness is obtained by obtaining a linear combination of the sharpness characterization parameters of each location point in the first target region, including: Gradient processing is performed on the location points of the first target region to obtain the gradient values of the location points of the first target region; the gradient values are used as the first sharpness. The method of obtaining the second sharpness by acquiring the linear combination value of the sharpness characterization parameters of each location point in the second target region includes: Gradient processing is performed on the location points of the second target region to obtain the gradient values of the location points of the second target region; the gradient values are used as the second sharpness. The gradient calculation process includes obtaining the gradient value using the Sobel operator.
7. The method according to claim 1, characterized in that, The first image to be tested includes multiple first target regions; the second image to be tested includes multiple second target regions; The method further includes: repeatedly acquiring the sharpness difference between the first target region of the first image to be tested and the second target region of the second image to be tested, until the target parameter is greater than the target threshold, and then determining that the first target region and / or the second target region is a blurred region of the image, and acquiring whether multiple first target regions and / or multiple second target regions are blurred regions of the image.
8. The method according to claim 1, characterized in that, Before acquiring the sharpness difference between the first target region of the first image under test and the second target region of the second image under test, the method further includes: The image to be tested is downsampled to reduce its size by a target factor.
9. The method according to claim 8, characterized in that, The downsampling of the image to be tested, reducing the size of the image to be tested by a target factor, includes: The image to be tested is downsampled first, reducing the size of the image to be tested by a first factor; The image under test after the first downsampling is then downsampled a second time, and the image under test is reduced by a second factor; the first downsampling is pyramid downsampling, and the second downsampling is pyramid downsampling.
10. The method according to claim 1, characterized in that, The first object is periodic, and the test object is one period of the first object.
11. The method according to claim 1, characterized in that, If the target parameter is greater than the target threshold, then determining the first target region and / or the second target region as a blurred image region includes: obtaining the region with lower clarity between the first target region and the second target region as the blurred image region, and the region with higher clarity between the first target region and the second target region as the region to be determined; The method further includes: A third image to be tested is acquired from a plurality of images to be tested, and the sharpness difference between a region to be determined and a third target region in the third image to be tested is acquired; the relative position of the region to be determined in the first image to be tested or the second image to be tested is the same as the relative position of the third target region in the third image to be tested. The target parameters are obtained based on the sharpness difference. If the target parameter is greater than the target threshold, then the undetermined region and / or the third target region are determined to be image blurred regions.
12. The method according to any one of claims 1-11, characterized in that, The step of obtaining the target parameters based on the sharpness difference includes: The target parameter is obtained by obtaining the ratio of the sharpness difference to the target sharpness; or, the sharpness difference is determined as the target parameter; the target sharpness is the sharpness of the first target area, the sharpness of the second target area, or a fixed sharpness value.
13. The method according to claim 12, characterized in that, When the target parameter is obtained by obtaining the ratio of the sharpness difference to the target sharpness, the target threshold ranges from 0.1 to 0.
5.
14. An image processing apparatus, characterized in that, The device includes: The first acquisition unit is configured to acquire test images of each of a plurality of identical test objects, wherein the plurality of test images include a first test image and a second test image, wherein the plurality of test objects are located on a first object, and the acquisition of test images of each of the plurality of identical test objects includes: By scanning the first object once or multiple times, multiple test images of the first object are obtained; the test object corresponding to the first test image and the test object corresponding to the second test image are adjacent; The second acquisition unit is used to acquire the sharpness difference between the first target region of the first image under test and the second target region of the second image under test, wherein the relative position of the first target region in the first image under test and the relative position of the second target region in the second image under test are the same. The third acquisition unit is used to acquire target parameters based on the sharpness difference; The determining unit is configured to determine the first target region and / or the second target region as image blurred regions if the target parameter is greater than the target threshold.
15. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1-13.