Testicular ultrasound image automatic optimization method and system
The denoising process of testicular ultrasound images was optimized by using edge detection algorithms and texture descriptors, which solved the problems of noise and artifacts, and improved the image clarity and diagnostic effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SECOND AFFILIATED HOSPITAL OF XIAN MEDICAL UNIV
- Filing Date
- 2026-03-09
- Publication Date
- 2026-06-09
AI Technical Summary
Testicular ultrasound imaging is limited by noise, artifacts, and resolution during the imaging process, which affects diagnostic accuracy. Traditional algorithms may lead to over-smoothing or blurring of details.
An edge detection algorithm was used to iteratively process the ultrasound images of the testis. The diffusion coefficient was adjusted by adjusting the edge change factor and texture descriptor to optimize the image denoising process.
It effectively removes noise, improves image quality and detail, and enhances diagnostic accuracy.
Smart Images

Figure CN122175822A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of testicular ultrasound image denoising, specifically to an automatic optimization method and system for testicular ultrasound images. Background Technology
[0002] Testicular ultrasound imaging is crucial for clinical diagnosis, primarily used to detect and assess testicular structure, blood flow, masses, and other lesions. Ultrasound examination, with its non-invasive, real-time, convenient, and low-cost characteristics, has become a common clinical method for screening testicular lesions. However, ultrasound images are often affected by noise, artifacts, and resolution limitations during imaging, which can lead to decreased image quality and consequently affect diagnostic accuracy. Therefore, image optimization is essential to enhance the diagnostic value of ultrasound images. Image denoising, a common image optimization technique, is significant for improving the clarity and diagnostic effectiveness of testicular ultrasound images. Applying image denoising algorithms can effectively reduce noise interference while preserving important details. This not only helps enhance the quality of testicular images but also assists physicians in making more accurate diagnoses in complex or small lesion areas, thereby improving treatment outcomes.
[0003] During the acquisition of testicular ultrasound images, speckle noise can occur due to random particulate interference caused by coherent scattering of ultrasound waves. Anisotropic filtering can be used to smooth and remove this speckle noise. In traditional algorithms, the diffusion coefficient is calculated based on local gradient information. If the diffusion coefficient cannot adapt to the details in the image, it may lead to over-smoothing of some areas. Testicular ultrasound images contain many fine textures and tissue structures. If the diffusion coefficient is too large, these details may become blurred or even disappear, thus affecting the diagnostic results. Summary of the Invention
[0004] To address the aforementioned technical problems, the present invention aims to provide an automatic optimization method and system for testicular ultrasound images, the specific technical solution of which is as follows:
[0005] An automatic optimization method for testicular ultrasound images, the method comprising:
[0006] Acquire ultrasound images of the patient's testicles;
[0007] The ultrasound image of the testis is divided into equal parts according to a preset size to obtain all local regions; one local region is selected as a reference region; and the following is used... The edge detection algorithm performs edge detection on the reference region. The edge detection algorithm iterates a preset number of times on a high threshold to obtain edge pixels within the reference region after each iteration. The edge pixels within the reference region after the first edge detection are used as reference pixels. An edge change factor for the reference region is obtained based on the number of pixels within the reference region, the number of reference pixels, and the number of newly added pixels in the preset neighborhood of the reference pixels after each iteration. The approximate gradient direction pixel for each edge pixel is obtained based on the gradient direction difference and positional distribution between each edge pixel within the reference region after iterative processing. Finally, a texture descriptor for each edge pixel is obtained based on the gradient direction difference between each edge pixel and the approximate gradient direction pixel, the number of approximate gradient direction pixels, and the gradient value difference between each edge pixel and other pixels in the preset neighborhood.
[0008] The diffusion coefficient of each edge pixel is obtained based on the gradient features and texture descriptor of each edge pixel in the reference region, as well as the edge variation factor of the reference region; the testicular ultrasound image is then denoised based on the diffusion coefficient of each edge pixel.
[0009] Furthermore, the method for obtaining the edge change factor includes:
[0010] The edge change factor is obtained according to the edge change factor calculation formula, which is shown below:
[0011]
[0012] In the formula, This represents the edge variation factor of the reference region; Indicates the number of pixels within the reference area; Represents the reference pixel within the reference area; Indicates the number of iterations; Indicates the first The number of newly added edge pixels in the reference area during each iteration; Indicates the first During the next iteration, the reference region is... The number of reference pixels contained in the preset neighborhood of each newly added edge pixel.
[0013] Furthermore, the method for obtaining the approximate gradient direction pixel points includes:
[0014] A Cartesian coordinate system is established with the lower left corner of the ultrasound image of the testis as the origin;
[0015] The angle between the gradient direction of each edge pixel and the positive x-axis is taken as the gradient direction angle of each edge pixel.
[0016] Select any edge pixel as the reference pixel; take other edge pixels whose gradient direction angle difference with the reference pixel is less than a preset first threshold as the initial approximate gradient direction pixels of the reference pixel; using the reference pixel as the initial point, traverse and connect adjacent initial approximate gradient direction pixels, then use the connected initial approximate gradient direction pixels as the new initial point, traverse and connect adjacent initial approximate gradient direction pixels, and repeat the connection operation of adjacent initial approximate gradient direction pixels until the latest initial point has no adjacent initial approximate gradient direction pixels, and end the traversal; take other initial approximate gradient direction pixels on the same polyline as the reference pixel as the approximate gradient direction pixels of the reference pixel.
[0017] Furthermore, the method for obtaining the texture descriptor includes:
[0018] The texture descriptor is obtained according to the texture descriptor calculation method, which is as follows:
[0019]
[0020] In the formula, A texture descriptor representing each edge pixel; This represents the pixel corresponding to the approximate gradient direction for each edge pixel. This represents the gradient direction angle of each edge pixel; Represents the first edge pixel corresponding to each edge pixel. The gradient direction angle of a pixel with an approximate gradient direction; This represents the gradient value of each edge pixel; This indicates the number of other pixels within the preset neighborhood of each edge pixel; Represents the preset neighborhood of each edge pixel. Gradient values of other pixels; This represents the absolute value function.
[0021] Furthermore, the method for obtaining the diffusion coefficient includes:
[0022] Based on the edge variation factor and texture descriptor of the edge pixels, the gradient value of the edge pixels is corrected to obtain the corrected gradient value of each edge pixel;
[0023] The diffusion factor of each edge pixel is obtained by performing a negative correlation normalization operation on the corrected gradient value of each edge pixel.
[0024] Furthermore, the method for obtaining the corrected gradient value includes:
[0025] The corrected gradient value is obtained according to the formula for calculating the corrected gradient value, which is as follows:
[0026]
[0027] In the formula, Indicates the first Corrected gradient values for each edge pixel; Indicates the first Gradient values of each edge pixel; Indicates the first Texture descriptor for each edge pixel; Indicates the first Edge variation factor for each edge pixel; This represents the maximum value function.
[0028] An automatic optimization system for testicular ultrasound images is provided. The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the automatic optimization method for testicular ultrasound images described above.
[0029] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described automatic optimization method for testicular ultrasound images.
[0030] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described automatic optimization method for testicular ultrasound images.
[0031] The present invention has the following beneficial effects:
[0032] This invention acquires ultrasound images of the patient's testicles; due to the limitations of traditional dual-threshold methods... Edge detection algorithms can alter the number of edge pixels in testicular ultrasound images by continuously changing a high threshold. Since analyzing the entire image can easily miss details, the testicular ultrasound image is first divided into equal parts according to a preset size to obtain all local regions, and then... Edge detection algorithms perform edge detection on a reference region. The edge detection algorithm uses a high threshold for a preset number of iterations to obtain edge pixels within the reference area after each iteration. This facilitates subsequent analysis of the edge pixel distribution and its own characteristics after different iterations. This was applied to the first analysis of testicular ultrasound images. After edge detection, the more edge pixels a local region contains, the more complex the physiological structure or tissue composition of the testis to which that local region belongs. However, as the high threshold is iterated, some weak edge pixels will also appear. When the testicular ultrasound image is significantly affected by noise, these weak edges are easily ignored. But in reality, these weak edges may correspond to important tissue details such as blood vessels and spermatic cords. Therefore, the edge pixels in the reference region after the first edge detection are used as baseline pixels, and the number of edge pixels in the preset neighborhood of the baseline pixels is analyzed during different iterations to obtain the edge change factor of the reference region, thus obtaining the edge changes around strong edges. Simultaneously, in the testis... Texture features are also a crucial element of analysis within each local region of a testicular ultrasound image. Therefore, this invention analyzes the gradient direction consistency and gradient value of edge pixels within a local region and describes the texture features of these edge pixels. Since the edge variation factor considers the contribution of weak edge pixels to texture composition, and the texture descriptor excludes noise pixels with isolated characteristics, both are related to the diffusion coefficient of edge pixels. Thus, by considering the edge variation factor of the local region and the detail richness of the texture descriptor of the edge pixels in that local region, the diffusion coefficient of each pixel in the algorithm is adjusted. Noise reduction is then performed on the testicular ultrasound image based on the diffusion coefficient of each edge pixel. This invention can select an appropriate diffusion coefficient to remove noise from testicular ultrasound images while simultaneously improving image quality and detail. Attached Figure Description
[0033] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0034] Figure 1 This is a flowchart of an automatic optimization method for testicular ultrasound images provided in one embodiment of the present invention;
[0035] Figure 2 This is a block diagram of an automatic optimization system for testicular ultrasound imaging provided in one embodiment of the present invention. Detailed Implementation
[0036] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of an automatic optimization method and system for testicular ultrasound images proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0038] The following description, in conjunction with the accompanying drawings, details the specific scheme of the automatic optimization method and system for testicular ultrasound images provided by this invention.
[0039] Please see Figure 1 This illustration shows an automatic optimization method and system for testicular ultrasound images according to an embodiment of the present invention. The method includes:
[0040] Step S1: Acquire ultrasound images of the patient's testes.
[0041] The embodiments of the present invention are mainly applied to the scenario of improving the quality of ultrasound images of patients' testes, therefore, the first step is to acquire ultrasound images of patients' testes.
[0042] In one embodiment of the present invention, the acquired testicular ultrasound image undergoes initial denoising processing to remove noticeable noise pixels, thereby obtaining a testicular ultrasound image for subsequent operations. It should be noted that denoising is a technique well-known to those skilled in the art and is not limited or elaborated upon here.
[0043] Step S2: Divide the testicular ultrasound image into equal parts according to a preset size to obtain all local regions; select one local region as a reference region; use... Edge detection algorithms perform edge detection on a reference region. The edge detection algorithm iterates a preset number of times on a high threshold to obtain edge pixels within the reference region after each iteration. The edge pixels within the reference region after the first edge detection are used as reference pixels. Based on the number of pixels within the reference region, the number of reference pixels, and the number of newly added pixels in the preset neighborhood of the reference pixels after each iteration, an edge change factor for the reference region is obtained. Based on the gradient direction difference and positional distribution between each edge pixel within the reference region after iterative processing, the corresponding approximate gradient direction pixel for each edge pixel is obtained. Based on the gradient direction difference between each edge pixel and the approximate gradient direction pixel, the number of approximate gradient direction pixels, and the gradient value difference between each edge pixel and other pixels in the preset neighborhood, a texture descriptor for each edge pixel is obtained.
[0044] Due to the traditional dual threshold Edge detection algorithms can change the number of edge pixels in testicular ultrasound images by continuously varying a high threshold. Since analyzing the entire image can easily miss details, this embodiment of the invention first divides the testicular ultrasound image into equal parts according to a preset size to obtain all local regions, and then uses... Edge detection algorithms perform edge detection on a reference region. The high threshold in the edge detection algorithm is processed through a preset number of iterations to obtain the edge pixels in the reference area after each iteration. This facilitates subsequent analysis of the distribution of edge pixels after different iterations and their own characteristics.
[0045] In one embodiment of the present invention, the preset size is set to A rectangle located at the edge of the image; if the side length of the constructed local region is insufficient... If the value is not specified, no completion will be performed. It should be noted that the preset size can be set by the user and is not limited here.
[0046] In one embodiment of the present invention, the low threshold is kept constant during iteration, while the high threshold starts from the initial value and decreases each time. The number of iterations is This iterative process is repeated to complete the iteration. It should be noted that... Edge detection algorithms are well-known techniques in the field of science, and the method for obtaining initial values is existing technology, which will not be elaborated here.
[0047] The first ultrasound images of the testis were performed After edge detection, the more edge pixels a local region contains, the more complex the physiological structure or tissue composition of the testis to which that local region belongs, such as the edge between the testicular parenchyma and the epididymis, or the cross-section around the testicular blood vessels. As the high threshold is continuously iterated, some weak edge pixels will also appear. When the testicular ultrasound image is affected by significant noise, these weak edges are easily ignored. However, in reality, these weak edges may correspond to important tissue details such as blood vessels and spermatic cords. Therefore, the edge pixels in the reference region after the first edge detection are used as the baseline pixels, and the number of edge pixels in the preset neighborhood of the baseline pixels is analyzed in different iterations to obtain the edge change factor of the reference region, so as to obtain the edge changes around strong edges.
[0048] Preferably, in one embodiment of the present invention, the method for obtaining the edge change factor includes:
[0049] The edge change factor is obtained according to the edge change factor calculation formula, which is shown below:
[0050]
[0051] In the formula, This represents the edge variation factor of the reference region; Indicates the number of pixels within the reference area; Represents the reference pixel within the reference area; This indicates the number of iterations; in one embodiment of the present invention, it is set to 3 times. Indicates the first The number of newly added edge pixels in the reference area during each iteration; Indicates the first During the next iteration, the reference region is... The number of reference pixels contained in the preset neighborhood of each newly added edge pixel.
[0052] In the formula for calculating the edge variation factor, a larger number of reference pixels within the reference region indicates a greater number of strong edge pixels. This makes it less likely that significant weak edge pixels will exist, resulting in a smaller edge variation factor for the reference region. The number of edge pixels in the preset neighborhood of each reference pixel after each iteration is statistically analyzed to obtain... The fewer these pixels there are, the fewer weak edge pixels there are near the reference pixel. This means that it is less likely that there will be a distribution of weak edges near strong edges, and the smaller the edge change factor of the reference area will be.
[0053] Meanwhile, texture features are also an important subject of analysis in each local region of the testicular ultrasound image. Therefore, this embodiment of the invention analyzes the gradient direction consistency and gradient value of edge pixels within the local region. First, one edge pixel is randomly selected from all the edge pixels after iteration for analysis, and the corresponding pixel with the approximate gradient direction is selected.
[0054] Preferably, in one embodiment of the present invention, the method for obtaining pixels in the approximate gradient direction includes:
[0055] A Cartesian coordinate system was established with the lower left corner of the testicular ultrasound image as the origin; the angle between the gradient direction of each edge pixel and the positive x-axis was taken as the gradient direction angle of each edge pixel.
[0056] Select any edge pixel as a reference pixel; select other edge pixels whose gradient direction angle difference from the reference pixel is less than a preset first threshold as the initial approximate gradient direction pixels of the reference pixel; using the reference pixel as the initial point, traverse and connect adjacent initial approximate gradient direction pixels, then use the connected initial approximate gradient direction pixels as the new initial point, traverse and connect adjacent initial approximate gradient direction pixels, and repeat the connection operation of adjacent initial approximate gradient direction pixels until the latest initial point has no adjacent initial approximate gradient direction pixels, and end the traversal; select other initial approximate gradient direction pixels on the same polygon line as the reference pixel as the approximate gradient direction pixels of the reference pixel. In one embodiment of the present invention, the preset first threshold is set to 30°. It should be noted that the preset first threshold can be set by itself and is not limited here.
[0057] Furthermore, by combining the gradient direction consistency and gradient change of edge pixels, the texture features of edge pixels are described.
[0058] Preferably, in one embodiment of the present invention, the method for obtaining texture descriptors includes:
[0059] The texture descriptor is obtained according to the texture descriptor calculation method, which is shown below:
[0060]
[0061] In the formula, A texture descriptor representing each edge pixel; This represents the pixel corresponding to the approximate gradient direction for each edge pixel. This represents the gradient direction angle of each edge pixel; Represents the first edge pixel corresponding to each edge pixel. The gradient direction angle of a pixel with an approximate gradient direction; This represents the gradient value of each edge pixel; This indicates the number of other pixels within the preset neighborhood of each edge pixel; Represents the preset neighborhood of each edge pixel. Gradient values of other pixels; This represents the absolute value function.
[0062] In one embodiment of the present invention, the preset neighborhood is set as a rectangular area composed of eight neighboring pixels centered on the edge pixel. It should be noted that the preset neighborhood can be set arbitrarily and is not limited here.
[0063] In texture descriptor calculation methods, the smaller the sum of gradient direction angle differences between each edge pixel and all pixels with approximate gradient directions, and the larger the number of pixels with approximate gradient directions corresponding to each edge pixel, the better. The larger the value, the more other edge pixels have the same gradient direction as the edge pixel, and the stronger the directional consistency. In this case, the texture descriptor of the edge pixel is larger. The smaller the gradient sum of other pixels in the preset neighborhood of the edge pixel compared to the gradient value of the edge pixel, that is... The larger the value, the more obvious the gradient change rate of the edge pixel, and the larger the texture descriptor of the edge pixel.
[0064] Step S3: Obtain the diffusion coefficient of each edge pixel based on the gradient features and texture descriptor of each edge pixel in the reference region, as well as the edge variation factor of the reference region; denoise the testicular ultrasound image based on the diffusion coefficient of each edge pixel.
[0065] The edge variation factor obtained from the above steps can take into account the contribution of weak edge pixels to the texture composition, while the texture descriptor can exclude noise pixels with isolated characteristics. Both are related to the diffusion coefficient of edge pixels. Therefore, the diffusion coefficient of each pixel in the algorithm is adjusted by the edge variation factor of the local region and the detail richness of the texture descriptor of the edge pixels in that local region.
[0066] Preferably, in one embodiment of the present invention, the method for obtaining the diffusion coefficient includes:
[0067] Based on the edge variation factor and texture descriptor of the edge pixels, the gradient values of the edge pixels are corrected to obtain the corrected gradient value for each edge pixel. The corrected gradient value is then obtained according to the formula shown below:
[0068]
[0069] In the formula, Indicates the first Corrected gradient values for each edge pixel; Indicates the first Gradient values of each edge pixel; Indicates the first Texture descriptor for each edge pixel; Indicates the first Edge variation factor for each edge pixel; This represents the maximum value function.
[0070] In the revised gradient value calculation formula, the first... The texture descriptors of each edge pixel are normalized to their maximum values. It refers to the first The maximum value of the texture descriptor of the edge pixels within the local region where the edge pixel is located, the th edge pixel The larger the texture descriptor of the edge pixel, the more it indicates that the... The more obvious the detailed features of the edge pixels, the larger the corrected gradient value will be; The larger the edge variation factor of the edge pixel, the more significant the edge variation factor. The more important the weak edge pixels in the local region where an edge pixel is located, the larger the corrected gradient value should be.
[0071] Since the corrected gradient values of the edge pixels have been increased accordingly, the diffusion coefficient is reduced. Therefore, the corrected gradient values of each edge pixel are negatively correlated and normalized to obtain the diffusion factor of each edge pixel.
[0072] The value of each pixel is updated using the diffusion coefficient of each pixel, and then a diffusion operation is performed. By iterating and updating the pixel value multiple times, noise in the testicular ultrasound image is gradually removed.
[0073] In summary, testicular ultrasound images of the patient were acquired; the testicular ultrasound images were divided into equal parts according to a preset size to obtain all local regions; one local region was selected as a reference region; and the following methods were employed. Edge detection algorithms perform edge detection on a reference region. The edge detection algorithm iterates a preset number of times using a high threshold to obtain edge pixels within the reference region after each iteration. The edge pixels within the reference region after the first edge detection are used as reference pixels. An edge change factor for the reference region is obtained based on the number of pixels in the reference region, the number of reference pixels, and the number of newly added pixels in the preset neighborhood of the reference pixels after each iteration. The approximate gradient direction pixel for each edge pixel is obtained based on the gradient direction difference and positional distribution between each edge pixel within the reference region after iterative processing. The texture descriptor for each edge pixel is obtained based on the gradient direction difference between each edge pixel and the approximate gradient direction pixel, the number of approximate gradient direction pixels, and the gradient value difference between each edge pixel and other pixels in the preset neighborhood. The diffusion coefficient for each edge pixel is obtained based on its gradient features, texture descriptor, and the edge change factor within the reference region. The testicular ultrasound image is then denoised using the diffusion coefficient of each edge pixel.
[0074] One embodiment of the present invention provides an automatic optimization system for testicular ultrasound imaging. The system includes a memory, a processor, and a computer program. The memory stores the corresponding computer program, and the processor runs the corresponding computer program. When the computer program runs in the processor, it can implement the methods described in steps S1-S3, specifically including:
[0075] Image acquisition module 101 is used to acquire ultrasound images of the patient's testicles;
[0076] Image analysis module 102 is used to divide the testicular ultrasound image into equal parts according to a preset size to obtain all local regions; one local region is selected as a reference region; and the following methods are employed. Edge detection algorithms perform edge detection on a reference region. The edge detection algorithm iterates a preset number of times on a high threshold to obtain edge pixels within the reference region after each iteration. The edge pixels within the reference region after the first edge detection are used as reference pixels. Based on the number of pixels within the reference region, the number of reference pixels, and the number of newly added pixels in the preset neighborhood of the reference pixels after each iteration, an edge change factor for the reference region is obtained. Based on the gradient direction difference and positional distribution between each edge pixel within the reference region after iterative processing, the corresponding approximate gradient direction pixel for each edge pixel is obtained. Based on the gradient direction difference between each edge pixel and the approximate gradient direction pixel, the number of approximate gradient direction pixels, and the gradient value difference between each edge pixel and other pixels in the preset neighborhood, a texture descriptor for each edge pixel is obtained.
[0077] The image denoising module 103 is used to obtain the diffusion coefficient of each edge pixel based on the gradient features and texture descriptor of each edge pixel in the reference area, as well as the edge change factor of the reference area; and to denoise the testicular ultrasound image based on the diffusion coefficient of each edge pixel.
[0078] A third objective of this invention is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the methods described in steps S1-S3.
[0079] The fourth objective of this invention is to provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in steps S1-S3.
[0080] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0081] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. An automatic optimization method for testicular ultrasound images, characterized in that, The method includes: Acquire ultrasound images of the patient's testicles; The ultrasound image of the testis is divided into equal parts according to a preset size to obtain all local regions; one local region is selected as a reference region; and the following is used... The edge detection algorithm performs edge detection on the reference region. The edge detection algorithm iterates a preset number of times on a high threshold to obtain edge pixels within the reference region after each iteration. The edge pixels within the reference region after the first edge detection are used as reference pixels. An edge change factor for the reference region is obtained based on the number of pixels within the reference region, the number of reference pixels, and the number of newly added pixels in the preset neighborhood of the reference pixels after each iteration. The approximate gradient direction pixel for each edge pixel is obtained based on the gradient direction difference and positional distribution between each edge pixel within the reference region after iterative processing. Finally, a texture descriptor for each edge pixel is obtained based on the gradient direction difference between each edge pixel and the approximate gradient direction pixel, the number of approximate gradient direction pixels, and the gradient value difference between each edge pixel and other pixels in the preset neighborhood. The diffusion coefficient of each edge pixel is obtained based on the gradient features and texture descriptor of each edge pixel in the reference region, as well as the edge variation factor of the reference region; the testicular ultrasound image is then denoised based on the diffusion coefficient of each edge pixel.
2. The automatic optimization method for testicular ultrasound images according to claim 1, characterized in that, The method for obtaining the edge change factor includes: The edge change factor is obtained according to the edge change factor calculation formula, which is shown below: In the formula, This represents the edge variation factor of the reference region; Indicates the number of pixels within the reference area; Represents the reference pixel within the reference area; Indicates the number of iterations; Indicates the first The number of newly added edge pixels in the reference area during each iteration; Indicates the first During the next iteration, the reference region is... The number of reference pixels contained in the preset neighborhood of each newly added edge pixel.
3. The automatic optimization method for testicular ultrasound images according to claim 1, characterized in that, The method for obtaining the approximate gradient direction pixel points includes: A Cartesian coordinate system is established with the lower left corner of the ultrasound image of the testis as the origin; The angle between the gradient direction of each edge pixel and the positive x-axis is taken as the gradient direction angle of each edge pixel. Select any edge pixel as the reference pixel; take other edge pixels whose gradient direction angle difference with the reference pixel is less than a preset first threshold as the initial approximate gradient direction pixels of the reference pixel; using the reference pixel as the initial point, traverse and connect adjacent initial approximate gradient direction pixels, then use the connected initial approximate gradient direction pixels as the new initial point, traverse and connect adjacent initial approximate gradient direction pixels, and repeat the connection operation of adjacent initial approximate gradient direction pixels until the latest initial point has no adjacent initial approximate gradient direction pixels, and end the traversal; take other initial approximate gradient direction pixels on the same polyline as the reference pixel as the approximate gradient direction pixels of the reference pixel.
4. The automatic optimization method for testicular ultrasound images according to claim 1, characterized in that, The method for obtaining the texture descriptor includes: The texture descriptor is obtained according to the texture descriptor calculation method, which is as follows: In the formula, A texture descriptor representing each edge pixel; This represents the pixel corresponding to the approximate gradient direction for each edge pixel. This represents the gradient direction angle of each edge pixel; Represents the first edge pixel corresponding to each edge pixel. The gradient direction angle of a pixel with an approximate gradient direction; This represents the gradient value of each edge pixel; This indicates the number of other pixels within the preset neighborhood of each edge pixel; Represents the preset neighborhood of each edge pixel. Gradient values of other pixels; This represents the absolute value function.
5. The automatic optimization method for testicular ultrasound images according to claim 1, characterized in that, The method for obtaining the diffusion coefficient includes: Based on the edge variation factor and texture descriptor of the edge pixels, the gradient value of the edge pixels is corrected to obtain the corrected gradient value of each edge pixel; The diffusion factor of each edge pixel is obtained by performing a negative correlation normalization operation on the corrected gradient value of each edge pixel.
6. The automatic optimization method for testicular ultrasound images according to claim 5, characterized in that, The method for obtaining the corrected gradient value includes: The corrected gradient value is obtained according to the formula for calculating the corrected gradient value, which is as follows: In the formula, Indicates the first Corrected gradient values for each edge pixel; Indicates the first Gradient values of each edge pixel; Indicates the first Texture descriptor for each edge pixel; Indicates the first Edge variation factor for each edge pixel; This represents the maximum value function.
7. An automatic optimization system for testicular ultrasound imaging, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the automatic optimization method for testicular ultrasound images as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the automatic optimization method for testicular ultrasound images as described in any one of claims 1 to 6.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the automatic optimization method for testicular ultrasound images as described in any one of claims 1 to 6.