Neighborhood determination method, image filtering method and apparatus

By selecting the target neighborhood for image filtering in a high-dimensional space, the problem of excessive computation in existing technologies is solved, achieving efficient and accurate image filtering results.

CN115731128BActive Publication Date: 2026-07-24WUHAN ZHONGKE IND RES INST OF MEDICAL SCI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN ZHONGKE IND RES INST OF MEDICAL SCI CO LTD
Filing Date
2022-11-22
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing image filtering methods require filtering based on all neighboring pixels, resulting in excessive computation and hindering practical applications.

Method used

By determining the target domain and multiple candidate neighborhoods in the image to be filtered, a target domain vector and a neighborhood vector are constructed in a high-dimensional space. At least one target neighborhood is selected for filtering based on the spatial angle, thereby reducing the computational load.

Benefits of technology

This method enables filtering of images using only at least one target neighborhood, reducing computational load, improving filtering efficiency and hardware requirements, and enhancing the rationality and accuracy of filtering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115731128B_ABST
    Figure CN115731128B_ABST
Patent Text Reader

Abstract

The application provides a neighborhood determination method, an image filtering method and device, and the neighborhood determination method comprises the following steps: determining a target domain and a plurality of candidate neighborhoods in a to-be-filtered image; the target domain comprises a plurality of first pixel points, the candidate neighborhoods comprise a plurality of second pixel points, and the number of the first pixel points is the same as the number of the second pixel points; a high-dimensional space is constructed, and a target domain vector of the target domain in the high-dimensional space and a neighborhood vector of each candidate neighborhood in the high-dimensional space are determined; the dimension of the high-dimensional space is the same as the number of the first pixel points; the spatial included angle between each neighborhood vector and the target domain vector is determined, and at least one target neighborhood in the plurality of candidate neighborhoods is determined according to the spatial included angle. The application only needs to filter the to-be-filtered image through the at least one target neighborhood, does not need to filter the to-be-filtered image by using all the candidate neighborhoods, reduces the calculation amount, and improves the filtering efficiency of the to-be-filtered image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image denoising technology, specifically to a neighborhood determination method, an image filtering method, and an apparatus. Background Technology

[0002] With the continuous advancement of technology, people's demand for image information is increasing, and a large amount of information is captured, sampled, transmitted, and stored every day. For example, in the medical field, medical imaging equipment acquires patient images to help doctors diagnose the location of lesions. The quality of the patient image has a significant impact on the accuracy of diagnosis. However, due to the influence of equipment precision, lighting, and other environmental factors, the acquired images may contain a certain amount of noise. To improve diagnostic accuracy, the acquired images need to be filtered to improve image quality.

[0003] The existing method for filtering images is to use the traditional non-local mean (NLM) filtering method. However, the traditional NLM filtering method determines all the neighborhoods of the pixel to be filtered in the image and filters the pixel based on all the neighborhoods. The computational load is too large, which affects the practical application of the NLM filtering method. Summary of the Invention

[0004] In view of this, it is necessary to provide a neighborhood determination method, an image filtering method and apparatus to solve the technical problem in the prior art that the calculation is too large because it is necessary to filter all the pixels to be filtered based on the neighborhood.

[0005] On one hand, the present invention provides a neighborhood determination method, comprising:

[0006] A target domain and multiple candidate neighborhoods are determined in the image to be filtered; the target domain includes multiple first pixels, and the candidate neighborhoods include multiple second pixels, wherein the number of first pixels and the number of second pixels are the same;

[0007] A high-dimensional space is constructed, and the target domain vector and the neighborhood vector of each candidate neighborhood are determined in the high-dimensional space; the dimension of the high-dimensional space is the same as the number of the first pixel points.

[0008] Determine the spatial angle between each of the neighborhood vectors and the target domain vector, and determine at least one target neighborhood among the plurality of candidate neighborhoods based on the spatial angle.

[0009] In some possible implementations, determining the target domain and multiple candidate neighborhoods in the image to be filtered includes:

[0010] Determine the pixels to be filtered and the radius of the domain in the image to be filtered;

[0011] The target domain is determined based on the pixel to be filtered and the domain radius;

[0012] Based on the domain radius, the image to be filtered is traversed to determine the plurality of candidate neighborhoods.

[0013] In some possible implementations, determining multiple candidate neighborhoods in the image to be filtered further includes:

[0014] Determine the search radius, which is greater than the domain radius;

[0015] The search area is determined based on the pixels to be filtered and the search radius;

[0016] Based on the domain radius, the search area is traversed to determine the plurality of candidate neighborhoods.

[0017] In some possible implementations, determining the target domain vector in the high-dimensional space and the neighborhood vectors of each of the candidate neighborhoods in the high-dimensional space includes:

[0018] Obtain the spatial coordinate system of the high-dimensional space, wherein the spatial coordinate system includes the spatial coordinate origin;

[0019] Determine the target domain spatial coordinates in the spatial coordinate system and the neighborhood spatial coordinates of each of the candidate neighborhoods in the spatial coordinate system;

[0020] The target domain vector is determined based on the origin of the spatial coordinates and the target domain spatial coordinates, and the neighborhood vector is determined based on the origin of the spatial coordinates and the neighborhood spatial coordinates.

[0021] In some possible implementations, determining at least one target neighborhood from the plurality of candidate neighborhoods based on the spatial angle includes:

[0022] Determine whether the spatial angle is greater than the angle threshold;

[0023] When the spatial angle is greater than the angle threshold, the candidate neighborhood is the target neighborhood.

[0024] On the other hand, the present invention also provides an image filtering method, comprising:

[0025] Acquire an image to be filtered and determine a target domain in the image to be filtered, wherein the target domain includes the pixels to be filtered;

[0026] At least one target neighborhood of the pixel to be filtered is determined based on the neighborhood determination method;

[0027] Determine at least one matching pixel in the at least one target neighborhood that corresponds to the pixel to be filtered;

[0028] A weight determination model is constructed, and the weight of the target neighborhood is determined based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood.

[0029] The target image is obtained by filtering the pixels to be filtered based on the weights and the matching pixels.

[0030] The neighborhood determination method is any of the neighborhood determination methods described in the above possible implementations.

[0031] In some possible implementations, determining the weights of the target neighborhood based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood includes:

[0032] Determine a first ratio between the first pixel value and the second pixel value;

[0033] Determine a second ratio between the second pixel value and the first pixel value;

[0034] The weight of the target neighborhood is determined based on the size of the pixel to be filtered, the first ratio, the second ratio, and the spatial angle between the target domain and the target neighborhood.

[0035] In some possible implementations, the at least one target neighborhood includes a first target neighborhood and a second target neighborhood, the at least one matching pixel includes a first matching pixel in the first target neighborhood and a second matching pixel in the second target neighborhood, and the weight includes a first weight of the first target neighborhood and a second weight of the second target neighborhood; the filtering of the pixel to be filtered based on the weight and the matching pixel includes:

[0036] The first weighted pixel value is determined based on the first weight and the pixel value of the first matched pixel.

[0037] The second weighted pixel value is determined based on the second weight and the pixel value of the second matched pixel.

[0038] The sum of the first weighted pixel value and the second weighted pixel value is used as the pixel value of the pixel to be filtered.

[0039] On the other hand, the present invention also provides a neighborhood determination device, comprising:

[0040] The target domain and neighborhood determination unit is used to determine the target domain and multiple candidate neighborhoods in the image to be filtered; the target domain includes multiple first pixels, and the candidate neighborhoods include multiple second pixels, wherein the number of first pixels and the number of second pixels are the same;

[0041] A high-dimensional space construction unit is used to construct a high-dimensional space and determine the target domain vector of the target domain in the high-dimensional space and the neighborhood vector of each of the candidate neighborhoods in the high-dimensional space; the dimension of the high-dimensional space is the same as the number of the first pixel points;

[0042] The target neighborhood determination unit is used to determine the spatial angle between each of the neighborhood vectors and the target domain vector, and to determine at least one target neighborhood among the plurality of candidate neighborhoods based on the spatial angle.

[0043] On the other hand, the present invention also provides an image filtering device, comprising:

[0044] The image to be filtered acquisition unit is used to acquire the image to be filtered and determine the target domain in the image to be filtered, wherein the target domain includes the pixels to be filtered.

[0045] The target neighborhood acquisition unit is used to determine at least one target neighborhood of the pixel to be filtered based on a neighborhood determination method.

[0046] A matching pixel point determination unit is used to determine at least one matching pixel point in the at least one target neighborhood that corresponds to the pixel point to be filtered;

[0047] The weight determination unit is used to construct a weight determination model and determine the weight of the target neighborhood based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood.

[0048] An image filtering unit is used to filter the pixels to be filtered based on the weights and the matching pixels to obtain a target image;

[0049] The neighborhood determination method is any of the neighborhood determination methods described in the above possible implementations.

[0050] The beneficial effects of the above embodiments are as follows: The neighborhood determination method provided by the present invention first determines the target domain and multiple candidate neighborhoods in the image to be filtered, then constructs a high-dimensional space, and determines the target domain vector in the high-dimensional space and the neighborhood vectors of each candidate neighborhood in the high-dimensional space. Finally, it determines at least one target neighborhood among the multiple candidate neighborhoods based on the spatial angle between the neighborhood vectors and the target domain vector. This enables filtering of the image to be filtered by using only at least one target neighborhood, without needing to use all candidate neighborhoods, greatly reducing the computational load and thus improving the filtering efficiency of the image to be filtered. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 A schematic flowchart of an embodiment of the neighborhood determination method provided by the present invention;

[0053] Figure 2 For the present invention Figure 1 A schematic diagram of an embodiment of S101;

[0054] Figure 3 For the present invention Figure 1 Another embodiment of the process diagram of S101;

[0055] Figure 4 A schematic diagram of an embodiment of the search region, target domain, and candidate neighborhood provided by the present invention;

[0056] Figure 5 For the present invention Figure 1 A schematic diagram of an embodiment of S102;

[0057] Figure 6 A schematic diagram of an embodiment of the spatial coordinate system in high-dimensional space provided by the present invention;

[0058] Figure 7 For the present invention Figure 1 A schematic diagram of an embodiment of S103;

[0059] Figure 8 This is a schematic flowchart of an embodiment of the image filtering method provided by the present invention;

[0060] Figure 9 For the present invention Figure 8A schematic diagram of an embodiment of S804;

[0061] Figure 10 For the present invention Figure 8 A schematic diagram of an embodiment of S805;

[0062] Figure 11 A comparison diagram of the image filtering results provided by the present invention and those of the prior art;

[0063] Figure 12 A schematic diagram of an embodiment of the neighborhood determination device provided by the present invention;

[0064] Figure 13 A schematic diagram of an embodiment of the image filtering device provided by the present invention;

[0065] Figure 14 This is a schematic diagram of an embodiment of the image processing device provided by the present invention. Detailed Implementation

[0066] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0067] It should be understood that the illustrative drawings are not drawn to scale. The flowcharts used in this invention illustrate operations implemented according to some embodiments of the invention. It should be understood that the operations in the flowcharts may be implemented out of order, and steps without logical contextual relationships may be reversed or performed simultaneously. Furthermore, those skilled in the art, guided by the content of this invention, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor systems and / or microcontroller systems.

[0068] The terms "first," "second," etc., used in the embodiments of this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.

[0069] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0070] This invention provides a neighborhood determination method, an image filtering method, and an apparatus, which are described below.

[0071] Figure 1 This is a schematic flowchart of an embodiment of the neighborhood determination method provided by the present invention, as shown below. Figure 1 As shown, the neighborhood determination method includes:

[0072] S101. Determine the target domain and multiple candidate neighborhoods in the image to be filtered; the target domain includes multiple first pixels, and the candidate neighborhoods include multiple second pixels, with the number of first pixels and the number of second pixels being the same;

[0073] S102. Construct a high-dimensional space and determine the target domain vector in the high-dimensional space and the neighborhood vectors of each candidate neighborhood in the high-dimensional space; the dimension of the high-dimensional space is the same as the number of the first pixel.

[0074] S103. Determine the spatial angle between each neighborhood vector and the target domain vector, and determine at least one target neighborhood from multiple candidate neighborhoods based on the spatial angle.

[0075] Compared with existing technologies, the neighborhood determination method provided in this invention first determines the target domain and multiple candidate neighborhoods in the image to be filtered. Then, a high-dimensional space is constructed, and the target domain vector and the neighborhood vectors of each candidate neighborhood in the high-dimensional space are determined. Finally, at least one target neighborhood is determined from the multiple candidate neighborhoods based on the spatial angle between the neighborhood vectors and the target domain vector. This allows filtering of the image to be filtered only through at least one target neighborhood, without using all candidate neighborhoods, significantly reducing computational load and improving filtering efficiency. Furthermore, the reduced computational load also lowers the hardware requirements for filtering the image.

[0076] It should be understood that the image to be filtered can be a medical image, which can be any of the following: positron emission tomography (PET) images, computed tomography (CT) images, magnetic resonance imaging (MRI) images, etc.

[0077] In one specific embodiment, when PET images assist doctors in diagnosis, the imaging process involves detecting two 511 keV gamma rays with an angular diameter of 180 degrees, generated by the positron annihilation of a radiopharmaceutical in the human body. Since the two 511 keV gamma rays deposit all or part of their energy in the detector, during data processing, two signals within a certain energy and time range are selected to form a coincidence event. The location of radiopharmaceutical absorption within the body is determined by connecting these coincidence events, thus aiding doctors in diagnosing lesions. However, due to factors such as detector noise, accidental coincidences, and mechanical inaccuracies, the image reconstructed from the detected signals will contain noise. The neighborhood determination method proposed in this embodiment determines the target neighborhood, requiring only at least one target neighborhood for filtering the PET image, significantly reducing computational load and improving filtering efficiency, thereby enhancing diagnostic efficiency for doctors.

[0078] In this embodiment of the invention, by setting the dimension of the high-dimensional space to be the same as the number of the first pixel points, and setting the number of the first pixel points to be the same as the number of the second pixel points, the target domain and multiple candidate neighborhoods can be regarded as a spatial point in the high-dimensional space, thereby determining the spatial angle between the neighborhood vector and the target domain vector in the high-dimensional space.

[0079] It should be noted that the image to be filtered in the embodiments of the present invention can be a two-dimensional image or a three-dimensional image. When the image to be filtered is a two-dimensional image, the shape of the target domain and the candidate neighborhood can be any one of rectangles, circles, triangles, or irregular shapes. When the image to be filtered is a three-dimensional image, the shape of the target domain and the candidate neighborhood can be any one of cubes, cuboids, spheres, triangular pyramids, etc. In a specific embodiment of the present invention, the shape of the target domain and the candidate neighborhood is a cube.

[0080] It should also be noted that the number of the first pixel and the number of the second pixel can be set or adjusted according to the actual application scenario, and no specific limit is made here.

[0081] In some embodiments of the present invention, such as Figure 2 As shown, step S101 includes:

[0082] S201. Determine the pixels to be filtered and the radius of the domain in the image to be filtered;

[0083] S202. Determine the target domain based on the pixels to be filtered and the domain radius;

[0084] S203. Traverse the image to be filtered based on the domain radius to determine multiple candidate neighborhoods.

[0085] When the target domain is a cube, the target domain is the area obtained with the pixel to be filtered as the center and the domain radius as the side length. In a specific embodiment of the present invention, the domain radius is 3 pixels, so the target domain is a 3×3×3 cube region.

[0086] In step S203, the method of traversing the image to be filtered can be from left to right and from top to bottom, or from right to left and from bottom to top, or traversing in a clockwise or counterclockwise direction with the target domain as the center, etc. These methods will not be elaborated here.

[0087] In a specific embodiment of the present invention, step S203 specifically involves: determining a traversal window based on the domain radius, traversing the image to be filtered based on the traversal window, and determining multiple candidate neighborhoods. The size of the traversal window is the same as the size of the target domain.

[0088] It should be understood that the domain radius can be set or adjusted based on empirical values ​​or the size of the image to be filtered and the size of the pixels to be filtered, and no specific limitation is made here.

[0089] In some application scenarios, the size of the image to be filtered is large, which makes traversing the image based on the domain radius time-consuming. To further improve the efficiency of determining the target neighborhood, in some embodiments of the present invention, such as... Figure 3 As shown, determining multiple candidate neighborhoods in step S101 further includes:

[0090] S301. Determine the search radius; the search radius must be greater than the domain radius.

[0091] S302. Determine the search area based on the pixels to be filtered and the search radius;

[0092] S303. Traverse the search area based on the domain radius to determine multiple candidate neighborhoods.

[0093] This invention reduces the traversal range by determining multiple candidate neighborhoods in the search area, rather than in the entire image to be filtered, thereby reducing the computational load and further improving the efficiency of target neighborhood determination.

[0094] It should be understood that the search radius can also be set or adjusted based on empirical values, the size of the image to be filtered, and the size of the pixels to be filtered, and no specific limitations are made here.

[0095] In specific embodiments of the present invention, such as Figure 4 As shown, the image to be filtered consists of 100×100 pixels. The pixel to be filtered is the pixel located at the center of the image. The search radius is 10, so the size of the search area is 10×10. The domain radius is 3, so the size of the target domain and the candidate neighborhood is 3×3.

[0096] In some embodiments of the present invention, such as Figure 5 As shown, step S102 includes:

[0097] S501. Obtain the spatial coordinate system of the high-dimensional space, including the origin of the spatial coordinate system;

[0098] S502. Determine the target domain's spatial coordinates in the spatial coordinate system and the spatial coordinates of each candidate neighborhood in the spatial coordinate system.

[0099] S503. Determine the target domain vector based on the origin of the spatial coordinate system and the target domain spatial coordinate system, and determine the neighborhood vector based on the origin of the spatial coordinate system and the neighborhood spatial coordinate system.

[0100] In a specific embodiment of the present invention, the spatial coordinate system of the high-dimensional space is as follows: Figure 6 As shown, where O is the origin of the spatial coordinate system, p is the spatial coordinate of the target domain in the spatial coordinate system, and q(n) is the spatial coordinate of the nth candidate neighbor in the spatial coordinate system, then the target domain vector is... Neighborhood vector is The spatial angle is θ.

[0101] In some embodiments of the present invention, such as Figure 7 As shown, step S103 includes:

[0102] S701. Determine whether the included angle is greater than the included angle threshold.

[0103] S702. When the spatial angle is greater than the angle threshold, the candidate neighborhood is the target neighborhood.

[0104] It should be understood that when the spatial angle is less than or equal to the angle threshold, the candidate neighborhood is a non-target neighborhood.

[0105] The present invention can determine at least one target neighborhood from multiple candidate neighborhoods by judging whether the spatial angle is greater than the angle threshold. The determination method is simple, thereby further improving the determination efficiency of the target neighborhood.

[0106] It should be noted that the included angle threshold can be set or adjusted based on experience or actual application scenarios, which will not be elaborated here.

[0107] Since the purpose of determining at least one target neighborhood in practical applications is to filter the image to be filtered based on the target neighborhood, this invention also provides an image filtering method, such as... Figure 8 As shown, image filtering methods include:

[0108] S801. Obtain the image to be filtered and determine the target domain in the image to be filtered, wherein the target domain includes the pixels to be filtered.

[0109] S802. Determine at least one target neighborhood of the pixel to be filtered based on the neighborhood determination method;

[0110] S803. Determine at least one matching pixel in at least one target neighborhood that corresponds to the pixel to be filtered;

[0111] S804. Construct a weight determination model, and determine the weight of the target neighborhood based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood.

[0112] S805. Filter the pixels to be filtered based on weights and matching pixels to obtain the target image;

[0113] The neighborhood determination method is any of the neighborhood determination methods described in the above embodiments.

[0114] In this embodiment of the invention, after determining at least one target neighborhood of the pixel to be filtered based on the neighborhood determination method, a weight determination model is constructed. The weight of the target neighborhood is determined based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood. Then, the pixel to be filtered is filtered based on the weight and the matching pixel to obtain the target image. This can achieve the filtering of the image to be filtered. Since the neighborhood determination method has a small computational load, the filtering efficiency of the image to be filtered can be improved.

[0115] The formula for calculating the weight of the target neighborhood in the existing technology is as follows:

[0116]

[0117] In the formula, w(p,q(n)) is the weight of the nth target neighborhood; h is the filter coefficient; and |||| is the Euclidean distance.

[0118] As can be seen from the above formula, traditional weight calculation formulas require determining the filter coefficients before determining the weights of the target neighborhood. However, the filter coefficients are selected and set based on empirical values. When the filter coefficients are set improperly, it can lead to unreasonable filtering of the image. In contrast, in this embodiment of the invention, determining the weights of the target neighborhood does not require obtaining the filter coefficients. It only requires the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood. This eliminates the problem of unreasonable filtering caused by improper filter coefficient settings, improving the rationality and accuracy of filtering the image.

[0119] In a specific embodiment of the present invention, the weight determination model is as follows:

[0120]

[0121] In the formula, f is the size of the pixel to be filtered; p x q is the value of the first pixel; x θ is the second pixel value; θ is the spatial angle between the target domain and the target neighborhood; a is a constant.

[0122] As can be seen from the above formula, the parameters in the weight determination model proposed in this embodiment of the invention do not need to be set according to empirical values, thus eliminating the technical problem of unreasonable filtering caused by unreasonable empirical value settings, and improving the rationality and accuracy of filtering the image to be filtered.

[0123] It should be noted that 'a' can be set according to the actual application scenario. In the specific embodiment of the present invention, 'a' is 2.

[0124] Based on the above weight determination model, in some embodiments of the present invention, such as Figure 9 As shown, step S804 includes:

[0125] S901. Determine the first ratio between the first pixel value and the second pixel value;

[0126] S902, Determine a second ratio between the second pixel value and the first pixel value;

[0127] S903. Determine the weight of the target neighborhood based on the size of the pixel to be filtered, the first ratio, the second ratio, and the spatial angle between the target domain and the target neighborhood.

[0128] The first ratio is The second ratio is

[0129] In some embodiments of the present invention, at least one target neighborhood includes a first target neighborhood and a second target neighborhood, at least one matching pixel includes a first matching pixel in the first target neighborhood and a second matching pixel in the second target neighborhood, and the weight includes a first weight of the first target neighborhood and a second weight of the second target neighborhood; then as follows Figure 10 As shown, step S805 includes:

[0130] S1001. Determine the first weighted pixel value based on the first weight and the pixel value of the first matching pixel;

[0131] S1002. Determine the second weighted pixel value based on the second weight and the pixel value of the second matching pixel.

[0132] S1003. The sum of the first weighted pixel value and the second weighted pixel value is taken as the pixel value of the pixel to be filtered.

[0133] It should be noted that at least one target neighborhood is not limited to including the first target neighborhood and the second target neighborhood. It may also include a third target neighborhood, a fourth target neighborhood, etc., in addition to the first target neighborhood and the second target neighborhood. Steps S1001-S1003 are only described using the example of at least one target neighborhood including the first target neighborhood and the second target neighborhood.

[0134] In a specific embodiment of the present invention, the pixel value of the pixel to be filtered is:

[0135]

[0136] In the formula, M(p) x ) represents the pixel p to be filtered. x The pixel value; N is the total number of the target neighborhood; M(q i (x) represents the matching pixel q in the i-th target neighborhood. i (x) pixel value; w i Let be the weight of the i-th target neighborhood.

[0137] To verify the feasibility of the image filtering method proposed in this embodiment of the invention for filtering the image to be filtered, a comparison is made between the traditional nonlocal mean filtering method and the image filtering method proposed in this embodiment of the invention. Figure 11 As shown, the left figure is the result of filtering the image to be filtered based on the image filtering method proposed in the embodiment of the present invention, and the right figure is the result of filtering the image to be filtered based on the traditional non-local mean filtering method after determining reasonable filtering coefficients. It can be seen that the filtering effects of the two methods are similar, which illustrates the feasibility of the image filtering method proposed in the embodiment of the present invention. That is, the embodiment of the present invention can achieve effective filtering of the image to be filtered without selecting reasonable filtering coefficients based on empirical values.

[0138] To better implement the neighborhood determination method in the embodiments of the present invention, based on the neighborhood determination method, the embodiments of the present invention also provide a neighborhood determination device, such as... Figure 12 As shown, the neighborhood determination device 1200 includes:

[0139] The target domain and neighborhood determination unit 1201 is used to determine the target domain and multiple candidate neighborhoods in the image to be filtered; the target domain includes multiple first pixels, and the candidate neighborhoods include multiple second pixels, the number of first pixels and the number of second pixels are the same;

[0140] The high-dimensional space construction unit 1202 is used to construct a high-dimensional space and determine the target domain vector in the high-dimensional space and the neighborhood vectors of each candidate neighborhood in the high-dimensional space; the dimension of the high-dimensional space is the same as the number of the first pixel points;

[0141] The target neighborhood determination unit 1203 is used to determine the spatial angle between each neighborhood vector and the target domain vector, and to determine at least one target neighborhood among multiple candidate neighborhoods based on the spatial angle.

[0142] The neighborhood determination device 1200 provided in the above embodiments can implement the technical solutions described in the above neighborhood determination method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above neighborhood determination method embodiments, and will not be repeated here.

[0143] To better implement the image filtering method in the embodiments of the present invention, based on the image filtering method, the embodiments of the present invention also provide an image filtering device, such as... Figure 13 As shown, the image filtering device 1300 includes:

[0144] The image acquisition unit 1301 is used to acquire the image to be filtered and determine the target domain in the image to be filtered, wherein the target domain includes the pixels to be filtered.

[0145] The target neighborhood acquisition unit 1302 is used to determine at least one target neighborhood of the pixel to be filtered based on the neighborhood determination method.

[0146] The matching pixel point determination unit 1303 is used to determine at least one matching pixel point in at least one target neighborhood that corresponds to the pixel point to be filtered.

[0147] The weight determination unit 1304 is used to construct a weight determination model and determine the weight of the target neighborhood based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood.

[0148] The image filtering unit 1305 is used to filter the pixels to be filtered based on weights and matching pixels to obtain the target image.

[0149] The neighborhood determination method is any of the neighborhood determination methods described in the above embodiments.

[0150] The image filtering device 1300 provided in the above embodiments can implement the technical solutions described in the above image filtering method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above image filtering method embodiments, and will not be repeated here.

[0151] like Figure 14 As shown, the present invention also provides an image processing device 1400. The image processing device 1400 includes a processor 1401, a memory 1402, and a display 1403. Figure 14 Only some components of the image processing device 1400 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.

[0152] In some embodiments, processor 1401 may be a central processing unit (CPU), microprocessor or other data processing chip, used to run program code stored in memory 1402 or process data, such as the neighborhood determination method and / or image filtering method in this invention.

[0153] In some embodiments, processor 1401 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 1401 may be local or remote. In some embodiments, processor 1401 may be implemented on a cloud platform. In some embodiments of the present invention, the cloud platform may include private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, intranet, multi-cloud, etc., or any combination thereof.

[0154] In some embodiments, memory 1402 may be an internal storage unit of the image processing device 1400, such as a hard disk or memory of the image processing device 1400. In other embodiments, memory 1402 may also be an external storage device of the image processing device 1400, such as a pluggable hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the image processing device 1400.

[0155] Furthermore, the memory 1402 may include both internal storage units of the image processing device 1400 and external storage devices. The memory 1402 is used to store application software and various types of data for which the image processing device 1400 is installed.

[0156] In some embodiments, display 1403 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 1403 is used to display information from image processing device 1400 and to display a visual user interface. Components 1401-1403 of image processing device 1400 communicate with each other via a system bus.

[0157] In some embodiments of the present invention, when the processor 1401 executes the neighborhood determination program in the memory 1402, the following steps may be implemented:

[0158] Determine the target domain and multiple candidate neighborhoods in the image to be filtered; the target domain includes multiple first pixels, and the candidate neighborhoods include multiple second pixels, with the number of first pixels and the number of second pixels being the same;

[0159] Construct a high-dimensional space and determine the target domain vector in the high-dimensional space and the neighborhood vectors of each candidate neighborhood in the high-dimensional space; the dimension of the high-dimensional space is the same as the number of the first pixel.

[0160] Determine the spatial angle between each neighborhood vector and the target domain vector, and determine at least one target neighborhood from multiple candidate neighborhoods based on the spatial angle.

[0161] In some embodiments of the present invention, when the processor 1401 executes the image filtering program in the memory 1402, the following steps can be implemented:

[0162] Acquire the image to be filtered and determine the target domain in the image to be filtered, the target domain including the pixels to be filtered;

[0163] At least one target neighborhood of the pixel to be filtered is determined based on the neighborhood determination method;

[0164] Determine at least one matching pixel in at least one target neighborhood that corresponds to the pixel to be filtered;

[0165] A weight determination model is constructed, and the weights of the target neighborhood are determined based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood.

[0166] Furthermore, this embodiment of the invention does not specifically limit the type of the image processing device 1400 mentioned. The image processing device 1400 can be a portable image processing device such as a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, or laptop computer. Exemplary embodiments of portable image processing devices include, but are not limited to, portable image processing devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable image processing device can also be other portable image processing devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, the image processing device 1400 may not be a portable image processing device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0167] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0168] The neighborhood determination method, image filtering method, and apparatus provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A neighborhood determination method, characterized in that, include: A target domain and multiple candidate neighborhoods are determined in the image to be filtered; the target domain includes multiple first pixels, and the candidate neighborhoods include multiple second pixels, wherein the number of first pixels and the number of second pixels are the same; A high-dimensional space is constructed, and the target domain vector and the neighborhood vector of each candidate neighborhood are determined in the high-dimensional space; the dimension of the high-dimensional space is the same as the number of the first pixel points. Determine the spatial angle between each of the neighborhood vectors and the target domain vector, and determine at least one target neighborhood among the plurality of candidate neighborhoods based on the spatial angle; Determining the target domain vector in the high-dimensional space and the neighborhood vectors of each candidate neighborhood in the high-dimensional space includes: Obtain the spatial coordinate system of the high-dimensional space, wherein the spatial coordinate system includes the spatial coordinate origin; Determine the target domain spatial coordinates in the spatial coordinate system and the neighborhood spatial coordinates of each of the candidate neighborhoods in the spatial coordinate system; The target domain vector is determined based on the origin of the spatial coordinates and the target domain spatial coordinates, and the neighborhood vector is determined based on the origin of the spatial coordinates and the neighborhood spatial coordinates. Determining at least one target neighborhood from the plurality of candidate neighborhoods based on the spatial angle includes: Determine whether the spatial angle is greater than the angle threshold; When the spatial angle is greater than the angle threshold, the candidate neighborhood is the target neighborhood.

2. The neighborhood determination method according to claim 1, characterized in that, The process of determining the target region and multiple candidate neighborhood regions in the image to be filtered includes: Determine the pixels to be filtered and the radius of the domain in the image to be filtered; The target domain is determined based on the pixel to be filtered and the domain radius; Based on the domain radius, the image to be filtered is traversed to determine the plurality of candidate neighborhoods.

3. The neighborhood determination method according to claim 2, characterized in that, The step of determining multiple candidate neighborhoods in the image to be filtered further includes: Determine the search radius, which is greater than the domain radius; The search area is determined based on the pixels to be filtered and the search radius; Based on the domain radius, the search area is traversed to determine the plurality of candidate neighborhoods.

4. An image filtering method, characterized in that, include: Acquire an image to be filtered and determine a target domain in the image to be filtered, wherein the target domain includes the pixels to be filtered; At least one target neighborhood of the pixel to be filtered is determined based on the neighborhood determination method; Determine at least one matching pixel in the at least one target neighborhood that corresponds to the pixel to be filtered; A weight determination model is constructed, and the weight of the target neighborhood is determined based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood. The target image is obtained by filtering the pixels to be filtered based on the weights and the matching pixels. The neighborhood determination method is the neighborhood determination method according to any one of claims 1 to 3.

5. The image filtering method according to claim 4, characterized in that, The step of determining the weights of the target neighborhood based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target neighborhood and the target neighborhood includes: Determine a first ratio between the first pixel value and the second pixel value; Determine a second ratio between the second pixel value and the first pixel value; The weight of the target neighborhood is determined based on the size of the pixel to be filtered, the first ratio, the second ratio, and the spatial angle between the target domain and the target neighborhood.

6. The image filtering method according to claim 4, characterized in that, The at least one target neighborhood includes a first target neighborhood and a second target neighborhood, the at least one matching pixel includes a first matching pixel in the first target neighborhood and a second matching pixel in the second target neighborhood, and the weight includes a first weight of the first target neighborhood and a second weight of the second target neighborhood; The filtering of the pixels to be filtered based on the weights and the matching pixels includes: The first weighted pixel value is determined based on the first weight and the pixel value of the first matched pixel. The second weighted pixel value is determined based on the second weight and the pixel value of the second matched pixel. The sum of the first weighted pixel value and the second weighted pixel value is used as the pixel value of the pixel to be filtered.

7. A neighborhood determination device, characterized in that, The apparatus is applicable to the neighborhood determination method according to any one of claims 1-3, and comprises: The target domain and neighborhood determination unit is used to determine the target domain and multiple candidate neighborhoods in the image to be filtered; the target domain includes multiple first pixels, and the candidate neighborhoods include multiple second pixels, wherein the number of first pixels and the number of second pixels are the same; A high-dimensional space construction unit is used to construct a high-dimensional space and determine the target domain vector of the target domain in the high-dimensional space and the neighborhood vector of each of the candidate neighborhoods in the high-dimensional space; the dimension of the high-dimensional space is the same as the number of the first pixel points; The target neighborhood determination unit is used to determine the spatial angle between each of the neighborhood vectors and the target domain vector, and to determine at least one target neighborhood among the plurality of candidate neighborhoods based on the spatial angle.

8. An image filtering device, characterized in that, include: The image to be filtered acquisition unit is used to acquire the image to be filtered and determine the target domain in the image to be filtered, wherein the target domain includes the pixels to be filtered. The target neighborhood acquisition unit is used to determine at least one target neighborhood of the pixel to be filtered based on a neighborhood determination method. A matching pixel point determination unit is used to determine at least one matching pixel point in the at least one target neighborhood that corresponds to the pixel point to be filtered; The weight determination unit is used to construct a weight determination model and determine the weight of the target neighborhood based on the weight determination model, the size of the pixel to be filtered, the first pixel value of the pixel to be filtered, the second pixel value of the matching pixel, and the spatial angle between the target domain and the target neighborhood. An image filtering unit is used to filter the pixels to be filtered based on the weights and the matching pixels to obtain a target image; The neighborhood determination method is the neighborhood determination method according to any one of claims 1 to 3.