Ultrasonic image processing method, electronic device, and storage medium
By dividing the ultrasound image into image blocks to be processed and allocating pixels for equalization processing, the problem of increased background noise during ultrasound image enhancement in the prior art is solved, and the clarity and detail display of the image are improved.
Patent Information
- Application Number
- CN202210244823.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-03-14
AI Technical Summary
Existing ultrasound image enhancement algorithms will enhance background noise at the same time when enhancing ultrasound parenchymal signals, causing local areas of the image to be too dark or too bright, with insignificant effects, and enhancing edge information alone cannot improve image details.
Divide the ultrasound image into non-overlapping image blocks to be processed, count the number of pixels in the gray level of each image block, filter out the pixels with a gray level whose number of pixels is higher than the threshold, and assign them to each gray level. level, equalization is performed to optimize the image.
By reducing the gray value of the noise area and highlighting the image details, a clearer optimized image is obtained and the overall quality of the ultrasound image is improved.
Smart Images

Figure CN114648455B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of ultrasonic image processing, and in particular to an ultrasonic image processing method, electronic equipment, and storage medium. Background Art
[0002] When enhancing the ultrasound parenchymal signal, the ultrasound image enhancement algorithm in the prior art often enhances the background noise at the same time, making the local area of the image too dark or too bright, and the effect is not obvious. If the edge information is enhanced alone, although the background noise will not be enhanced, the image details will not be enhanced either. Therefore, how to improve the quality of ultrasound images is a problem that needs to be solved at present. Summary of the invention
[0003] The present application discloses an ultrasonic image processing method, an electronic device and a storage medium, which are used to solve the problem of how to improve the quality of ultrasonic images.
[0004] In a first aspect, the present application proposes a method for processing an ultrasound image, comprising:
[0005] Dividing the ultrasound image into non-overlapping image blocks to be processed;
[0006] For each image block to be processed, execute:
[0007] Extracting the grayscale of the image block to be processed, and counting the number of pixels included in each grayscale;
[0008] Filter out the pixels to be allocated from the gray levels whose pixel counts are higher than the pixel count threshold;
[0009] Allocating the pixel points to be allocated to each grayscale level of the image block to be processed to obtain an optimized image block;
[0010] The optimized image block is equalized to obtain a first optimized image of the ultrasonic image.
[0011] In one embodiment, allocating the to-be-allocated pixels to the grayscale levels of the to-be-processed image block specifically includes:
[0012] If the pixel points to be allocated can be evenly divided into each grayscale level, the pixel points to be allocated are evenly allocated to each grayscale level of the image block to be processed, and the grayscale value of the pixel points to be allocated is adjusted to the grayscale value of the allocated grayscale level.
[0013] In one embodiment, the method further comprises:
[0014] If the pixel points to be allocated cannot be evenly divided into each grayscale level, then determine the mean of the total number of grayscale levels included in the pixel points to be allocated and the image block to be processed, round the mean down to obtain the number of equally divisible pixels to be evenly divided into each grayscale level and the remaining number of pixels to be allocated;
[0015] The pixels to be allocated of the equally divisible number of pixels are equally divided for each gray level, and the remaining pixels to be allocated are preferentially allocated to the gray levels whose number of pixels is less than the point threshold.
[0016] In one embodiment, after performing equalization processing on the optimized image block to obtain the first optimized image of the ultrasound image, the method further includes:
[0017] Reading the grayscale value at the vertex of each of the image blocks to be processed from the first optimized image;
[0018] Bilinear interpolation processing is performed on the first optimized image of the ultrasound image based on the grayscale values at the vertices of each image block to be processed to obtain a second optimized image of the ultrasound image.
[0019] In one embodiment, the method further comprises:
[0020] After translating the ultrasonic image in a specified direction by a specified pixel distance, a new ultrasonic image is obtained; and returning to the step of dividing the ultrasonic image into non-overlapping image blocks to be processed for the new ultrasonic image, until a second optimized image of the new ultrasonic image is obtained;
[0021] After translating the second optimized image of the new ultrasound image in the opposite direction of the specified direction by the specified pixel distance, an image to be fused is obtained;
[0022] The first optimized image and the image to be fused are fused based on a fusion coefficient to obtain a third optimized image of the ultrasound image.
[0023] In one embodiment, the step of preferentially allocating the remaining pixels to be allocated to gray levels having a pixel count less than the pixel count threshold specifically includes:
[0024] The remaining pixels to be allocated are allocated to the gray levels whose pixel count is less than the pixel count threshold in sequence according to the arrangement order of the gray levels.
[0025] In one embodiment, the step of selecting the pixels to be allocated from the gray levels whose pixel counts are higher than the pixel count threshold specifically includes:
[0026] The point threshold is calculated based on the following formula:
[0027] N cl=N aver +[β×(u x ×u y -N aver )]
[0028] Among them, N cl Represents the point threshold, N aver represents the mean value of the pixels of each gray level in the image block to be processed, β represents the preset shear limit coefficient, and u x represents the number of pixels in the horizontal direction of the image block to be processed, u y Represents the number of pixels in the vertical direction of the image block to be processed;
[0029] For each grayscale level, if the number of pixels in the grayscale level is higher than the point count threshold, the difference between the number of pixels in the grayscale level and the point count threshold is determined, and a preset ratio is multiplied by the difference to obtain the number to be screened, and the number of pixels to be screened are screened from the grayscale level; wherein the set of pixels screened from each grayscale level serves as the pixel points to be assigned.
[0030] In a second aspect, the present application provides an electronic device, comprising:
[0031] A memory for storing processor executable instructions;
[0032] A processor is configured to execute the instructions to implement any method provided in the first aspect of the present application.
[0033] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any method provided in the first aspect of the present application.
[0034] In a fourth aspect, a computer program product is provided in an embodiment of the present application, comprising a computer program, which, when executed by a processor, implements any of the methods provided in the first aspect of the present application.
[0035] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0036] The present application divides the ultrasound image into multiple image blocks to be processed on average, and implements the following steps for each image block to be processed: counting the number of pixels in each grayscale level in the image block to be processed, and screening out the pixels to be allocated from the grayscale levels with pixel counts higher than the point count threshold, and assigning the screened pixels to be allocated to each grayscale level of the image block to be processed, so as to reduce the grayscale value of the noise area in the ultrasound image and obtain a clearer optimized image block. Finally, the optimized image block is equalized to highlight the detailed information of the image, and the first optimized image of the ultrasound image is obtained.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 A structural block diagram of an ultrasonic device provided in an embodiment of the present application;
[0040] Figure 2 One of the schematic diagrams of the ultrasonic image processing flow provided in the embodiment of the present application;
[0041] Figure 3 A schematic diagram of a bilinear interpolation algorithm provided in an embodiment of the present application;
[0042] Figure 4 The second schematic diagram of the ultrasonic image processing flow provided in the embodiment of the present application;
[0043] Figure 5 A schematic diagram of the effect of performing a translation operation provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0045] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two.
[0046] The terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0047] In the related art, when enhancing the ultrasound parenchymal signal, the background noise is often enhanced at the same time, making the local area of the image too dark or too bright, and the effect is not obvious. If the edge information is enhanced alone, although the background noise will not be enhanced, the image details will not be enhanced either. Therefore, how to improve the quality of ultrasound images is a problem that needs to be solved at present.
[0048] In view of this, the present application proposes an ultrasound image processing method.
[0049] The present application divides the ultrasound image into multiple image blocks to be processed on average, and implements the following steps for each image block to be processed: counting the number of pixels in each grayscale level in the image block to be processed, and screening out the pixels to be allocated from the grayscale levels with pixel counts higher than the point count threshold, and assigning the screened pixels to be allocated to each grayscale level of the image block to be processed, so as to reduce the grayscale value of the noise area in the ultrasound image and obtain a clearer optimized image block. Finally, the optimized image block is equalized to highlight the detailed information of the image, and the first optimized image of the ultrasound image is obtained.
[0050] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0051] The electronic device in this application may be an ultrasound device, or a terminal device connected to the ultrasound device, or a server. Figure 1 , which is a structural block diagram of the ultrasonic device provided in an embodiment of the present application.
[0052] It should be understood that Figure 1The ultrasound device 100 shown is only one example, and the ultrasound device 100 may have more Figure 1 The more or less components shown in the figure can be combined with two or more components, or can have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0053] Figure 1 Schematically shows a hardware configuration block diagram of the ultrasound apparatus 100 according to an exemplary embodiment.
[0054] like Figure 1 As shown, the ultrasound device 100 may include, for example: a processor 110, a memory 120, a display unit 130 and an ultrasound image acquisition device 140; wherein:
[0055] An ultrasonic image acquisition device 140, used for acquiring an ultrasonic image;
[0056] A display unit 130, configured to display a third optimized image of the ultrasound image;
[0057] The memory 120 is configured to store data required for executing the ultrasound image processing method, which may include software programs, application interface data, etc.;
[0058] The processor 110 is connected to the ultrasound image acquisition device 140 and the display unit 130 respectively, and is configured to execute the ultrasound image processing method provided in the embodiment of the present application.
[0059] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application.
[0060] like Figure 2 The figure shows a schematic diagram of the ultrasonic image processing flow of the present application.
[0061] In step 201, the ultrasound image is divided into non-overlapping image blocks to be processed.
[0062] In step 202, the following operations are performed for each image block to be processed, including:
[0063] In step 2021, the grayscale level of the image block to be processed is extracted, and the number of pixels included in each grayscale level is counted.
[0064] In step 2022, the pixels to be allocated are screened out from the gray levels whose pixel counts are higher than the pixel count threshold.
[0065] In an embodiment of the present application, there is noise or artifacts in the ultrasound image, and the grayscale value of the noise or artifacts is higher. Therefore, in the grayscale level, the higher the grayscale level, the more pixels it contains, and the more obvious the noise or artifacts in the ultrasound image are. Therefore, it is necessary to filter out the part of the grayscale level where the number of pixels is higher than the point count threshold as the pixels to be assigned.
[0066] During screening, in order to consider the grayscale distribution of the entire image, the present application calculates the point count threshold based on the mean value of the pixels of each grayscale level in the image block to be processed. The formula for calculating the point count threshold is shown in formula (1):
[0067] N cl =N aver +[β×(u x ×u y -N aver )]…………(1)
[0068] In formula (1), N cl Indicates the point threshold, N aver Indicates the mean value of pixels at each gray level in the image block to be processed, u x Indicates the number of pixels in the horizontal direction of the image block to be processed, u y represents the number of pixels in the vertical direction of the image block to be processed, and β represents the preset shear limit coefficient. The value range of β is 0 to 1. The closer the value is to 1, the stronger the contrast of the ultrasound image.
[0069] In the embodiment of the present application, if all the pixels in the grayscale that are greater than the point threshold are cropped, the image details of the grayscale at the point threshold in the ultrasound image will be lost. Therefore, for each grayscale, if the number of pixels in the grayscale is higher than the point threshold, the difference between the number of pixels in the grayscale and the point threshold is determined, and the difference is multiplied by a preset ratio to obtain the number to be screened, and the number of pixels to be screened is screened from the grayscale. The set of pixels screened from each grayscale is used as the pixel to be allocated.
[0070] For example, if the number of pixels contained in a certain grayscale is m, the point threshold is n, and m>n, and the preset ratio is 80%, then the number of pixels to be allocated screened from the grayscale is (mn)*80%. If the number of pixels to be allocated calculated according to the preset ratio is not an integer, it can be calculated by rounding or rounding down. This application does not limit the rounding method.
[0071] If there are k gray levels in the ultrasound image, i represents the gray level sequence number, then the total number of pixels to be allocated is as shown in formula (2):
[0072]
[0073] In formula (2), N clip represents the total number of pixels to be allocated, H(i) represents the number of pixels in the i-th grayscale level, N cl represents the point threshold, and α represents the preset ratio.
[0074] In step 2023, the pixels to be allocated are allocated to each grayscale level of the image block to be processed to obtain an optimized image block.
[0075] In an embodiment of the present application, if the pixels to be allocated can be evenly divided into various grayscale levels, the pixels to be allocated are evenly allocated to each grayscale level of the image block to be processed, and the grayscale value of the pixels to be allocated is adjusted to the grayscale value of the allocated grayscale level.
[0076] The number of pixels of the i-th grayscale level in the image block to be processed after the pixels to be allocated are recorded as H′(i), and the distribution of the pixels in H′(i) is shown in formula (3):
[0077]
[0078] Among them, for H′(i)>N cl The number of pixels in this gray level that are greater than the point threshold is [H(i)-N cl ](1-α).
[0079] In formula (3), N acp Represents the number of pixels to be allocated to each gray level.
[0080] In another embodiment of the present application, if the pixels to be allocated cannot be evenly divided into each grayscale level, the mean of the total number of grayscale levels included in the pixels to be allocated and the image block to be processed is determined, and the mean is rounded down to obtain the number of equally divisible pixels to be divided into each grayscale level and the number of remaining pixels to be allocated. For each grayscale level, the pixels to be allocated that have the number of equally divisible pixels are evenly divided, and the remaining pixels to be allocated are preferentially allocated to the grayscale level with a pixel number less than the point threshold.
[0081] For example, if there are 80 pixels to be allocated in total and they need to be allocated to 30 gray levels, then the number of equally divisible pixels for each gray level is 2, and the remaining number of pixels to be allocated is 20.
[0082] In a possible embodiment, after the equally divisible pixel points are allocated, the remaining pixel points to be allocated are allocated in the grayscale levels in the order of the grayscale levels, with priority being given to the grayscale levels with the pixel points less than the point threshold.
[0083] For example, in order to distribute the remaining pixel points to be allocated as evenly as possible, the present application first allocates the remaining pixel points to the grayscale level one by one according to the grayscale level arrangement order from 0 to 255, in the grayscale level with the number of pixel points less than the point threshold. If the allocation is not completed, the remaining pixel points to be allocated that have not been allocated will continue to be allocated to the grayscale level with the number of pixel points less than the point threshold according to the grayscale level arrangement order until all the remaining pixel points to be allocated are allocated to each grayscale level.
[0084] In step 2024, the optimized image blocks are equalized to obtain a first optimized image of the ultrasound image spliced by the equalization processing results of the optimized image blocks.
[0085] In the present application, after the pixel points to be allocated are allocated to each grayscale level, the noise, artifacts and other parts in the ultrasound image can be eliminated, and the part that needs to be identified in the ultrasound image can be highlighted.
[0086] In the embodiment of the present application, although the detail information of the ultrasound image is highlighted after equalization processing, the grayscale distribution of each image block to be processed is different, and the point threshold is also different. Therefore, even after equalization, there are still differences in the grayscale of each image block to be processed. Therefore, the present application also needs to perform interpolation processing on the first optimized image.
[0087] There are many interpolation algorithms. This application selects a bilinear interpolation algorithm with a relatively simple algorithm complexity and good processing effect. Before calculating the grayscale value of each pixel in each image block to be processed in the first optimized image, read the grayscale value at the vertex of each image block to be processed in the first optimized image. Based on the grayscale value at the vertex of the image block to be processed, the first optimized image of the ultrasound image is subjected to bilinear interpolation processing to obtain the second optimized image of the ultrasound image.
[0088] The principle of bilinear interpolation is as follows Figure 3 As shown, Figure 3 is an image block to be processed in the first optimized image. The vertices of the image block to be processed are A, B, C and D, the grayscale values of each vertex are f(A), f(B), f(C) and f(D), and the coordinates of each vertex are A(x1, y1), B(x1, y2), C(x2, y1) and D(x2, y2). To calculate the grayscale value of the midpoint E(xE, yE) of the image block to be processed, it is necessary to perform interpolation calculation in the x-axis direction first.
[0089] Assuming that points E1(xE, y1) and E2(xE, y2) are points in the image block to be processed, the relationship between E1, E2 and each vertex is shown in formula (4) and formula (5):
[0090]
[0091]
[0092] Then interpolate in the y-axis direction, as shown in formula (6), to obtain the gray value of point E:
[0093]
[0094] In this way, the grayscale value of each pixel in the image block to be processed can be calculated.
[0095] In the embodiment of the present application, in order to improve the display effect of the detail part of the connection between each image block to be processed in the ultrasound image, the present application is based on the following Figure 4 The steps shown calculate a third optimized image of the ultrasound image.
[0096] In step 401, after the ultrasound image is translated in a specified direction by a specified pixel distance, a new ultrasound image is obtained.
[0097] In step 402, the step of dividing the new ultrasound image into non-overlapping image blocks to be processed is performed again on the new ultrasound image until a second optimized image of the new ultrasound image is obtained.
[0098] In the embodiment of the present application, taking the division of the ultrasound image into 4×4 image blocks to be processed as an example, the new ultrasound image obtained after rightward translation is as follows: Figure 5 shown. Figure 5 After the ultrasound image in the figure moves rightward from the dotted line to the solid line area, the dotted line area is the new ultrasound image, which includes the gray area in the dotted line area and the blank area on the far left. Figure 5 The ultrasound image area is divided and executed Figure 2 The steps in are performed to obtain a first optimized image of a new ultrasonic image. The first optimized image of the new ultrasonic image is subjected to bilinear interpolation processing to obtain a second optimized image of the new ultrasonic image.
[0099] It should be noted that the present application does not restrict the translation direction of the ultrasonic image. If the length is the length of the side of the image block to be processed in the horizontal direction, and the width is the side of the image block to be processed in the vertical direction. When the ultrasonic image is translated to the left or right in the horizontal direction, the translation distance is less than the length of the image block to be processed; when the ultrasonic image is translated upward or downward in the vertical direction, the translation distance is less than the width of the image block to be processed. At this time, although the image blocks to be processed divided by the new ultrasonic image are the same size as the image blocks to be processed divided by the ultrasonic image, the gray areas after division are different. That is, before and after the translation, the image blocks to be processed divided in the gray areas are different, and the connections between the image blocks to be processed are also different, thereby improving the detail display effect of the connections between the image blocks to be processed during fusion.
[0100] In step 403, the second optimized image of the new ultrasound image is translated in the opposite direction of the specified direction by the specified pixel distance to obtain an image to be fused.
[0101] In step 404, the first optimized image and the image to be fused are fused based on the fusion coefficient to obtain a third optimized image of the ultrasound image.
[0102] In the embodiment of the present application, f(x, y) is used to represent the second optimized image of the ultrasound image, f1(x, y) is used to represent the image to be fused, γ is used to represent the fusion coefficient, and f L The third optimized image represents the ultrasound image, and f(x, y) is fused with f1(x, y) according to formula (7).
[0103] f L =γ×f(x,y)+(1-γ)f(x,y)………(7)
[0104] Therefore, after the fusion processing, the detail display effect of the connection part between the image blocks to be processed in the ultrasonic image is improved.
[0105] In an exemplary embodiment, the present application further provides a computer-readable storage medium including instructions, such as a memory 120 including instructions, and the instructions can be executed by the processor 110 of the electronic device 100 to complete the above-mentioned ultrasound image processing method. Optionally, the computer-readable storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0106] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by the processor 110, the ultrasound image processing method provided in the present application is implemented.
[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0108] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0109] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0111] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for processing an ultrasonic image, characterized in that: include: Dividing the ultrasound image into non-overlapping image blocks to be processed; For each image block to be processed, respectively: extracting the grayscale level of the image block to be processed, and counting the number of pixels included in each grayscale level; Filtering pixels to be allocated from gray levels with pixel counts higher than a threshold value; allocating the pixels to be allocated to each gray level of the image block to be processed to obtain an optimized image block; performing equalization processing on the optimized image block to obtain a first optimized image of the ultrasound image, wherein the first optimized image of the ultrasound image is obtained by splicing the equalization processing results of each of the optimized image blocks; Reading the grayscale value at the vertex of each of the image blocks to be processed from the first optimized image; performing bilinear interpolation processing on the first optimized image of the ultrasound image based on the grayscale value at the vertex of each of the image blocks to be processed to obtain a second optimized image of the ultrasound image; After translating the ultrasonic image in a specified direction by a specified pixel distance, a new ultrasonic image is obtained; the new ultrasonic image is divided into non-overlapping image blocks to be processed; for each image block to be processed of the new ultrasonic image, the following steps are performed respectively: extracting the grayscale level of the image block to be processed of the new ultrasonic image, and counting the number of pixels included in each grayscale level; filtering out the pixels to be allocated from the grayscale levels with a pixel number higher than a point threshold; allocating the pixels to be allocated of the new ultrasonic image to each grayscale level of the image block to be processed of the new ultrasonic image, to obtain an optimized image block of the new ultrasonic image; performing equalization processing on the optimized image block of the new ultrasonic image, to obtain a first optimized image of the new ultrasonic image; Reading the grayscale values at the vertices of each image block to be processed of the new ultrasound image from the first optimized image of the new ultrasound image; performing bilinear interpolation processing on the first optimized image of the new ultrasound image based on the grayscale values at the vertices of each image block to be processed of the new ultrasound image, to obtain a second optimized image of the new ultrasound image; After translating the second optimized image of the new ultrasound image in the opposite direction of the specified direction by the specified pixel distance, an image to be fused is obtained; The second optimized image of the ultrasound image and the image to be fused are fused based on a fusion coefficient to obtain a third optimized image of the ultrasound image.
2. The method according to claim 1, characterized in that The allocating the to-be-allocated pixel points to each grayscale level of the to-be-processed image block specifically includes: If the pixel points to be allocated can be evenly divided into each grayscale level, the pixel points to be allocated are evenly allocated to each grayscale level of the image block to be processed, and the grayscale value of the pixel points to be allocated is adjusted to the grayscale value of the allocated grayscale level.
3. The method according to claim 2, characterized in that The method further comprises: If the pixel points to be allocated cannot be evenly divided into each grayscale level, then determine the mean of the total number of grayscale levels included in the pixel points to be allocated and the image block to be processed, round the mean down to obtain the number of equally divisible pixels to be evenly divided into each grayscale level and the remaining number of pixels to be allocated; The pixels to be allocated of the equally divisible number of pixels are equally divided for each gray level, and the remaining pixels to be allocated are preferentially allocated to the gray levels whose number of pixels is less than the point threshold.
4. The method according to claim 3, characterized in that The step of preferentially allocating the remaining pixels to be allocated to gray levels whose pixel count is less than the pixel count threshold specifically includes: The remaining pixels to be allocated are allocated to the gray levels whose pixel count is less than the pixel count threshold in sequence according to the arrangement order of the gray levels.
5. The method according to claim 1, characterized in that The step of selecting the pixels to be allocated from the gray levels whose pixel counts are higher than the pixel count threshold specifically includes: The point threshold is calculated based on the following formula: N cl =N aver +[β×(u x ×u y -N aver )] Among them, N cl Represents the point threshold, N aver represents the mean value of the number of pixels of each gray level in the image block to be processed, β represents the preset shear limit coefficient, and u x represents the number of pixels in the horizontal direction of the image block to be processed, u y Represents the number of pixels in the vertical direction of the image block to be processed; For each grayscale level, if the number of pixels in the grayscale level is higher than the point count threshold, the difference between the number of pixels in the grayscale level and the point count threshold is determined, and a preset ratio is multiplied by the difference to obtain the number to be screened, and the number of pixels to be screened are screened from the grayscale level; wherein the set of pixels screened from each grayscale level serves as the pixel points to be assigned.
6. An electronic device, characterized in that: include: A memory for storing processor executable instructions; A processor is configured to execute the instructions to implement any method provided in claims 1-5.
7. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any method provided in claims 1-5.
8. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements any method provided in claims 1-5.
