Image processing method, device and computer readable storage medium

By preprocessing the image, the pixel coordinate set and mean value of the connected area are determined, and the global mean value is calculated to eliminate the interference area, which solves the problem of difficulty in identifying interference areas with similar shapes in the image and improves the accuracy of the calculation results.

CN114841896BActive Publication Date: 2024-09-06GOERTEK INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210608745.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2024-09-06
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

It is difficult to effectively remove interference areas in the image that are similar in shape to the target area with existing technology, affecting the accuracy of subsequent calculation results.

Method used

By preprocessing the original image, the pixel coordinate set and local pixel mean value of the connected area are determined, the global pixel mean value is calculated, and the interference area is determined based on the mean value and deviation, and eliminated.

Benefits of technology

Interference areas that are similar in shape to the target area in the image are effectively eliminated, improving the accuracy and efficiency of subsequent calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114841896B
    Figure CN114841896B
Patent Text Reader

Abstract

The present invention relates to the field of digital image processing technology, and in particular to an image processing method, device and computer-readable storage medium, wherein the method comprises: preprocessing an original image to obtain a preprocessed image; determining a pixel coordinate set of each connected area corresponding to the original image based on the preprocessed image; determining the local pixel mean corresponding to each connected area in the original image based on the pixel coordinate set; determining the global pixel mean based on the local pixel mean; determining the interference area in the preprocessed original image based on the global pixel mean and the local pixel mean, and removing the interference area. By removing interference points in the image that are similar in shape to the area to be retained but are actually not required, the problem of how to remove interference areas in the image that are similar in shape to the area to be retained is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Extracting a region of a specific shape from an image is a common method in image processing technology. Usually, the image is binarized, the shape of the target region to be extracted is determined, and the region in the image that is similar in shape to the target region is extracted.

[0003] However, when there are interference areas in the captured image that are similar in shape to the target area but are not actually needed in subsequent image calculations, the interference points cannot be removed after image processing, affecting the accuracy of subsequent calculation results.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present invention is to provide an image processing method, aiming to solve the problem of how to eliminate interference areas in an image that are similar in shape to areas that need to be retained.

[0006] To achieve the above object, the present invention provides an image processing method, which comprises:

[0007] Preprocessing the original image to obtain a preprocessed image;

[0008] Determine, according to the preprocessed image, a pixel coordinate set of each connected area corresponding to the original image;

[0009] Based on the pixel coordinate set, determining the local pixel mean corresponding to each of the connected regions in the original image;

[0010] Determine a global pixel mean according to the local pixel mean;

[0011] An interference area in the preprocessed original image is determined according to the global pixel mean and the local pixel mean, and the interference area is eliminated.

[0012] Optionally, the step of determining the local pixel means corresponding to each of the connected regions in the original image based on the pixel coordinate set includes:

[0013] Obtaining pixel values ​​of pixels corresponding to the pixel coordinate set in the original image;

[0014] Determine the local pixel total value corresponding to each of the connected areas according to the pixel value;

[0015] The local pixel mean is determined according to the local pixel total value and the number of pixels corresponding to the connected area.

[0016] Optionally, the step of determining the global pixel mean according to the local pixel mean comprises:

[0017] Obtaining the local pixel mean of each of the connected regions, and obtaining the number of the connected regions;

[0018] The global pixel mean is determined according to the local pixel mean and the number of each of the connected regions.

[0019] Optionally, the step of determining an interference area in the original image according to the global pixel mean and the local pixel mean, and removing the interference area comprises:

[0020] Determining a retention interval according to the global pixel mean and a deviation associated with the global pixel mean;

[0021] The connected area where the local pixel mean is outside the reserved interval is taken as the interference area, and the interference area is eliminated.

[0022] Optionally, before the step of determining a reserved interval according to the global pixel mean and the deviation associated with the global pixel mean, the step further includes:

[0023] Calculating the standard deviation of the global pixel mean;

[0024] Determine the variance of the global pixel mean according to the standard deviation of the global pixel mean, and use the variance as the deviation;

[0025] The step of determining a reserved interval according to the global pixel mean and the deviation associated with the global pixel mean comprises:

[0026] The sum of the global pixel mean and the deviation is used as the upper boundary of the reserved interval, and the difference between the global pixel mean and the deviation is used as the lower boundary of the reserved interval, so as to determine the reserved interval according to the upper boundary and the lower boundary.

[0027] Optionally, the step of preprocessing the original image includes:

[0028] Binarizing the original image to obtain a binary image corresponding to the original image;

[0029] Extracting coordinates, aspect ratio and / or area of ​​connected regions in the binary image;

[0030] Obtaining reference coordinates, reference aspect ratio and / or reference area;

[0031] The connected regions in the binary image that do not match the reference coordinates, the reference aspect ratio and / or the reference area are regarded as connected regions with irregular shapes;

[0032] Eliminate the connected regions with irregular shapes.

[0033] Optionally, the step of preprocessing the original image includes:

[0034] Binarizing the original image to obtain a binary image corresponding to the original image;

[0035] Extracting coordinates, aspect ratio and / or area of ​​connected regions in the binary image;

[0036] Obtaining reference coordinates, reference aspect ratio and / or reference area;

[0037] The connected regions in the binary image that do not match the reference coordinates, the reference aspect ratio and / or the reference area are regarded as connected regions with irregular shapes;

[0038] Eliminate the connected regions with irregular shapes.

[0039] Optionally, the step of determining the global pixel mean according to the local pixel mean comprises:

[0040] Obtaining the local pixel mean of each of the connected regions, and obtaining the area of ​​the connected regions;

[0041] The global pixel mean is determined according to the local pixel mean and the region area of ​​each of the connected regions.

[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides an image processing device, the image processing device comprising: a memory, a processor, and an image processing program stored in the memory and executable on the processor, wherein the image processing program implements each step of the image processing method described in any one of the above items when executed by the processor.

[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an image processing program, and when the image processing program is executed by a processor, the various steps of the image processing method described in the above embodiment are implemented.

[0044] The embodiment of the present invention provides an image processing method, device and computer-readable storage medium, wherein the method includes: preprocessing the original image; determining the pixel coordinate set of each connected area corresponding to the original image after preprocessing; based on the pixel coordinate set, determining the local pixel mean corresponding to each connected area in the original image; determining the global pixel mean according to the local pixel mean; determining the interference area in the original image after preprocessing according to the global pixel mean and the local pixel mean, and eliminating the interference area. After obtaining the information of the connected area of ​​the image by using the connected area extraction function, the interference areas with similar shapes are eliminated, and only the required card dots are retained to complete the subsequent calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A schematic diagram of the hardware architecture of an image processing device involved in an embodiment of the present invention;

[0046] Figure 2 is a schematic flow chart of a first embodiment of an image processing method of the present invention;

[0047] Figure 3 A schematic diagram of a preprocessed image in a specific implementation of the image processing method of the present invention;

[0048] Figure 4 It is a schematic diagram of a specific implementation of the image processing method of the present invention after removing the interference area;

[0049] Figure 5 FIG. 4 is a flow chart of a second embodiment of an image processing method according to the present invention.

[0050] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] During the camera calibration process, it is necessary to process the captured image, extract the card dots in the image, obtain the center coordinates of the card dots, and then complete the subsequent calculations. However, due to environmental interference, the camera may capture patterns with shapes similar to the card dots, resulting in interference points after image processing, affecting subsequent calculation results.

[0052] The present invention uses a connected region extraction function to obtain the information of the connected regions of the image, removes interference regions with similar shapes, and only retains the required picture card dots to complete subsequent calculations.

[0053] It should be understood that the exemplary embodiments of the present invention are shown in the accompanying drawings of the present invention, and the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0054] As an implementation scheme, the hardware architecture of the image processing device can be as follows Figure 1 shown.

[0055] The embodiment of the present invention relates to an image processing device, which includes: a processor 101, such as a CPU, a memory 102, and a communication bus 103. The communication bus 103 is used to realize connection and communication between these components.

[0056] The memory 102 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Figure 1 As shown, the memory 102 as a computer-readable storage medium may include an image processing program; and the processor 101 may be used to call the image processing method program stored in the memory 102 and perform the following operations:

[0057] Preprocessing the original image to obtain a preprocessed image;

[0058] Determine, according to the preprocessed image, a pixel coordinate set of each connected area corresponding to the original image;

[0059] Based on the pixel coordinate set, determining the local pixel mean corresponding to each of the connected regions in the original image;

[0060] Determine a global pixel mean according to the local pixel mean;

[0061] An interference area in the preprocessed original image is determined according to the global pixel mean and the local pixel mean, and the interference area is eliminated.

[0062] In one embodiment, the processor 101 may be used to call the image processing program stored in the memory 102 and perform the following operations:

[0063] Obtaining pixel values ​​of pixels corresponding to the pixel coordinate set in the original image;

[0064] Determine the local pixel total value corresponding to each of the connected areas according to the pixel value;

[0065] The local pixel mean is determined according to the local pixel total value and the number of pixels corresponding to the connected area.

[0066] In one embodiment, the processor 101 may be used to call the image processing program stored in the memory 102 and perform the following operations:

[0067] Obtaining the local pixel mean of each of the connected regions, and obtaining the number of the connected regions;

[0068] The global pixel mean is determined according to the local pixel mean and the number of each of the connected regions.

[0069] In one embodiment, the processor 101 may be used to call the image processing program stored in the memory 102 and perform the following operations:

[0070] Calculating the standard deviation of the global pixel mean;

[0071] Determine the variance of the global pixel mean according to the standard deviation of the global pixel mean, and use the variance as the deviation;

[0072] The sum of the global pixel mean and the deviation is used as the upper boundary of the reserved interval, and the difference between the global pixel mean and the deviation is used as the lower boundary of the reserved interval, so as to determine the reserved interval according to the upper boundary and the lower boundary.

[0073] Determining a retention interval according to the global pixel mean and a deviation associated with the global pixel mean;

[0074] The connected area where the local pixel mean is outside the reserved interval is taken as the interference area, and the interference area is eliminated.

[0075] In one embodiment, the processor 101 may be used to call the image processing program stored in the memory 102 and perform the following operations:

[0076] Binarizing the original image to obtain a binary image corresponding to the original image;

[0077] Extracting coordinates, aspect ratio and / or area of ​​connected regions in the binary image;

[0078] Obtaining reference coordinates, reference aspect ratio and / or reference area;

[0079] The connected regions in the binary image that do not match the reference coordinates, the reference aspect ratio and / or the reference area are regarded as connected regions with irregular shapes;

[0080] Eliminate the connected regions with irregular shapes.

[0081] In one embodiment, the processor 101 may be used to call the image processing program stored in the memory 102 and perform the following operations:

[0082] Marking each of the connected regions in the preprocessed original image according to a preset image detection order;

[0083] Based on the marks, a pixel coordinate set of the connected area corresponding to each mark is determined.

[0084] In one embodiment, the processor 101 may be used to call the image processing program stored in the memory 102 and perform the following operations:

[0085] Obtaining the local pixel mean of each of the connected regions, and obtaining the area of ​​the connected regions;

[0086] The global pixel mean is determined according to the local pixel mean and the region area of ​​each of the connected regions.

[0087] Based on the hardware architecture of the above-mentioned image processing device based on digital image processing technology, an embodiment of the image processing method of the present invention is proposed.

[0088] Reference Figure 2 In a first embodiment, the image processing method comprises the following steps:

[0089] Step S10, preprocessing the original image to obtain a preprocessed image;

[0090] In this embodiment, the captured original image is first preprocessed to obtain feature information in the original image, which includes but is not limited to connected component information in the original image. A connected component generally refers to an image region composed of foreground pixels with the same pixel value and adjacent positions in the image. The connected component information includes but is not limited to the coordinates, aspect ratio and area of ​​the connected component. Optionally, the original image can be a color image or a grayscale image after grayscale processing.

[0091] Optionally, the preprocessing may be to remove irregular areas in the original image. In some embodiments, the original image is first binarized. For example, the binarization may be performed by using the threshold function in OpenCV (an open source computer vision framework software) to binarize the image and obtain a binarized image corresponding to the original image; then, the connected area of ​​the binary image is extracted. For example, the connected area may be determined by a connected domain analysis algorithm and may be obtained by a common algorithm such as a two-pass method or a seed-filling method; then, the connected area coordinates, aspect ratio and / or area are extracted from the connected area. For example, the connected area is determined by inputting the image into OpenCV and using the API software package provided by OpenCV, and the characteristics of the connected area are obtained. Feature information, including but not limited to coordinates, length, width and area; then, obtain reference feature information such as reference coordinates, reference aspect ratio and / or reference area as feature information of regular areas. It should be noted that the regular area can be an area determined in advance by the developer, or a selection interface of a connected area can be output, and a specific connected area in the original image can be selected as the target connected area through the selection interface; in the next step, the reference coordinates, reference aspect ratio and / or reference area in the binary image are traversed and matched with each connected area, and the connected areas that do not match the aforementioned reference feature information are regarded as connected areas with irregular shapes; finally, the connected areas with irregular shapes are eliminated. For example, the grayscale value of the connected area can be changed to achieve the effect of eliminating the area. The grayscale values ​​of the connected areas that do not match the reference feature information in the binary image are all set to 255 (i.e., they become black areas). In the subsequent calculation process, only the white areas with a grayscale value of 0 are processed, so as to achieve the effect of "elimination" in the original image. For example, the reference Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a preprocessed image after preprocessing in a specific implementation manner. It can be seen that irregularly shaped regions in the original image are eliminated through this preprocessing method.

[0092] Step S20, determining a pixel coordinate set of each connected region corresponding to the original image according to the preprocessed image;

[0093] After preprocessing, the irregular areas in the original image are removed. Figure 3 It is not difficult to see from the preprocessed image shown that in the target area to be extracted (i.e. Figure 3In addition to the 9×12 dot area in the figure, there are some parts that do not actually belong to the target area but are still recognized by the machine as "regular areas" (i.e., areas composed of white pixels outside the dot area). These parts will interfere with the subsequent calculation results and affect the accuracy of the calculation results. Therefore, these regular areas outside the target area are eliminated. In this step, it is necessary to obtain the pixel coordinate sets of each connected area. Each pixel coordinate set is a set of coordinate points of all pixel points in a corresponding connected area. For example, the pixel coordinate set can be expressed as pts[1,2,3,…,n].

[0094] Optionally, the connected areas may be marked first, and the pixel coordinate sets may be extracted according to the connected areas corresponding to the marks. Optionally, the marking method may be to number the connected areas, and when executing the step of obtaining the pixel coordinate sets, the connected areas at various positions in the image are traversed according to the order of the numbers, so as to determine the pixel coordinate sets corresponding to each number. By marking, the pixel coordinate sets of the connected areas are obtained according to the order of the marks during the extraction process, and the unmarked areas are directly not processed, thereby improving the speed of executing the image processing method and improving the image processing efficiency.

[0095] Step S30, determining the local pixel mean corresponding to each of the connected regions in the original image based on the pixel coordinate set;

[0096] After determining the pixel coordinate set, based on the coordinate point set of the connected area corresponding to the pixel coordinate set, determine the pixel mean corresponding to each connected area in the original image, that is, the local pixel mean. It should be noted that the connected area is the area in the binary image, the pixel coordinate set is also the coordinate point set of the connected area obtained in the binary image, and the local pixel mean is the feature information in the original image. Therefore, the technical principle in this step is: determine the pixel coordinate set of the connected area in the binary image of the original image, and then put the coordinate parameters in each pixel coordinate set into the original image, so as to indirectly determine the corresponding position of the connected area in the original image (the coordinate system in the binary image and the coordinate system in the original image are the same coordinate system). Exemplarily, the local pixel mean can be expressed as mean[1,2,3,…,n].

[0097] Optionally, the local pixel mean may be determined by dividing the local pixel total value in the connected area by the local pixel total value. First, the pixel values ​​of the pixels corresponding to the pixel coordinate set in the original image are obtained, and then the local pixel total value corresponding to each connected area is determined according to the pixel value of each pixel, and the local pixel total value is divided by the pixel quantity to obtain the local pixel mean.

[0098] Step S40, determining a global pixel mean according to the local pixel mean;

[0099] After determining the local pixel mean corresponding to each connected region, the global pixel mean is determined based on the local pixel mean. It should be noted that the global pixel mean is not the pixel mean obtained by adding up the pixel values ​​of each position in the original image, but the pixel mean obtained by adding up the local pixel means of all connected regions and averaging them. The resulting representation is the pixel mean of the connected region in the original image. For example, the global pixel mean can be represented as mean_all.

[0100] Alternatively, the global pixel mean may be determined by adding the local pixel means corresponding to each connected region and dividing the sum by the total number of connected regions. Exemplarily, the global pixel mean may be expressed as:

[0101]

[0102] Optionally, the global pixel mean can be determined by adding the local pixel means of each connected region and dividing the sum by the area of ​​the total connected region. For example, the area can be determined by counting the number of pixels in the connected region, for example, the area corresponding to the connected region numbered 1 is sum[1]. The global pixel mean can be expressed as:

[0103]

[0104] Step S50, determining the interference area in the preprocessed original image according to the global pixel mean and the local pixel mean, and removing the interference area.

[0105] After determining the global pixel mean, the local pixel mean is compared with the global pixel mean, and the area that meets the preset conditions in the obtained comparison result is used as the interference area, so as to eliminate the interference area in the preprocessed original image. Figure 4 , Figure 4 In a specific implementation, based on Figure 3 Schematic diagram after removing the interference areas with regular shapes.

[0106] In the technical solution provided in this embodiment, by determining the pixel coordinate sets of each connected area corresponding to the original image after preprocessing, and then determining the local pixel means of the corresponding positions of each connected area in the original image according to the pixel coordinate sets, the global pixel mean corresponding to the local pixel mean is calculated, and finally the interference area in the original image after preprocessing is determined according to the global pixel mean and the local pixel mean, and the interference area is eliminated, interference points that are similar in shape to the area to be retained but are not actually needed are eliminated, thereby solving the problem that the machine cannot recognize these areas when there are areas in the captured image that are similar in shape to the regular area to be extracted but are not actually needed.

[0107] Reference Figure 5 In the second embodiment, based on the first embodiment, the steps of step S50 include:

[0108] Step S51, determining a reserved interval according to the global pixel mean and the deviation associated with the global pixel mean;

[0109] Step S52, taking the connected area where the local pixel mean is outside the reserved interval as the interference area, and removing the interference area;

[0110] Optionally, this embodiment provides a method for determining an interference area, and a reserved interval can be set according to the global pixel mean, and it is determined whether the local pixel mean is within the reserved interval. If not, the connected area corresponding to the local pixel mean is determined to be an interference area, and the interference area is removed. It should be noted that the reserved interval is an interval with the global pixel mean as the midpoint of the interval, and the deviation associated with the global pixel mean is a representation of the upper and lower limits of the interval, which is an interval floating around the global pixel mean as the center. Within this reserved interval, it means that the deviation of the local pixel mean relative to the global pixel mean is small, and the connected area corresponding to the local pixel mean is the area that should be retained (i.e., the valid area in the subsequent calculation). If it is outside the reserved interval, the connected area is an interference area that should not be retained, and the interference area is removed.

[0111] Before step S51, the method further includes:

[0112] Step S60, calculating the standard deviation of the global pixel mean;

[0113] Step S70, determining the variance of the global pixel mean according to the standard deviation of the global pixel mean, and using the variance as the deviation;

[0114] The step S51 comprises:

[0115] Step S511: Use the sum of the global pixel mean and the deviation as the upper boundary of the retention interval, and use the difference between the global pixel mean and the deviation as the lower boundary of the retention interval, so as to determine the retention interval according to the upper boundary and the lower boundary.

[0116] Optionally, this embodiment provides a method for determining the deviation and the retention interval. In this embodiment, calculate the standard deviation of the global pixel mean, and then determine the variance of the global pixel mean. The variance can be used to measure the deviation degree between a random variable (i.e., the local pixel mean) and the mathematical expectation (i.e., the global pixel mean), and reflect the average of the squared differences between the sample values (i.e., the local pixel mean) and the average of all sample values (i.e., the global pixel mean). Therefore, in this embodiment, the variance of the global pixel mean is used as the mathematical quantization value representing the deviation degree. Exemplarily, the variance of the global pixel mean is denoted as std_all.

[0117] Furthermore, after using the variance of the global pixel mean as the deviation, use the sum of the global pixel mean and the variance as the upper boundary of the retention interval, and use the difference between the global pixel mean and the variance as the lower boundary of the retention interval. It should be noted that since the variance is non - negative, the sum of the global pixel mean and the variance must be greater than the difference between the global pixel mean and the variance, and there will be no situation where the value of the upper boundary of the retention interval is less than the value of the lower boundary. Exemplarily, the upper boundary of the retention area is mean_all + std_all, and the lower boundary is mean_all - std_all. Substitute the local pixel mean mean[1, 2, 3, …, n] of each connected region into the retention area for comparison. When mean[1, 2, 3, …, n]>mean_all + std_all, or mean[1, 2, 3, …, n]<mean_all - std_all, it is determined that the deviation degree of the local pixel mean relative to the expected value (i.e., the global pixel mean) is large, and then it is determined that the region corresponding to the local pixel mean is an interference region.

[0118] In the technical solution provided in this embodiment, the reserved interval is determined by the global pixel mean and the deviation associated with the global pixel mean, and the area outside the reserved interval is used as the interference area, and the variance of the global pixel mean is used as the deviation, the sum of the global pixel mean and the deviation is used as the upper boundary of the reserved interval, and the difference between the global pixel mean and the deviation is used as the lower boundary of the reserved interval. When the local pixel mean is above the upper boundary or below the lower boundary of the reserved interval, the connected area corresponding to the local pixel mean is judged as the interference area, and the interference area is eliminated. In this way, the interference points in the image that are similar in shape to the area to be retained but are actually not needed are eliminated, thereby solving the problem that the machine cannot recognize these areas when there are areas in the captured image that are similar in shape to the regular area to be extracted but are actually not needed.

[0119] In addition, the present invention also provides an image processing device, the image processing device comprising: a memory, a processor, and an image processing program stored in the memory and executable on the processor, wherein the image processing program implements each step of the image processing method described in any one of the above when executed by the processor.

[0120] In addition, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores an image processing program, and when the image processing program is executed by a processor, the steps of the image processing method described in the above embodiment are implemented.

[0121] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0123] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An image processing method, characterized in that: The method comprises: Preprocessing the original image to obtain a preprocessed image; Determine, according to the preprocessed image, a pixel coordinate set of each connected area corresponding to the original image; Based on the pixel coordinate set, determining the local pixel mean corresponding to each of the connected regions in the original image; Determine a global pixel mean according to the local pixel mean; Calculating the standard deviation of the global pixel mean; Determine the variance of the global pixel mean according to the standard deviation of the global pixel mean, and use the variance as the deviation associated with the global pixel mean; The sum of the global pixel mean and the deviation is used as the upper boundary of the reserved interval, and the difference between the global pixel mean and the deviation is used as the lower boundary of the reserved interval, so as to determine the reserved interval according to the upper boundary and the lower boundary; The connected area whose local pixel mean is outside the reserved interval is used as the interference area in the preprocessed original image, and the interference area is eliminated.

2. The image processing method according to claim 1, characterized in that: The step of determining the local pixel means corresponding to each of the connected regions in the original image based on the pixel coordinate set comprises: Obtaining pixel values ​​of pixels corresponding to the pixel coordinate set in the original image; Determine the local pixel total value corresponding to each of the connected areas according to the pixel value; The local pixel mean is determined according to the local pixel total value and the number of pixels corresponding to the connected area.

3. The image processing method according to claim 1, characterized in that: The step of determining the global pixel mean according to the local pixel mean comprises: Obtaining the local pixel mean of each of the connected regions, and obtaining the number of the connected regions; The global pixel mean is determined according to the local pixel mean and the number of each of the connected regions.

4. The image processing method according to claim 1, wherein: The step of preprocessing the original image comprises: Binarizing the original image to obtain a binary image corresponding to the original image; Extracting coordinates, aspect ratio and / or area of ​​connected regions in the binary image; Obtaining reference coordinates, reference aspect ratio and / or reference area; The connected regions in the binary image that do not match the reference coordinates, the reference aspect ratio and / or the reference area are regarded as connected regions with irregular shapes; Eliminate the connected regions with irregular shapes.

5. The image processing method according to claim 1, wherein: Before the step of determining the pixel coordinate sets of each connected area corresponding to the preprocessed original image, the method further includes: Marking each of the connected regions in the preprocessed original image according to a preset image detection order; The step of determining the pixel coordinate sets of each connected area corresponding to the preprocessed original image comprises: Based on the marks, a pixel coordinate set of the connected area corresponding to each mark is determined.

6. The image processing method according to claim 1, characterized in that: The step of determining the global pixel mean according to the local pixel mean comprises: Obtaining the local pixel mean of each of the connected regions, and obtaining the area of ​​the connected regions; The global pixel mean is determined according to the local pixel mean and the region area of ​​each of the connected regions.

7. An image processing device, characterized in that: The image processing device comprises: a memory, a processor, and an image processing program stored in the memory and executable on the processor, wherein the image processing program implements the steps of the image processing method according to any one of claims 1 to 6 when executed by the processor.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an image processing program, and when the image processing program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 6 are implemented.