Ultrasonic video compression method

By embedding ultrasonic image analysis module in the traditional video compression and coding strategy, dynamically determining the ultrasonic video frame type and quantization coefficient, the problems of large amount of ultrasonic video data and high transmission cost are solved, and efficient video compression and information retention are achieved.

CN116248896BActive Publication Date: 2025-08-15HEFEI HEBIN INTELLIGENT ROBOTS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310103660.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-13
Publication Date
2025-08-15
Estimated Expiration
2043-02-13

AI Technical Summary

Technical Problem

The existing traditional video compression and encoding technology cannot effectively adapt to the characteristics of ultrasonic video, resulting in large amounts of ultrasonic video data, high storage and transmission costs, and the inability to effectively retain valuable image information.

Method used

The ultrasonic image analysis module is embedded in the traditional video compression coding strategy. The frame type and quantization coefficient are dynamically determined by analyzing the characteristics of each frame of image, including tissue structure and lesion analysis, and are divided into five types of image types to optimize the compression ratio.

Benefits of technology

It improves the compression ratio of ultrasonic video, reduces storage and transmission costs, while retaining valuable image information to the greatest extent, and supports subsequent ultrasonic AI algorithm analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248896B_ABST
    Figure CN116248896B_ABST
Patent Text Reader

Abstract

The present invention discloses an ultrasound video compression method, which relates to the technical field of video compression coding. An ultrasound image analysis module is embedded in a traditional video compression coding strategy to analyze each frame of an ultrasound video, evaluate the value of each frame based on the characteristics of the ultrasound image, and dynamically determine the frame type and quantization coefficient of each frame in the ultrasound video. This method improves the video compression ratio of the ultrasound video while ensuring that valuable information in the ultrasound video is retained. A high compression rate is used for low-quality video frames containing less valuable information, while a low compression rate is used for high-quality video frames containing more valuable information. This method not only reduces the size of the compressed video file and reduces hardware storage costs, but also maximizes the image quality of high-value video frames, facilitating information restoration during later patient follow-up.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video compression coding, in particular to an ultrasonic video compression method. Background Art

[0002] Currently, ultrasound doctors only record images or short videos that they deem valuable during patient examinations. Patient case reports only include images, but the complete ultrasound scan video is not recorded. This lack of data is detrimental to both patient case tracking and hospital data accumulation.

[0003] The massive volume of ultrasound video data is the primary reason for this situation. First, ultrasound examinations rely heavily on the physician's experience, requiring constant adjustment of scanning techniques to diagnose the patient's area. Inexperienced physicians can therefore take longer scans. Second, once a physician locates a valuable anatomical structure or lesion, they typically scan the object at an extremely slow speed, observing it from various angles. They also likely use the ultrasound machine's interactive measurement tools to quantify the target, which also increases scanning time. Finally, ultrasound can examine a wide range of areas and is in high demand, resulting in ultrasound video generating the largest amount of data in hospital imaging. Saving all of this data would require extensive storage devices, and transmitting ultrasound video remotely in real time for services such as telemedicine would consume significant amounts of data.

[0004] From the above description, it can be found that most of the time during ultrasound examinations, doctors do not locate the diseased part for detailed diagnosis, and doctors only perform detailed diagnosis on the located diseased part in a short period of time.

[0005] Traditional video compression coding technologies such as H264 and H265 encode videos based on the motion information of the previous and next frames to ensure that even fast-moving video frames have high PSNR and MS-SSIM indicators.

[0006] However, directly applying traditional video compression coding technology to ultrasound video is inappropriate for compressing ultrasound videos. This is primarily due to the following reasons: During ultrasound scanning, rapid image motion indicates that the doctor is rapidly adjusting the ultrasound probe's scanning angle to quickly diagnose the patient's condition. This situation contains less valuable information, which can lead to lower image encoding quality and a higher compression rate. However, slower image motion indicates that the doctor has located a candidate area for a patient lesion. This situation contains more valuable information, which can lead to relatively higher image encoding quality and a lower compression rate. Furthermore, when lesions or important tissue structures are present in the ultrasound image, image encoding quality also needs to be improved; otherwise, it can be reduced.

[0007] Therefore, it is necessary to improve the traditional video compression coding technology according to the characteristics of ultrasound video, so as to dynamically determine the image coding quality of each frame in the ultrasound video and improve the video compression ratio of the ultrasound video while ensuring that valuable information can be retained. Summary of the Invention

[0008] In order to overcome the above-mentioned defects in the existing technology, the present invention provides an ultrasound video compression method, which embeds an ultrasound image analysis module in the traditional video compression coding strategy to analyze each frame of the ultrasound video. According to the characteristics of the ultrasound image, the frame type and quantization coefficient of each frame of the ultrasound video are dynamically determined, thereby improving the video compression ratio of the ultrasound video while ensuring that valuable information in the ultrasound video can be retained.

[0009] To achieve the above object, the present invention adopts the following technical solutions, including:

[0010] An ultrasound video compression method embeds an ultrasound image analysis module in a traditional video compression coding strategy to analyze each frame of the ultrasound video and dynamically determine the frame type and quantization coefficient (QP) value of each frame of the ultrasound video;

[0011] The analysis method of the ultrasound image analysis module is specifically as follows:

[0012] S1, input ultrasound video;

[0013] S2, calculate the motion vector of each pixel in the current frame image; where the i-th pixel s in the current frame image i The motion vector is (fx i , fy i );

[0014] According to the motion vector of each pixel in the current frame image, the motion distance of each pixel in the current frame image is calculated respectively; wherein, the i-th pixel s in the current frame image i Movement distance ds i for:

[0015]

[0016] According to the motion distance of each pixel in the current frame image, the current frame motion image im is obtained; the pixel value im_s of the i-th pixel si in the current frame motion image im i for:

[0017]

[0018] Among them, im_s i Indicates the pixel value of the i-th pixel si in the current frame motion image im, im_si =0 means that the i-th pixel si in the current frame motion image im is a non-motion pixel, im_s i =1 indicates that the i-th pixel si in the current frame motion image im is a moving pixel; thr1 is the set motion distance threshold;

[0019] S3, calculating the current frame scanning speed v according to the pixel value of each pixel point in the current frame motion image im is as follows:

[0020] v=∑ i im_s i ;

[0021] S4, using the calculated current frame scanning speed v, determine the speed level of the current frame scanning speed:

[0022] If the current frame scanning speed v is less than the set scanning speed threshold v1 and greater than or equal to 0, that is, 0≤v<v1, then the current frame scanning speed is determined to be slow; if the current frame scanning speed v is greater than or equal to the set scanning speed threshold v1, that is, v1≤v, then the current frame scanning speed is determined to be fast;

[0023] S5, extracting the ultrasonic scanning area in the current frame image to obtain the total number N of pixels in the ultrasonic scanning area in the current frame image;

[0024] S6, performing binarization processing on the current frame image, counting the number of black pixels in the ultrasonic scanning area after the binarization processing, i.e., the number of pixels with a pixel value of 0, and calculating the ratio p of the number of black pixels to the total number N of pixels in the ultrasonic scanning area, i.e., the black pixel ratio;

[0025] S7: Based on the calculation results of steps S4 and S6, if the black pixel ratio p of the ultrasonic scanning area in the current frame image is less than the set ratio threshold p1, and the current frame scanning speed is slow, that is, 0≤v<v1, then the current frame image is determined to be a valid image, and the process proceeds to step S8. Otherwise, the current frame image is determined to be an invalid image, the frame type of the current frame image is defined as a P / B frame, and the quantization coefficient, that is, the QP value, of the current frame image is increased. Specifically, the QP value of the current frame image is β5, and the ultrasonic image analysis module ends the analysis of the current frame image.

[0026] S8, if the current frame image is a valid image, the current frame image is sent to the tissue structure analysis unit and the lesion analysis unit respectively;

[0027] The tissue structure analysis unit is used to determine whether a predefined important tissue structure appears in the current frame image; if so, it indicates that the current frame image has an important tissue structure; otherwise, it indicates that the current frame image does not have an important tissue structure;

[0028] The lesion analysis unit is used to detect whether there is a lesion in the current frame image;

[0029] S9, if the current frame image contains both important tissue structures and lesions, the frame type of the current frame image is defined as an I frame, and the QP value of the current frame image is reduced, specifically to β1;

[0030] If the current frame image only contains lesions but no important tissue structures, the frame type of the current frame image is defined as an I frame, and the QP value of the current frame image is reduced, specifically to β2;

[0031] If the current frame image only contains important tissue structures without lesions, the frame type of the current frame image is defined as a P / B frame, and the QP value of the current frame image is reduced to β3;

[0032] If there is neither lesion nor important tissue structure in the current frame image, the frame type of the current frame image is defined as a P / B frame, and the QP value of the current frame image is increased, specifically to β4.

[0033] Preferably, β1<β2<β3<βt<β4<β5;

[0034] Wherein, βt is the quantization coefficient set in the traditional coding strategy.

[0035] Preferably, if the frame type of the current frame image is I frame, intra-frame prediction is performed on the current frame image during the video encoding process; if the frame type of the current frame image is P / B, inter-frame prediction is performed on the current frame image during the video encoding process.

[0036] Preferably, the tissue structure analysis unit segments the tissue structure in the current frame image based on the semantic segmentation technology of deep learning to obtain the tissue structure in the current frame image.

[0037] Preferably, the lesion analysis unit detects and classifies lesions in the current frame image based on deep learning detection and classification technology.

[0038] Preferably, in step S2, based on the current frame image and the previous frame image in the ultrasound video, a dense optical flow algorithm is used to calculate the optical flow field between the current frame image and the previous frame image of the ultrasound video to obtain the motion vector of each pixel point in the current frame image.

[0039] Preferably, the motion vector (fx i , fy i ) is calculated as:

[0040] Assume: L is the current frame image, Lr is the reference frame image, i.e. the previous frame image, s iis the pixel point in the current frame image L; sr is the pixel point in the reference frame image Lr that corresponds to the pixel point s i The pixel point with the smallest absolute value of the subtraction of the pixel values is sr, also known as pixel point s i The best matching pixel point; s i * is the pixel s in the reference frame image Lr i Pixels with the same coordinate position;

[0041] The coordinates of pixel point sr are (xr, xr), pixel point s i * The coordinates are (x, y); the coordinates of the pixel point sr are (xr, xr) minus the pixel point s i *The coordinates (x, y) are the pixel s i The motion vector is:

[0042] (fx i , fy i )=(xr-x,yr-y).

[0043] Preferably, in step S5, the ultrasonic scanning area in the current frame image is extracted in the following manner:

[0044] Extracting a current frame motion image and a number of consecutive frames of motion images before the current frame to obtain a segment of motion images;

[0045] Performing a bitwise OR operation on the pixel values of each pixel in the moving image to obtain an image after the operation;

[0046] After the calculation, the pixel points with a pixel value of 1 in the image are the pixels in the ultrasound scanning area.

[0047] Preferably, in step S1, an ultrasound video is input, and the data format of the frame image in the ultrasound video is converted, and the YUV data format is converted into an RGB data format.

[0048] The advantages of the present invention are:

[0049] (1) An ultrasound image analysis module is embedded in the traditional video compression coding strategy to analyze each frame of the ultrasound video. According to the characteristics of the ultrasound image, the frame type and quantization coefficient of each frame of the ultrasound video are dynamically determined, thereby improving the video compression ratio of the ultrasound video while ensuring that valuable information in the ultrasound video can be retained.

[0050] (2) The ultrasound image analysis module of the present invention divides ultrasound images into five categories according to their value, namely: the frame type of valid images with both important tissue structures and lesions is I frame and the QP value is β1, the frame type of valid images with only lesions but no important tissue structures is I frame and the QP value is β2, the frame type of valid images with only important tissue structures but no lesions is P / B frame and the QP value is β3, the frame type of valid images with neither lesions nor important tissue structures is P / B frame and the QP value is β4, and the frame type of invalid images is P / B frame and the QP value is β5. This value category information can not only be used for subsequent video compression, but also provide additional value reference information for other ultrasound AI algorithms.

[0051] (3) Based on the analysis results of the ultrasound image analysis module, the present invention adopts a high compression rate for low-quality video frames containing less valuable information. This not only reduces the compressed file size of the video and reduces the cost of hardware storage, but also reduces the bandwidth consumption during real-time remote transmission of ultrasound video, thereby ensuring the real-time performance of ultrasound video communication.

[0052] (4) The present invention adopts a low compression rate for high-quality video frames containing more valuable information based on the analysis results of the ultrasound image analysis module. This not only preserves the image quality of the high-value video frames to the greatest extent, which is beneficial for restoring information during later patient follow-up, but also preserves the image quality to the greatest extent in remote communication of ultrasound videos. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a flow chart of a method for traditional video compression coding technology.

[0054] Figure 2 This is a flow chart of an ultrasound video compression method of the present invention.

[0055] Figure 3 This is a flow chart of the analysis method of the ultrasonic image analysis module of the present invention. DETAILED DESCRIPTION

[0056] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0057] Traditional video compression technologies, such as H.264, rely on statistical results from images over a period of time. Within adjacent images, the percentage of pixels that differ is typically within 10%, the brightness difference does not vary more than 2%, and the chrominance difference is within 1%. Therefore, for a segment of imagery with minimal changes, a complete frame (the first frame) can be encoded first. The subsequent second frame, instead of encoding the entire image, only contains the differences from the first. This results in the second frame being 1 / 10 the size of a full frame or less. If the third frame after the second frame has minimal changes, the encoding can continue by referencing the second frame. This cycle is called a sequence (a sequence is a segment of data with consistent characteristics). When an image differs significantly from the previous one and cannot be generated by referencing the previous frame, the previous sequence ends and the next begins. This means that a complete image is generated for the first frame of the next segment (the image with the significant changes). The subsequent frames are then generated by referencing the previous frame, only containing the differences from the previous frame.

[0058] The core algorithms used by H264 are intra-frame compression and inter-frame compression.

[0059] Intraframe compression, also known as spatial compression, compresses a single frame, considering only the data within that frame without considering redundant information with adjacent frames. This is similar to static image compression. Intraframe compression typically uses a lossy compression algorithm. Because intraframe compression encodes a complete image, it can be independently decoded and displayed. However, intraframe compression generally does not achieve very high compression rates.

[0060] Interframe compression works on the principle that the data of adjacent frames is highly correlated, or in other words, the information between the previous and next frames changes very little. This means that there is redundant information between consecutive video frames. Based on this characteristic, compressing the redundancy between adjacent frames can further increase the compression rate. Interframe compression, also known as temporal compression, compresses data by comparing the data between different frames on the timeline. Interframe compression is generally lossless. The frame differencing algorithm is a typical temporal compression method that compares the current frame with adjacent frames and only records the difference between the current frame and its adjacent frames.

[0061] like Figure 1 As shown, the traditional video compression coding strategy includes the following steps:

[0062] S11, frame type analysis: Perform motion analysis on the input current frame image (YUV image). If the brightness value of the current frame image changes by more than a certain ratio compared to the previous frame image, the current frame image is determined to be an I frame; otherwise, the current frame image is determined to be a P / B frame.

[0063] S12, if the current frame image is an I frame: first adopt a block strategy to reduce the amount of calculation, then use an intra-frame prediction algorithm to generate a predicted frame, calculate the difference between the input frame and the predicted frame, and input the difference into the DCF conversion module.

[0064] If the current frame image is a P / B frame: first use the block strategy to reduce the amount of calculation, then use the inter-frame prediction algorithm to generate a predicted frame, calculate the difference between the input frame and the predicted frame, and input the difference into the DCF transformation module.

[0065] S13, the DCF transform module, also known as the Fourier transform module, performs a Fourier transform on the input difference, concentrating low-frequency components in the upper left and high-frequency components in the lower right. After the DCF transform, the differential frequency domain result is sparse, which facilitates further compression of the video frame using character encoding strategies.

[0066] S14, Quantization: Define a quantization coefficient, QP, and divide all values in the change block by the QP value, rounding the result. After quantization, low-frequency components are largely preserved, while high-frequency components are partially lost. The larger the QP value, the greater the information loss caused by quantization. A change block refers to the result obtained by taking the difference between the corresponding blocks of the previous and next frames after the image is divided into blocks.

[0067] S15, reordering: After quantization, there will be a small number of large values in the low-frequency and DC regions, a small number of small values in the high-frequency region, and most of the others will be 0. Before encoding, the two-dimensional signal needs to be converted into a one-dimensional signal by using zigzag scanning.

[0068] S16, Entropy coding: Entropy coding is the process of using the statistical characteristics of a signal to perform compression coding. Entropy coding is a lossless compression coding method.

[0069] As can be seen from the traditional video compression coding strategies described above, there are two main factors that influence the size of the encoded video frame: frame type analysis and quantization. Frame type analysis determines the video frame type. I-frames use intra-frame prediction to output a complete video frame, while P / B-frames use inter-frame prediction to output a video frame. Compared to P / B-frames, I-frames are relatively larger and have higher quality. Quantization is a lossy compression method that quantizes the difference between the predicted frame and the input frame. A higher quantization coefficient (QP) value increases the image compression rate, and vice versa.

[0070] The detailed principles and processes of traditional video compression coding strategies can be found in the existing technology, and reference can be made to the H264 compression coding principle, https: / / www.cnblogs.com / linuxAndMcu / p / 14533195.html.

[0071] In the present invention, Figure 2 As shown, an ultrasound image analysis module is embedded in the traditional video compression coding strategy to analyze each frame of the ultrasound video, dynamically determine the frame type and quantization coefficient, i.e., QP value, of each frame of the ultrasound video, and improve the video compression ratio of the ultrasound video while ensuring that valuable information in the ultrasound video can be retained.

[0072] like Figure 3 As shown, the analysis method of the ultrasound image evaluation module is as follows:

[0073] S1, input ultrasound video, convert the data format of the frame image in the ultrasound video, and convert the YUV data format into RGB data format, which is conducive to subsequent algorithm analysis.

[0074] S2, calculate the motion vector of each pixel in the current frame image, specifically: use dense optical flow algorithm to calculate the optical flow field between the two frames before and after the ultrasound video, and obtain the motion vector of each pixel in the current frame image. i The motion vector is (fx i , fy i );

[0075] The dense optical flow algorithm is performed on RGB images and generally uses the classic GunnerFarneback algorithm.

[0076] The motion vector (fx i , fy i ) can be simply understood as:

[0077] Assume: L is the current frame image, Lr is the reference frame image, i.e. the previous frame image, s i is the pixel point in the current frame image L; sr is the pixel point s in the reference frame image Lr and the pixel point s in the current frame image L i The pixel point with the smallest absolute value of the subtraction of the pixel values is sr, which is also called the pixel point s in the current frame image L. i The best matching pixel point; s i * is the pixel s in the reference frame image Lr and the current frame image L i Pixels with the same coordinate position;

[0078] The coordinates of pixel point sr are (xr, xr), pixel point s i * The coordinates are (x, y), the coordinates of the pixel point sr are (xr, xr) minus the pixel point s i *The coordinates (x, y) are the pixel s i The motion vector is:

[0079] (fx i , fy i )=(xr-x,yr-y).

[0080] The detailed calculation method of the motion vector may refer to the Gunner Farneback algorithm in the prior art.

[0081] According to the motion vector of each pixel in the current frame image, the motion distance of each pixel in the current frame image is calculated respectively; wherein, the i-th pixel s in the current frame image i Movement distance ds i for:

[0082]

[0083] If the motion distance of a pixel in the current frame image is greater than or equal to the set motion distance threshold thr1, the pixel is determined to be a moving pixel; otherwise, the pixel is determined to be a non-moving pixel;

[0084] According to the motion distance of each pixel in the current frame image, the current frame motion image im is obtained. The expression is as follows:

[0085]

[0086] Among them, im_s i Indicates the pixel value of the i-th pixel si in the current frame motion image im, im_s i =0 means that the i-th pixel si in the current frame motion image im is a non-motion pixel, im_s i =1 indicates that the i-th pixel si in the current frame motion image im is a moving pixel; thr1 is the set motion distance threshold;

[0087] S3, calculating the current frame scanning speed v according to the pixel value of each pixel point in the current frame motion image im, as shown below:

[0088] v=∑ i im_s i ;

[0089] S4, using the calculated current frame scanning speed v, determine the speed level of the current frame scanning speed:

[0090] If the current frame scanning speed v is less than the set scanning speed threshold v1 and greater than or equal to 0, that is, 0≤v<v1, then the current frame scanning speed is determined to be slow. If the current frame scanning speed v is greater than or equal to the set scanning speed threshold v1, that is, v1≤v, then the current frame scanning speed is determined to be fast. The expression for the speed level of the current frame scanning speed is as follows:

[0091]

[0092] Among them, l v Indicates the speed level of the current frame scan, l v =slow means the current frame scanning speed is slow, l v =fast means the current frame scanning speed is fast;

[0093] The scanning speed threshold v1 is determined by counting manually selected ultrasound images with fast and slow scanning speeds. The specific method is as follows: the scanning speed of each frame of the collected ultrasound video is calculated, and then the scanning speed is traversed from small to large to find a value, i.e., v1, that can distinguish the two image categories with fast and slow scanning speeds as accurately as possible. This method is used to obtain a more stable and reliable scanning speed grade.

[0094] S5, extracting the ultrasonic scanning area in the current frame image to obtain the total number N of pixels in the ultrasonic scanning area in the current frame image.

[0095] The ultrasonic scanning area in the current frame image is extracted as follows: the current frame motion image and several consecutive frames of motion images before the current frame are extracted to obtain a segment of motion images; a bitwise OR operation is performed on the pixel values of each pixel point in the segment of motion images to obtain an image after operation; the pixel points with a pixel value of 1 in the image after operation are the pixels of the ultrasonic scanning area.

[0096] During real-time scanning, the size of the ultrasound scanning area is generally fixed. The entire ultrasound scanning interface, i.e., the ultrasound image, includes a static UI area and a real-time changing ultrasound scanning area. After the dense optical flow algorithm calculates the motion vector of each pixel in the current frame image, the current frame motion image is obtained. In the current frame motion image, the motion distance of the pixels in the UI area is almost zero, while the motion distance of most pixels in the ultrasound scanning area is generally large. Therefore, after binarization of the current frame motion image, the pixel values of the pixels in the UI area will become 0, and the pixel values of most pixels in the ultrasound scanning area will become 1. However, if only one motion image is binarized, it is impossible for all pixels in the ultrasound scanning area to have a binarization result of 1. In a short scanning period, each pixel in the ultrasound scanning area has a probability of moving a large distance.

[0097] Therefore, the present invention extracts the current frame motion image and several consecutive frames of motion images before the current frame to obtain a segment of motion images, and performs a bitwise OR operation on the pixel values of each pixel in the segment of motion images to obtain a post-operation image, thereby finding a stable ultrasonic scanning area. Stability means that the area of the ultrasonic scanning area, that is, the total number of pixels in the ultrasonic scanning area, no longer increases. The OR operation is a binary operation, a or b, indicating that as long as one of a and b is 1, the result is 1. Therefore, performing a bitwise OR operation on a continuous segment of motion images can ensure that as long as the result of a pixel in a certain motion image is 1, the pixel value of the pixel in the post-operation image obtained after the bitwise OR operation is 1, thereby ensuring the integrity of the ultrasonic scanning area. Subsequent contour detection on the post-operation image obtained after the bitwise OR operation is very effective, and the contour of a stable ultrasonic scanning area can be obtained.

[0098] Because the ultrasound scanning area varies in shape depending on the scanning mode, for example, the thyroid and breast scan areas are rectangular, while the abdomen, prenatal examinations, and heart scan areas are sector-shaped. After obtaining a stable ultrasound scanning area, a contour detection algorithm, such as the findContours function in OpenCV, is used to determine the area of the ultrasound scanning area. The area of the ultrasound scanning area is the total number of pixels N in the ultrasound scanning area.

[0099] S6. Calculate the ratio of black and white pixels in the ultrasound scanning area. Specifically, use the binarization process in traditional image processing to binarize the current frame image, change the pixel values of relatively dark pixels in the ultrasound scanning area to 0, and change the pixel values of relatively white pixels to 1. Then, count the number of black pixels in the ultrasound scanning area after the binarization process, that is, the number of pixels with a pixel value of 0. Calculate the ratio p of the number of pixels with a pixel value of 0 to the total number N of pixels in the ultrasound scanning area, that is, the ratio of black pixels. The higher the ratio p, the larger the proportion of relatively dark areas in the ultrasound scanning area. This may be caused by insufficient contact between the ultrasound probe and human skin (the doctor may be switching positions quickly), less coupling agent, or an inappropriate scanning site. In this case, the ultrasound image contains less valuable information, and the compression rate can be appropriately increased.

[0100] S7, according to the calculation results of step S4 and step S6, if the black pixel ratio p of the ultrasonic scanning area in the current frame image is less than the set ratio threshold p1 and the current frame scanning speed is slow, that is, l v =slow, the current frame image is determined to be a valid image and the process proceeds to step S8; otherwise, the current frame image is determined to be an invalid image, the frame type of the current frame image is defined as a P / B frame, and the quantization coefficient of the current frame, i.e., the QP value, is appropriately increased to β5 to improve the compression rate. The ultrasonic image analysis module then ends the analysis of the current frame image.

[0101] S8. If the current frame image is a valid image, the current frame image is sent to the tissue structure analysis unit and the lesion analysis unit respectively.

[0102] The tissue structure analysis unit is mainly based on the semantic segmentation technology of deep learning to segment the tissue structure in the scanned area of the current frame image to obtain the tissue structure in the current frame image, such as blood vessels, organs and other tissue structures; if certain pre-defined important tissue structures appear in the current frame image, such as thyroid tissue, liver tissue, and kidney tissue, and the shape and size of the tissue meet the requirements of the specified part, it means that there is an important tissue structure in the current frame image; otherwise, it means that there is no important tissue structure in the current frame image.

[0103] The lesion analysis unit mainly adopts the detection and classification technology based on deep learning to detect and classify the lesions in the scanning area of the current frame image, such as thyroid nodules, breast nodules, liver cysts, kidney stones and other lesions (each lesion detector requires special data for training, which is not analyzed in detail here, and how to train the lesion detector is not the focus of the present invention); when certain lesions of the patient appear pathological, the doctor will scan back and forth on the lesion section and make a careful diagnosis, so the video frame with lesions needs to retain the original information of the video frame.

[0104] S9, if the current frame image contains both important tissue structures and lesions, the frame type of the current frame image is defined as an I frame, the original information of the video frame is retained, and the QP value of the current frame image is appropriately reduced, specifically to β1;

[0105] If the current frame image only contains lesions but no important tissue structures, the frame type of the current frame image is defined as an I frame, the original information of the video frame is retained, and the QP value of the current frame image is appropriately reduced, specifically to β2;

[0106] If the current frame image only contains important tissue structures without lesions, the frame type of the current frame image is defined as a P / B frame, and the QP value of the current frame image is appropriately reduced, specifically to β3;

[0107] If there is neither lesion nor important tissue structure in the current frame image, the frame type of the current frame image is defined as a P / B frame, and the QP value of the current frame is appropriately increased, specifically to β4, to improve the compression rate;

[0108] Among them, β1<β2<β3<βt<β4<β5;

[0109] βt is the quantization coefficient set in the traditional coding strategy, namely the QP value.

[0110] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for compressing ultrasonic video, characterized in that: An ultrasonic image analysis module is embedded in the traditional video compression and encoding strategy to analyze each frame of the ultrasonic video and dynamically determine the frame type and quantization coefficient, i.e., the QP value, of each frame in the ultrasonic video; The analysis method of the ultrasonic image analysis module is specifically as follows: S1, Input the ultrasonic video; S2, calculate the motion vector of each pixel in the current frame image; where the i-th pixel s in the current frame image i The motion vector is (fx i ,fy i ); According to the motion vector of each pixel in the current frame image, the motion distance of each pixel in the current frame image is calculated respectively; wherein, the i-th pixel s in the current frame image i Movement distance ds i for: According to the motion distance of each pixel in the current frame image, the current frame motion image im is obtained; the pixel value im_s of the i-th pixel si in the current frame motion image im i for: Among them, im_s i Indicates the pixel value of the i-th pixel si in the current frame motion image im, im_s i =0 means that the i-th pixel si in the current frame motion image im is a non-motion pixel, im_s i =1 indicates that the i-th pixel si in the current frame motion image im is a moving pixel; thr1 is the set motion distance threshold; S3, Calculate the current frame scanning speed v according to the pixel values of each pixel point in the current frame moving image im as follows: v=∑ i im_s i ; S4, Use the calculated current frame scanning speed v to determine the fast and slow level of the current frame scanning speed: If the current frame scanning speed v is less than the set scanning speed threshold v1 and greater than or equal to 0, i.e., 0 ≤ v < v1, it is determined that the current frame scanning speed is slow. If the current frame scanning speed v is greater than or equal to the set scanning speed threshold v1, i.e., v1 ≤ v, it is determined that the current frame scanning speed is fast; S5, Extract the ultrasonic scanning area in the current frame image to obtain the total number N of pixel points in the ultrasonic scanning area of the current frame image; S6, Perform binary processing on the current frame image, count the number of black pixel points in the ultrasonic scanning area after binary processing, i.e., the number of pixel points with pixel value 0, and calculate the ratio p of the number of black pixel points to the total number N of pixel points in the ultrasonic scanning area, i.e., the black pixel ratio; S7, According to the calculation results of step S4 and step S6, if the black pixel ratio p of the ultrasonic scanning area in the current frame image is less than the set ratio threshold p1 and the current frame scanning speed is slow, i.e., 0 ≤ v < v1, it is determined that the current frame image is a valid image and enter step S8; otherwise, it is determined that the current frame image is an invalid image, define the frame type of the current frame image as a P / B frame, and increase the quantization coefficient, i.e., the QP value, of the current frame image. The QP value of the current frame image is specifically β5, and the ultrasonic image analysis module ends the analysis of the current frame image; S8, If the current frame image is a valid image, send the current frame image to the tissue structure analysis unit and the lesion analysis unit respectively; The tissue structure analysis unit is used to determine whether a predefined important tissue structure appears in the current frame image; if it appears, it means that there is an important tissue structure in the current frame image; otherwise, it means that there is no important tissue structure in the current frame image; The lesion analysis unit is used to detect whether there is a lesion in the current frame image; S9, If there are both important tissue structures and lesions in the current frame image, define the frame type of the current frame image as an I frame and reduce the QP value of the current frame image, specifically β1; If there is only a lesion and no important tissue structure in the current frame image, define the frame type of the current frame image as an I frame and reduce the QP value of the current frame image, specifically β2; If there is only an important tissue structure and no lesion in the current frame image, define the frame type of the current frame image as a P / B frame and reduce the QP value of the current frame image, specifically β3; If there is neither a lesion nor an important tissue structure in the current frame image, define the frame type of the current frame image as a P / B frame and increase the QP value of the current frame image, specifically β4; In step S5, the extraction method of the ultrasonic scanning area in the current frame image is: Extracting a current frame motion image and a number of consecutive frames of motion images before the current frame to obtain a segment of motion images; Performing a bitwise OR operation on the pixel values of each pixel in the moving image to obtain an image after the operation; After the calculation, the pixel points with a pixel value of 1 in the image are the pixels in the ultrasound scanning area.

2. The ultrasound video compression method according to claim 1, wherein: β1<β2<β3<βt<β4<β5; Wherein, βt is the quantization coefficient set in the traditional coding strategy.

3. The ultrasonic video compression method according to claim 1, wherein: If the frame type of the current frame image is I frame, intra-frame prediction is performed on the current frame image during the video encoding process; if the frame type of the current frame image is P / B, inter-frame prediction is performed on the current frame image during the video encoding process.

4. The ultrasonic video compression method according to claim 1, wherein: The tissue structure analysis unit segments the tissue structure in the current frame image based on the semantic segmentation technology of deep learning to obtain the tissue structure in the current frame image.

5. The ultrasonic video compression method according to claim 1, wherein: The lesion analysis unit detects and classifies lesions in the current frame image based on deep learning detection and classification technology.

6. The ultrasound video compression method according to claim 1, wherein: In step S2, based on the current frame image and the previous frame image in the ultrasound video, a dense optical flow algorithm is used to calculate the optical flow field between the current frame image and the previous frame image of the ultrasound video to obtain the motion vector of each pixel point in the current frame image.

7. The ultrasonic video compression method according to claim 6, characterized in that: The motion vector (fx i ,fy i ) is calculated as: Assume: L is the current frame image, Lr is the reference frame image, i.e. the previous frame image, s i is the pixel point in the current frame image L; sr is the pixel point in the reference frame image Lr that corresponds to the pixel point s i The pixel point with the smallest absolute value of the subtraction of the pixel values is sr, also known as pixel point s i The best matching pixel point; s i * is the pixel s in the reference frame image Lr i Pixels with the same coordinate position; The coordinates of pixel point sr are (xr, xr), pixel point s i *The coordinates are (x,y); the coordinates of pixel point sr are (xr,xr) minus the coordinates of pixel point s i *The coordinates (x, y) are the pixel s i The motion vector is: (fx i , my i )=(xr-x,yr-y)。 8. The ultrasound video compression method according to claim 1, wherein: Step S1: input an ultrasound video, convert the data format of the frame image in the ultrasound video, and convert the YUV data format into RGB data format.

Citation Information

Patent Citations

  • Ultrasound image / ultrasound video transmission method and device

    CN104055534A

  • Ultrasonic data processing method and device and computer readable storage medium

    CN114758287A