Image Processing Method, Computer Device, and Computer-Readable Storage Medium

By establishing different sizes for each pixel of the CMOS image sensor for mean filtering, calculating the difference image and performing binarization processing, the problem that the CMOS image sensor cannot effectively reflect the abnormal details at special locations in detail detection, and effective retention and detection of image details are achieved.

CN116416195BActive Publication Date: 2025-06-10SMARTSENS TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111679257.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-06-10
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

In detail detection, CMOS image sensor cannot effectively reflect the details abnormalities in special locations due to fixed filtering areas.

Method used

By establishing a first and second region of different sizes for each pixel for mean filtering, the difference image between the two is calculated and binarized to obtain a detailed detection image.

Benefits of technology

This method can preserve the details of each area of ​​the image to a greater extent, significantly improving the detection ability of abnormal details at special locations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116416195B_ABST
    Figure CN116416195B_ABST
Patent Text Reader

Abstract

The present invention discloses an image processing method, a computer device, and a computer-readable storage medium for detail detection. The image processing method for detail detection includes: obtaining a test image, where the test image includes a plurality of pixels, and each of the plurality of pixels has corresponding pixel data; defining a pixel to be processed, establishing a first region centered on the pixel to be processed, performing mean filtering on the first region to obtain a first filtering value, so as to obtain a first filtered image of the test image; establishing a second region centered on the pixel to be processed, performing mean filtering on the second region to obtain a second filtering value, so as to obtain a second filtered image of the test image; wherein, the sizes of the first region and the second region are different; obtaining a difference image according to the difference between the first filtered image and the second filtered image; performing binarization processing on the difference image to obtain a detail detection image. The present invention can retain the details of each region of the image to a large extent, facilitating the testing and processing of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly to an image processing method, a computer device, and a computer-readable storage medium for detail detection. Background Art

[0002] With the rapid development of technology and the Internet, digital images have now become an indispensable part of people's information acquisition, and also make the application of image sensors more extensive. Image sensors mainly include CMOS image sensors and CCD sensors. In the CP test after wafer circuit manufacturing and the FT test after packaging of CMOS image sensors, small-area detail differences will occur in the chip imaging due to process manufacturing or environmental dust fall, etc. The abnormality of such detail differences cannot be controlled by conventional bad pixel detection, and it is necessary to specifically perform detail highlighting processing and calculation on the image to obtain the test result.

[0003] Currently, detail detection of CMOS image sensors usually uses a region with a relatively fixed position for mean filtering. Since the size of the filtering region is fixed, the image processing for detail detection cannot well reflect the detail abnormality at special positions. Summary of the Invention

[0004] The purpose of the present invention is to provide an image processing method, a computer device, and a computer-readable storage medium for detail detection, which can retain the details of each region of the image to a large extent.

[0005] The present invention provides an image processing method for detail detection, including: Step S1: Obtain a test image; Step S2: Establish a first region centered on each pixel of the test image, and perform mean filtering on each pixel of the test image based on the corresponding first region to obtain a first filtered image; establish a second region centered on each pixel of the test image, and perform mean filtering on each pixel of the test image based on the corresponding second region to obtain a second filtered image; wherein, the sizes of the first region and the second region are different; Step S3: Obtain a difference image according to the difference between the first filtered image and the second filtered image; Step S4: Perform binarization processing on the difference image to obtain a detail detection image.

[0006] The present invention also discloses a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the image processing method described in any one of the above are implemented.

[0007] The present invention also discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the image processing method described in any one of the above are implemented.

[0008] The above-mentioned image processing method, computer device and computer-readable storage medium for detail detection can largely retain the details of each region of the image, facilitating the testing and processing of the image. Description of the Drawings

[0009] Figure 1 It is a schematic diagram of an image processing method for detail detection according to an embodiment of the present invention.

[0010] Figures 2(a) to 2(c) They are respectively a test image, a difference image and a detail detection image according to an embodiment of the present invention.

[0011] Figure 3 It is a schematic diagram of the position of a pixel of a test image and a first region centered on the pixel according to an embodiment of the present invention.

[0012] Figure 4 It is a schematic diagram of a fast column-by-column calculation method for mean filtering according to an embodiment of the present invention.

[0013] Figure 5 It is a schematic diagram of adding a first extended pixel according to an embodiment of the present invention. Detailed Description of the Invention

[0014] To further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following, in conjunction with the drawings and embodiments, details the specific implementation manners, structures, features and effects of the present invention as follows.

[0015] Figure 1 It is a schematic diagram of an image processing method for detail detection according to an embodiment of the present invention. Figures 2(a) to 2(c) They are respectively a test image, a difference image and a detail detection image according to an embodiment of the present invention. Please refer to Figure 1 、 Figures 2(a) to 2(c) each figure. In this embodiment, the processing method of the image for detail detection includes:

[0016] Step S1, obtain a test image, where the test image includes a plurality of pixels, and each of the plurality of pixels has corresponding pixel data.

[0017] In step S1, the user needs to first obtain a test image. For example, a acquisition instruction can be sent to a test device to cause the test device to start image testing and generate a test image. The test image includes a plurality of pixels, and each pixel of the plurality of pixels has corresponding pixel data, as shown in Fig. 2(a). In an example, the test image can be an image after the pixels are converted by ADC and then processed by existing image processing (such as ISP processing), and has a pixel value corresponding to each pixel point (Pixel).

[0018] Step S2: Define the pixel to be processed, establish a first region centered on the pixel to be processed, perform mean filtering on the first region to obtain the first filtered value of the pixel to be processed, so as to obtain the first filtered image of the test image; establish a second region centered on the pixel to be processed, perform mean filtering on the second region to obtain the second filtered value of the pixel to be processed, so as to obtain the second filtered image of the test image; the sizes of the first region and the second region are different.

[0019] In step S2, it is necessary to perform mean filtering on each pixel of the test image twice according to the first region and the second region with different sizes. Among them, defining the pixel to be processed means that the pixels of the test image can be selected one by one in order, for example, selected one by one row by row or column by column. Establish a first region centered on the pixel to be processed, perform mean filtering on the first region to obtain the first filtered value of the pixel to be processed, and thus the first filtered values of each pixel of the test image can be obtained step by step to obtain the first filtered image of the test image. Similarly, establish a second region centered on the pixel to be processed, perform mean filtering on the second region to obtain the second filtered value of the pixel to be processed, and thus the second filtered values of each pixel of the test image can be obtained step by step to obtain the second filtered image of the test image. Among them, the sizes of the first region and the second region are different, the number of pixel arrays included in the first region is different from the number of pixels included in the second region. For example, the first region is a 3*3 pixel area, and the second region is a 5*5 pixel area. In this embodiment, the order of performing mean filtering on the pixel to be processed according to the first region and the second region is not limited. The mean filtering can be performed on the pixel to be processed according to the first region or the second region first, or the mean filtering can be performed on the pixel to be processed according to the first region and the second region at the same time.

[0020] In an embodiment of the invention, the method for establishing the first region centered on the pixel to be processed includes: centered on the pixel to be processed, a matrix block with a size of a*a can be selected as the first region; the method for establishing the second region centered on the pixel to be processed includes: centered on the pixel to be processed, a matrix block with a size of b*b can be selected as the second region; a and b are not equal and are both odd numbers greater than 1.

[0021] Step S3: Obtain a difference image according to the difference between the first filtered image and the second filtered image;

[0022] In step S3, the difference between the first filtered image and the second filtered image can be calculated by taking the difference between the first filtered value and the second filtered value of each pixel, and the absolute value can be taken for the difference to obtain the difference image, as shown in Fig. 2(b).

[0023] Step S4: Binarize the difference image to obtain a detail detection image.

[0024] In step S4, first set a reasonable threshold. The method of setting a reasonable threshold is, for example: select an x*y area (both x and y are integers greater than 1) in the detail detection image, calculate the mean value of this area, and define the mean value of this area as the reasonable threshold. It can be understood that the size or position of the x*y area can be set according to different requirements. For example, one way to set the x*y area is to calculate the difference mean value of the difference image, and select an area where more than 80% of the differences are above this difference mean value as the x*y area; it is also possible to analyze the cumulative probability distribution graph of the entire difference image data, and set the threshold at the front end of the "tail" part of the distribution graph (where the differences are large and the proportion is small); then perform binary processing on the image data of each pixel of the difference image. As shown in Fig. 2(c), when performing binary processing, values greater than the threshold are taken as 1, and values less than the threshold are taken as 0, to obtain the detail detection image. Among them, the area with a value of 1 can be defined as the defect area, and other areas can be ignored. In one embodiment, a difference matrix can be obtained corresponding to the difference image, and based on the numerical distribution of this difference matrix, determine the area with relatively large values, and define the size of the threshold based on this area.

[0025] In this embodiment, since the first area is established with each pixel of the test image as the center, rather than an area at a fixed position, there is an overlap in the first areas established by each pixel of the test image during mean filtering, which can better reflect the detail anomalies at special positions. Similarly, there is also an overlap in the second areas established by each pixel of the test image during mean filtering, which can better reflect the detail anomalies at special positions. In addition, the sizes of the first area and the second area are different. Based on the first area and the second area, the first filtering value and the second filtering value are obtained respectively. Based on the first area and the second area, the processing results of the pixels to be processed are respectively characterized. The difference image obtained according to the difference between the first filtering mean value and the second filtering mean value can better reflect the detail anomalies at special positions. The finally obtained detail detection image can be used to highlight the detail anomalies, realizing the detail detection of the image.

[0026] The image processing method for detail detection in this embodiment can retain the details of each area of the image to a large extent, facilitating the testing and processing of the image.

[0027] Figure 3 It is a schematic diagram of the position of a pixel of the test image and the first area centered on this pixel in an embodiment of the present invention. Figure 4 It is a schematic diagram of the fast column-by-column calculation method of mean filtering in an embodiment of the present invention. Please refer to Figure 3 and Figure 4, the embodiments of the present invention are basically the same as the foregoing embodiments, except that: the manner of defining the pixel to be processed may include: taking the previous pixel as the pixel to be processed to obtain the first region, the first filtering value, the second region, and the second filtering value corresponding to the previous pixel; taking the pixel after the previous pixel as the pixel to be processed to obtain the first region, the first filtering value, the second region, and the second filtering value corresponding to the pixel after the previous pixel; wherein, the previous pixel and the pixel after the previous pixel are adjacent pixels, so that the first region corresponding to the previous pixel and the first region corresponding to the pixel after the previous pixel overlap, and the second region corresponding to the previous pixel and the second region corresponding to the pixel after the previous pixel also overlap.

[0028] In an embodiment of the invention, the manner of performing mean filtering on the first region and / or the second region includes: obtaining a first calculation value and a second calculation value according to the pixel data of the first region corresponding to the previous pixel, the first calculation value being the sum of the pixel data of the first column of the first region corresponding to the previous pixel, the second calculation value being the sum of the data from the second column to the nth column of the first region corresponding to the previous pixel, obtaining the first filtering value corresponding to the previous pixel based on the first calculation value and the second calculation value, where n is the number of columns of the first region; defining the sum of the data of the nth column in the pixel data of the first region corresponding to the pixel after the previous pixel as a third calculation value, and obtaining the first filtering value corresponding to the pixel after the previous pixel based on the second calculation value and the third calculation value;

[0029] And / or, obtaining a fourth calculation value and a fifth calculation value according to the pixel data of the second region corresponding to the previous pixel, the fourth calculation value being the sum of the pixel data of the first column of the second region corresponding to the previous pixel, the fifth calculation value being the sum of the data from the second column to the mth column of the second region corresponding to the previous pixel, obtaining the second filtering value corresponding to the previous pixel based on the fourth calculation value and the fifth calculation value, where m is the number of columns of the second region; defining the sum of the data of the mth column in the pixel data of the second region corresponding to the pixel after the previous pixel as a sixth calculation value, and obtaining the second filtering value corresponding to the pixel after the previous pixel based on the fifth calculation value and the sixth calculation value.

[0030] Specifically, in this embodiment, since the steps of filtering the mean value of the pixel to be processed based on the first region and the second region are substantially the same, therefore, only the example of filtering the mean value of the pixel to be processed based on the first region will be described below. First, the previous pixel can be taken as the pixel to be processed to obtain the first region, the first filtering value, the second region, and the second filtering value corresponding to the previous pixel. Taking this pixel to be processed as the center, a corresponding filtering region such as the first region can be established, as Figure 3 shown, this pixel to be processed can be located at the center of the first region Block. Thus, when Figure 3When performing mean filtering calculation on the pixel to be processed, the data of all pixels in the first region are summed and then averaged, that is, the filtered mean data of the pixel to be processed is Pixel = Average(Block). Of course, the embodiments of the present invention do not limit that the first region must be defined as shown in Figure 3 shown.

[0031] As Figure 4 shown, the next pixel of the previous pixel can also be used as the pixel to be processed to obtain the first region, the first filtering value, the second region, and the second filtering value corresponding to the next pixel. Among them, the previous pixel and the next pixel are adjacent pixels, so that the first region corresponding to the previous pixel and the first region corresponding to the next pixel overlap, and the second region corresponding to the previous pixel and the second region corresponding to the next pixel also overlap. Among them, because the first region corresponding to the previous pixel overlaps with the first region corresponding to the next pixel, the pixel data used in mean filtering also overlaps. Assume that the mean filtering data of the previous pixel is Pixel(t - 1), and the first region corresponding to the previous pixel is Block(t - 1), that is, columns 1 to n. The mean filtering data of the next pixel is Pixel(t), and the first region corresponding to the next pixel is Block(t), that is, columns 2 to n + 1. Then, the first region Block(t - 1) corresponding to the previous pixel and the first region Block(t) corresponding to the next pixel are both n-column data, and there are the same n - 1 column data, that is, columns 2 to n, and there is only a difference in one column. Correspondingly, the calculation of the first filtering values of the previous pixel and the next pixel is as follows:

[0032] Pixel(t - 1) = Average(Block(t - 1)) = Average(Col 1~n)

[0033] = Average(Col 1) + Average(Col 2~n)

[0034] Pixel(t) = Average(Block(t)) = Average(Col 2~n + 1)

[0035] = Average(Col 2~n) + Average(Col n + 1)

[0036] Thus, both Pixel(t - 1) and Pixel(t) are related to Average(Col 2~n), and corresponding substitutions can be made to obtain:

[0037] Pixel(t) = Pixel(t - 1) - Average(Col 1) + Average(Col n + 1);

[0038] Therefore, according to the pixel data of the first region corresponding to the previous pixel, a first calculation value and a second calculation value can be obtained. The first calculation value is the sum of the pixel data in the first column of the first region corresponding to the previous pixel, that is, the sum of the pixel data in the first column in Average(Col 1). The second calculation value is the sum of the data from the second column to the nth column of the first region corresponding to the previous pixel, that is, the sum of the pixel data from the second column to the nth column in Average(Col2~n). Based on the first calculation value and the second calculation value, the first filtering value corresponding to the previous pixel, namely Pixel(t-1), is obtained. n is the number of columns of the first region corresponding to the previous pixel. Define the sum of the data in the nth column of the pixel data of the first region corresponding to the next pixel as the third calculation value, that is, the sum of the data in the (n + 1)th column in Average(Coln+1). Based on the second calculation value and the third calculation value, the first filtering value corresponding to the next pixel, namely Pixel(t), is obtained.

[0039] Among them, because there are n - 1 columns of overlapping data between the first region corresponding to the previous pixel and the first region corresponding to the next pixel, therefore, the calculation of the first filtering value of the next pixel does not need to calculate the pixel data of the first n - 1 columns. That is, the second calculation value can be obtained according to the first filtering value and the first calculation value of the previous pixel, and then based on the second calculation value and the third calculation value, the first filtering value of the next pixel is obtained. Thus, the overall calculation amount is reduced and a large amount of operation time is saved.

[0040] Moreover, for the calculation of the second filtering value of the next pixel, the row-wise fast calculation method of the mean filtering of the above first filtering value can also be used, which will not be elaborated here specifically. The method of performing mean filtering on the second region includes: according to the pixel data of the second region corresponding to the previous pixel, a fourth calculation value and a fifth calculation value are obtained. The fourth calculation value is the sum of the pixel data in the first column of the second region corresponding to the previous pixel. The fifth calculation value is the sum of the data from the second column to the mth column of the second region corresponding to the previous pixel. Based on the fourth calculation value and the fifth calculation value, the second filtering value corresponding to the previous pixel is obtained. m is the number of columns of the second region. Define the sum of the data in the mth column of the pixel data of the second region corresponding to the next pixel as the sixth calculation value. Based on the fifth calculation value and the sixth calculation value, the second filtering value corresponding to the next pixel is obtained.

[0041] However, in the embodiments of the present invention, it is not restricted that two adjacent pixels, namely the previous pixel and the subsequent pixel, must be two pixels in the front - to - back order from left to right. Those skilled in the art can set these two pixels as two vertically adjacent pixels, or other adjacent relationships, that is, as long as the first region corresponding to the previous pixel and the first region corresponding to the subsequent pixel overlap, and the second region corresponding to the previous pixel and the second region corresponding to the subsequent pixel also overlap. Thus, the column - based fast calculation method of mean filtering in this embodiment can be changed to a row - based fast calculation method of mean filtering, etc. The solutions of such calculation methods belong to the conventional transformation of the technical solutions in this embodiment and should also fall within the protection scope of the present invention.

[0042] The image processing method for detail detection in this embodiment can largely retain the details of each region of the image, and can complete image processing more quickly, facilitating the testing and processing of the image.

[0043] Figure 5 It is a schematic diagram of adding a first extended pixel in an embodiment of the present invention. As Figure 5 shown, this embodiment is basically the same as the foregoing embodiment. The difference lies in that before performing mean filtering on the first region, it further includes: obtaining edge pixels, adding first extended pixels centered on the edge pixels based on the size of the first region, and performing edge complementation on the first extended pixels; and / or, before performing mean filtering on the second region, it further includes: obtaining edge pixels, adding second extended pixels centered on the edge pixels based on the size of the second region, and performing edge complementation on the second extended pixels.

[0044] Specifically, as Figure 5 shown, the test image is in the middle. Edge pixels are selected, and first extended pixels surrounding the test image can be generated based on the size of the first region, and edge complementation can be performed by assigning values to the first extended pixels. For example, if the size of the first region is selected as 3*3, then for the outermost row of pixels of the test image, they can all be used as the edge pixels here. By forming the first extended pixels, each edge pixel can form a first region located at the center of the 3*3 region. Similarly, edge pixels can be selected, and second extended pixels surrounding the test image can be generated based on the size of the second region, and edge complementation can be performed by assigning values to the second extended pixels. Through edge complementation, the first extended pixels have corresponding pixel data, so that when the pixel to be processed performs mean filtering based on the first region, the pixel data of the first extended pixels can be directly called, and / or through edge complementation, the second extended pixels have corresponding pixel data, so that when the pixel to be processed performs mean filtering based on the second region, the pixel data of the second extended pixels can be directly called.

[0045] In an embodiment of the invention, the method for edge completion of the first extended pixel and / or edge completion of the second extended pixel includes: performing mirror flipping with the row where the edge pixel at the uppermost row or the lowermost row is located as the axis of symmetry to complete the pixel data of the extended pixel; performing mirror flipping with the column where the edge pixel at the leftmost column or the rightmost column is located as the axis of symmetry to complete the pixel data of the extended pixel. However, the embodiment of the invention does not limit the sequence of the two mirror flips, i.e., performing mirror flipping with the row where the edge pixel at the uppermost row or the lowermost row is located as the axis of symmetry and performing mirror flipping with the column where the edge pixel at the leftmost column or the rightmost column is located as the axis of symmetry, during edge completion. Of course, in other embodiments, it may also be to flip and extend at least two rows and two columns and make supplements according to the actual region size, etc.

[0046] For example, the edge pixels in this embodiment can be defined as the pixels at the uppermost row, the lowermost row, the leftmost column, and the rightmost column. If the first region is set to 3x3, then based on the edge pixels and with the size of the first region being 3x3, the first extended pixels can be obtained by adding one row above the uppermost row, one row below the lowermost row, one column to the left of the leftmost column, and one column to the right of the rightmost column in the test image, as Figure 5 shown. The edge completion can be: performing symmetric flipping centered on a single edge pixel, such as left-right symmetry, up-down symmetry, upper-left and lower-right symmetry, and lower-left and upper-right symmetry; or directly performing mirror flipping with the row where the edge pixel at the uppermost row or the lowermost row in the image before extension is located as the axis of symmetry to complete the pixel data of the first extended pixel. Then, the pixel data of the pixels in the second row is mirrored with the uppermost row as the axis of symmetry to complete the pixel data of the first extended pixel in the upper row, and the pixel data of the pixels in the penultimate row is mirrored with the lowermost row as the axis of symmetry to complete the pixel data of the first extended pixel in the lower row. Then, perform mirror flipping with the column where the edge pixel at the leftmost column or the rightmost column in the image before extension is located as the axis of symmetry to complete the pixel data of the first extended pixel. The pixel data of the pixels in the second column is mirrored with the leftmost column as the axis of symmetry to complete the pixel data of the first extended pixel in the left column, and the pixel data of the pixels in the penultimate column is mirrored with the rightmost column as the axis of symmetry to complete the pixel data of the first extended pixel in the right column. Thus, the pixel data of the first extended pixel is completed. By mirror flipping to complete the pixel data of the extended pixel, the time required for edge completion can be reduced.

[0047] In an embodiment of the invention, before defining the pixels to be processed, it may further include: performing a scaling process on the test image. Herein, the scaling process can be understood as an increase or decrease in the number of corresponding pixels in the test image achieved through different processing methods. And in an embodiment of the invention, the method of performing a scaling process on the test image may include: dividing the test image into several regions with a size of t*t, and redefining the several regions as the pixels of the test image; summing and averaging the pixel data of each region within the several regions to obtain the pixel data of each pixel of the test image, where t is a natural number greater than 1. It can be considered that each region corresponds to an updated pixel, and an updated pixel value is obtained for each updated pixel, for example, obtained by the above method of summing and averaging, to obtain an updated test image; wherein, the pixels to be processed in the subsequent steps are selected from the updated pixels in the updated test image. It should be noted that all the method steps described above for the test image in this embodiment are applicable to the updated test image herein. For example, in a specific embodiment, it may be a reduction process on a 16*16 test image, and t is selected as 4 to obtain a 4*4 updated test image. In this embodiment, through the reduction process of the test image, the overall calculation amount is reduced, and a large amount of operation time is saved. Of course, in some embodiments, an updated test image can also be obtained by increasing the number of corresponding pixels in the test image through different methods.

[0048] An embodiment of the invention further provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the image processing method in the above embodiment. For the implementation manner of the computer device in this embodiment, please refer to the foregoing embodiment, and the repeated parts will not be described again.

[0049] An embodiment of the invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the image processing method in the above embodiment. For the implementation manner of the computer-readable storage medium in this embodiment, please refer to the foregoing embodiment, and the repeated parts will not be described again.

[0050] The image processing method, test device, computer device, and computer-readable storage medium for detail detection provided by the embodiments of the invention can largely retain the details of each region of the image, facilitating the testing and processing of the image.

[0051] The above are only the preferred embodiments of the present invention, and there is no restriction on the present invention in any form. Although the present invention has been disclosed above with the preferred embodiments, it is not intended to limit the present invention. Any person skilled in the relevant art can make some changes or modifications to equivalent embodiments with equivalent changes within the scope of the technical solution of the present invention by using the above-disclosed technical content. However, as long as it does not depart from the content of the technical solution of the present invention, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention still fall within the scope of the technical solution of the present invention.

Claims

1. An image processing method for detail detection, characterized in that, it includes: Obtain a test image, the test image includes a number of pixels, and each pixel has corresponding pixel data; Define a pixel to be processed, establish a first area centered on the pixel to be processed, perform mean filtering on the first area to obtain a first filtered value of the pixel to be processed, and obtain a first filtered image of the test image; Establish a second area centered on the pixel to be processed, perform mean filtering on the second area to obtain a second filtered value of the pixel to be processed, and obtain a second filtered image of the test image; wherein, the sizes of the first area and the second area are different; Obtain a difference image according to the difference between the first filtered image and the second filtered image; Perform binarization processing on the difference image to obtain a detail detection image.

2. The image processing method according to claim 1, characterized in that, The method for establishing the first area centered on the pixel to be processed includes: taking a matrix block of size a*a centered on the pixel to be processed as the first area; The method for establishing the second area centered on the pixel to be processed includes: taking a matrix block of size b*b centered on the pixel to be processed as the second area; a and b are not equal and are both odd numbers greater than 1.

3. The image processing method according to claim 1, characterized in that, The method for defining the first area and / or the second area includes: Obtain the first area and the second area corresponding to the previous pixel based on the previous pixel; Obtain the first area and the second area corresponding to the next pixel based on the next pixel; wherein, the previous pixel and the next pixel are adjacent pixels, the first area corresponding to the previous pixel and the first area corresponding to the next pixel have an overlap, and / or, the second area corresponding to the previous pixel and the second area corresponding to the next pixel have an overlap.

4. The image processing method according to claim 3, characterized in that, The method for performing mean filtering on the first area and / or the second area includes: According to the pixel data of the first area corresponding to the previous pixel, obtain a first calculated value and a second calculated value, the first calculated value is the sum of the pixel data in the first column of the first area corresponding to the previous pixel, the second calculated value is the sum of the data from the second column to the nth column of the first area corresponding to the previous pixel, and obtain the first filtered value corresponding to the previous pixel based on the first calculated value and the second calculated value, where n is the number of columns of the corresponding first area; Define the sum of the data in the nth column of the pixel data of the first area corresponding to the next pixel as a third calculated value, and obtain the first filtered value corresponding to the next pixel based on the second calculated value and the third calculated value; And / or, obtaining a fourth calculated value and a fifth calculated value according to pixel data of a second region corresponding to the previous pixel, where the fourth calculated value is the sum of pixel data of the first column of the second region corresponding to the previous pixel, the fifth calculated value is the sum of data of the second to the m-th columns of the second region corresponding to the previous pixel, and obtaining a second filtering value corresponding to the previous pixel based on the fourth calculated value and the fifth calculated value, where m is the number of columns of the corresponding second region; Defining the sum of data of the m-th column in pixel data of a second region corresponding to the subsequent pixel as a sixth calculated value, and obtaining a second filtering value corresponding to the subsequent pixel based on the fifth calculated value and the sixth calculated value.

5. The image processing method according to claim 1, characterized in that, before performing mean filtering on the first region, further comprising: obtaining edge pixels, adding first extended pixels centered on the corresponding edge pixels based on the size of the first region, and performing edge completion on the first extended pixels; and / or, before performing mean filtering on the second region, further comprising: obtaining edge pixels, adding second extended pixels centered on the corresponding edge pixels based on the size of the second region, and performing edge completion on the second extended pixels.

6. The image processing method according to claim 5, characterized in that, the method for performing edge completion on the first extended pixels includes: performing mirror flipping with the row where the edge pixel is located as the axis of symmetry to supplement pixel data of the first extended pixels; performing mirror flipping with the column where the edge pixel is located as the axis of symmetry to supplement pixel data of the first extended pixels; and / or the method for performing edge completion on the second extended pixels includes: performing mirror flipping with the row where the edge pixel is located as the axis of symmetry to supplement pixel data of the second extended pixels; performing mirror flipping with the column where the edge pixel is located as the axis of symmetry to supplement pixel data of the second extended pixels.

7. The image processing method according to claim 1, characterized in that, before defining the pixel to be processed, further comprising: performing scaling processing on the test image.

8. The image processing method according to claim 7, characterized in that, the method for performing scaling processing on the test image includes: dividing the test image into several regions with a size of t*t, summing pixel data of each region to obtain an updated pixel value, and obtaining an updated test image of the test image based on each updated pixel value, and the pixel to be processed is selected from updated pixels in the updated test image; where t is a natural number greater than 1.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, when the processor executes the computer program, the steps of the image processing method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium, having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Real-time omnidirectional target detection method and system based on FPGA

    CN112150409A

  • Image enhancement method and device, equipment and medium

    CN113781338A