Wide-scene image playback method and device, computer equipment and storage medium
By calculating and storing the spatial transformation matrix of ultrasound images, a wide-view coordinate system is established to directly splice images, which solves the problems of low ultrasonic wide-view imaging playback efficiency and inconsistent results in the existing technology, and improves diagnostic efficiency and accuracy.
Patent Information
- Application Number
- CN202410745687.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-08-23
AI Technical Summary
The existing ultrasonic wide-view imaging playback method is inefficient, resulting in differences in the results of multiple image playbacks, affecting the efficiency and accuracy of doctors' diagnosis.
By calculating the spatial transformation matrix of each frame image relative to the reference frame, and storing all frame images in the target scanning area and the corresponding spatial transformation matrix, a wide-view coordinate system is established, and the images are directly spliced to improve playback efficiency and ensure consistent results.
It improves the efficiency of image playback and diagnosis, ensures the accuracy and consistency of multiple playback results, and reduces registration errors caused by useless information.
Smart Images

Figure CN118537217A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wide-view imaging, and in particular to a wide-view image playback method, device, computer equipment and storage medium. Background Art
[0002] Ultrasonic wide-view imaging is to obtain a series of two-dimensional grayscale or blood flow section images by moving the probe of the image acquisition device, and then store the obtained series of two-dimensional images separately. When doctors diagnose diseases through ultrasonic wide-view imaging playback, they need to first use computer reconstruction methods to calculate and estimate the matching splicing relationship between two frames of images, and then use the calculated matching splicing relationship to splice a series of two-dimensional images into a continuous section image for display. If doctors need to replay images for diagnosis multiple times, the existing image playback method greatly reduces the efficiency of image playback, affecting the efficiency of doctors' diagnosis, and may cause differences in the results of multiple image playbacks because the matching splicing relationship between images needs to be calculated each time the image is played back, affecting the accuracy of doctors' diagnosis. Summary of the invention
[0003] In view of this, the present invention provides a wide-view image playback method, apparatus, computer device and storage medium to solve the problem that the existing image playback method greatly reduces the efficiency of image playback and may result in differences in multiple image playback results.
[0004] In a first aspect, the present invention provides a method for replaying a wide-view image, the method comprising: acquiring a current frame image, and calculating a spatial transformation matrix of the current frame image relative to a reference frame image, the reference frame being a previous frame image compared to the current frame; storing the current frame image and the corresponding spatial transformation matrix, and repeating the step of acquiring the current frame image until all frame images and the corresponding spatial transformation matrix of a target scanning area are stored; establishing a wide-view coordinate system using the first frame image in the stored target scanning area as the origin of the coordinate system; and superimposing all frame images of the target scanning area except the first frame image into the wide-view coordinate system based on the corresponding spatial transformation matrix to obtain a wide-view image corresponding to the target scanning area.
[0005] The wide-view image playback method provided in this embodiment calculates the spatial transformation matrix of each frame image relative to the reference frame image, and stores all frame images of the target scanning area and the corresponding spatial transformation matrix. When the user wants to play back the wide-view image of the target scanning area, all frame images of the target scanning area and the corresponding spatial transformation matrix can be obtained from the memory area, and the wide-view coordinate system is established with the first frame image as the origin of the coordinate system. Finally, all frame images are sequentially superimposed on the wide-view coordinate system based on their corresponding spatial transformation matrices to obtain the wide-view image. The present invention can complete the splicing between the frame images directly based on the spatial transformation matrix, which not only improves the efficiency of image playback, but also ensures that the playback results of multiple wide-view images are consistent, thereby improving the efficiency and accuracy of doctors' diagnosis.
[0006] In an optional embodiment, before calculating the spatial transformation matrix of the current frame image relative to the reference frame image, the method further includes: dividing the current frame image into a first depth area and a second depth area based on a distance threshold from the image collector to each pixel in the current frame image, the distance from the pixel in the first depth area to the image collector being greater than the distance from the pixel in the second depth area to the image collector; calculating a first average and a first standard deviation of the grayscale values of all pixels in the first depth area and a second average and a second standard deviation of the grayscale values of all pixels in the second depth area; calculating a first difference between the first average and the second average and a second difference between the first standard deviation and the second standard deviation; if both the first difference and the second difference are less than a preset difference threshold, determining that the current frame image is valid, and executing the step of calculating the spatial transformation matrix of the current frame image relative to the reference frame image.
[0007] The present invention ensures the accuracy of the generated wide-view image by determining low-quality images caused by imaging techniques or poor probe contact and discarding them.
[0008] In an optional embodiment, the calculation of the spatial transformation matrix of the current frame image relative to the reference frame image includes: extracting feature points of the current frame image; matching the feature points of the current frame image with the feature points of the reference frame image to determine mutually matching feature point pairs; and calculating the spatial transformation matrix of the current frame image relative to the reference frame image based on the mutually matching feature point pairs.
[0009] The present invention extracts feature points of images, matches feature points between two images, determines mutually matching feature point pairs, and calculates the spatial transformation matrix of the current frame image relative to the reference frame image based on the feature point pairs. The extracted features can match images more efficiently and can reduce the registration error caused by useless information. Only feature point information is needed to calculate the spatial transformation matrix, which can reduce the amount of calculation and improve efficiency, and can have a certain degree of robustness to changes in image grayscale.
[0010] In an optional embodiment, the extracting feature points of the current frame image includes: downsampling the current frame image to obtain an image to be processed; extracting feature points in the image to be processed using a feature extraction algorithm; and upsampling the feature points in the image to be processed to obtain feature points of the current frame image.
[0011] The present invention first performs downsampling processing on the current frame image and then extracts feature points through a feature extraction algorithm, which can effectively reduce the amount of calculation and time.
[0012] In an optional embodiment, the feature point matching of the feature points of the current frame image with the feature points of the reference frame image to determine a pair of matching feature points includes: traversing all feature points on the reference frame image and the current frame image, and generating a feature descriptor corresponding to the current feature point based on image information of the current feature point and neighborhood feature points around the current feature point; calculating the distance between the feature descriptor corresponding to the target feature point on the reference frame image and all feature descriptors on the current frame image; and selecting a feature point on the current frame image that is closest to the feature descriptor corresponding to the target feature point as a feature point that matches the target feature point.
[0013] The present invention can improve the precision and accuracy of feature matching by calculating the distance between each pair of feature descriptors between two frames of images and selecting two feature points with the closest distance as mutually matching feature point pairs, thereby improving the accuracy of wide-view image stitching.
[0014] In an optional implementation, the method further includes: writing the spatial transformation matrix corresponding to each frame image into a page header of the corresponding frame image, and storing each frame image and the page header in which the spatial transformation matrix is written into a memory area.
[0015] The present invention writes the spatial transformation matrix corresponding to each frame image into the page header of the frame image, and stores the frame image and the page header written with the spatial transformation matrix into a memory area, so that when all frame images are subsequently acquired, they can be clearly and directly superimposed into the coordinate system according to the spatial transformation matrix.
[0016] In an optional embodiment, after all frame images of the target scanning area except the first frame image are superimposed on the wide-view coordinate system based on the corresponding spatial transformation matrix, the method further includes: fusing the overlapping area after the current frame image is superimposed with the previous frame image using a linear interpolation method.
[0017] In the present invention, the probe will slowly move to one side during real-time ultrasonic scanning, resulting in a large overlap area when the image moves from the current frame to the next frame. The overlapping part is fused by a linear interpolation method to ensure a smooth transition between the two frames of image.
[0018] In a second aspect, the present invention provides a wide-view image playback device, the device comprising: a change matrix calculation module, used to obtain a current frame image, and calculate the spatial transformation matrix of the current frame image relative to a reference frame image, the reference frame being the previous frame image compared to the current frame; an image storage module, used to store the current frame image and the corresponding spatial transformation matrix, and repeat the step of obtaining the current frame image until all frame images and the corresponding spatial transformation matrix of the target scanning area are stored; a coordinate system establishment module, used to establish a wide-view coordinate system using the first frame image in the stored target scanning area as the origin of the coordinate system; an image stitching module, used to superimpose all frame images of the target scanning area except the first frame image into the wide-view coordinate system based on the corresponding spatial transformation matrix, to obtain a wide-view image corresponding to the target scanning area.
[0019] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the wide-view image playback method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0020] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the wide-view image playback method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 is a schematic flow chart of a method for replaying a wide-view image according to an embodiment of the present invention;
[0023] Figure 2 is an example diagram of selecting a reference frame according to an embodiment of the present invention;
[0024] Figure 3 is a flow chart of another method for replaying a wide-view image according to an embodiment of the present invention;
[0025] Figure 4 is an example diagram of calculating feature point matching of a current frame image relative to a reference frame image according to an embodiment of the present invention;
[0026] Figure 5 is a diagram showing an example of a spatial transformation matrix according to an embodiment of the present invention;
[0027] Figure 6 is an example diagram of an overlapping portion between two frames of images according to an embodiment of the present invention;
[0028] Figure 7 is an example diagram of a process for playback of a wide-view image according to an embodiment of the present invention;
[0029] Figure 8 is a structural block diagram of a wide-view image playback device according to an embodiment of the present invention;
[0030] Fig. 9 is a structural block diagram of another wide-view image playback device according to an embodiment of the present invention;
[0031] Fig.10 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0033] Wide-view imaging, also known as ultra-wide field of view imaging technology, panoramic ultrasound imaging (Panoramic Imaging), extended field of view imaging (Extended Field of View Ultrasound), SieScape Image, FreeStyle extendedImaging, Wide-View Panoramic Imaging. Ultrasound wide-view imaging technology simply means obtaining a series of two-dimensional grayscale or blood flow section images by moving the probe, and then using computer reconstruction methods to stitch this series of two-dimensional images into a continuous section image. During real-time ultrasound scanning, the probe moves slowly to one side, and there is a large overlap area from one frame to the next. There are both very similar and different features between the two frames. By comparing the subtle differences between the two frames of images, the movement of the probe from one frame to another is accurately estimated by calculating the vector change, and then these images are recorded and displayed frame by frame to obtain a panoramic image of the entire scanning area.
[0034] Wide-view stitching is mainly used for clinical image display with a larger field of view to make up for the limitation of the probe's narrow field of view when scanning horizontally. Wide-view stitching technology is relatively mature, and the present invention proposes a method for fast storage and playback of the wide-view stitching process.
[0035] According to an embodiment of the present invention, a method embodiment of a wide-view image playback is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0036] In this embodiment, a method for replaying a wide-view image is provided, which can be used in the above-mentioned computer device. Figure 1 is a flow chart of a method for replaying a wide-view image according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0037] Step S101, obtaining a current frame image, and calculating a spatial transformation matrix of the current frame image relative to a reference frame image.
[0038] The reference frame is an image frame previous to the current frame.
[0039] In the embodiment of the present invention, a series of frame images on the scanning area are acquired by moving an image acquisition device such as an ultrasound probe. When scanning the first frame image, there is no reference frame, so the spatial transformation matrix of the first frame image may not be calculated. When scanning to obtain the second frame image, the first frame image may be used as a reference frame image to calculate the spatial transformation matrix between the first frame image and the second frame image, such as Figure 2As shown, after obtaining the first frame image and the second frame image, the two images can be spliced to obtain a spliced image. After scanning to obtain the current frame image, the latest spliced frame image, which is equivalent to the previous frame image of the current frame, can be captured from the spliced image as a reference frame, and the spatial transformation matrix of the current frame relative to the reference frame is calculated. There is no limitation on the method for calculating the spatial transformation matrix between the two frames of images. For example, the image sensor can be controlled to establish a global coordinate system when scanning begins, and the image sensor can be controlled to scan the scanning area and obtain the position coordinates of each frame image relative to the global coordinate system. That is, the spatial transformation matrix of the current frame image and the reference frame image can be calculated based on the position coordinates of the current frame image and the position coordinates of the reference frame image. This is just an example.
[0040] Step S102, storing the current frame image and the corresponding space transformation matrix, and repeating the step of obtaining the current frame image until all frame images and the corresponding space transformation matrices of the target scanning area are stored.
[0041] The embodiment of the present invention can store the current frame obtained by scanning and the spatial transformation matrix relative to the previous frame into the memory area, and continue to obtain the next frame image and calculate the spatial transformation matrix corresponding to the next frame until the image acquisition device completes scanning the target scanning area and stores all frame images and corresponding spatial transformation matrices in the target scanning area.
[0042] Step S103: establishing a wide-view coordinate system by taking the first frame image in the stored target scanning area as the origin of the coordinate system.
[0043] The embodiment of the present invention responds to the wide-view image playback instruction of the target scanning area operated by the doctor or other medical staff, and can obtain all frame images and spatial transformation matrices corresponding to the target scanning area from the memory area. Because the first frame image does not have a corresponding spatial transformation matrix, the first frame image can be used as the origin of the coordinate system, wherein the center point of the first frame image can be set as the origin of the coordinate system, or the lower left corner of the first frame image can be set as the origin of the coordinate system, which is only for example and not limited, and a wide-view coordinate system is established based on the set coordinate system origin.
[0044] Step S104 : superimpose all frame images of the target scanning area except the first frame image into the wide-view coordinate system based on the corresponding space transformation matrix to obtain a wide-view image corresponding to the target scanning area.
[0045] The embodiment of the present invention fuses all frame images except the first frame image in the target scanning area into the wide-view coordinate system based on the corresponding spatial transformation matrix, that is, the spatial transformation matrix of the second frame image relative to the first frame image is superimposed on the wide-view coordinate system, and the spatial transformation matrix of the subsequent frame images to be registered relative to the previous frame image is superimposed on the wide-view coordinate system in sequence to generate a complete wide-view image, and a ruler corresponding to the complete wide-view image can be generated, that is, the length of the wide-view image after stitching is completed.
[0046] The wide-view image playback method provided in this embodiment calculates the spatial transformation matrix of each frame image relative to the reference frame image, and stores all frame images of the target scanning area and the corresponding spatial transformation matrix. When the user wants to play back the wide-view image of the target scanning area, all frame images of the target scanning area and the corresponding spatial transformation matrix can be obtained from the memory area, and the wide-view coordinate system is established with the first frame image as the origin of the coordinate system. Finally, all frame images are sequentially superimposed on the wide-view coordinate system based on their corresponding spatial transformation matrices to obtain the wide-view image. The present invention can complete the splicing between the frame images directly based on the spatial transformation matrix, which not only improves the efficiency of image playback, but also ensures that the playback results of multiple wide-view images are consistent, thereby improving the efficiency and accuracy of doctors' diagnosis.
[0047] In this embodiment, a method for replaying a wide-view image is provided, which can be used in the above-mentioned computer device. Figure 3 is a flow chart of a method for replaying a wide-view image according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0048] Step S301, obtaining the current frame image, dividing the current frame image into a first depth area and a second depth area based on a distance threshold from the image collector to each pixel in the current frame image, wherein the distance from the pixel in the first depth area to the image collector is greater than the distance from the pixel in the second depth area to the image collector; calculating a first average value and a first standard deviation of the grayscale values of all pixels in the first depth area and a second average value and a second standard deviation of the grayscale values of all pixels in the second depth area; calculating a first difference between the first average value and the second average value and a second difference between the first standard deviation and the second standard deviation; if both the first difference and the second difference are less than a preset difference threshold, determining that the current frame image is valid.
[0049] After obtaining the current frame image, the embodiment of the present invention can verify the frame image, and can determine in advance the distance threshold between the image collector, i.e., the probe, and the image based on the current frame image, and divide the current frame image into a deeper depth area and a shallower depth area based on the set distance threshold, and count the grayscale values of all pixels in the deeper depth area, and calculate the first average value and the first standard deviation of the grayscale values of all pixels, and then count the grayscale values of all pixels in the shallower depth area, and calculate the second average value and the second standard deviation of the grayscale values of all pixels in the shallower depth area, and finally determine whether the difference between the first average value and the second average value is greater than a certain difference threshold, and whether the difference between the first standard deviation and the second standard deviation is greater than a certain difference threshold, wherein the setting values of the two certain difference thresholds are not limited, and can be set according to the accuracy requirements of the image, and if you want to improve the accuracy of the scanned image, you can set a smaller difference threshold, just as an example. If the difference between the first average value and the second average value and the difference between the first standard deviation and the second standard deviation are not greater than the corresponding difference thresholds, it can be determined that the current frame image is valid. If any one of the following conditions is satisfied: the difference between the first average value and the second average value is greater than the difference threshold and the difference between the first standard deviation and the second standard deviation is greater than the difference threshold, it can be determined as a low-quality image caused by mapping techniques or poor probe contact and it will be discarded and ignored to ensure the accuracy of the generated wide-view image.
[0050] Step S302, calculating the spatial transformation matrix of the current frame image relative to the reference frame image.
[0051] The reference frame is an image frame previous to the current frame.
[0052] Specifically, the above step S302 includes:
[0053] Step S3021, extracting feature points of the current frame image.
[0054] The embodiment of the present invention can extract feature points of the current frame image through a feature detection algorithm, wherein the feature detection algorithm includes but is not limited to feature detection algorithms such as Scale Invariant Feature Transform (SIFT) and Oriented FAST and Rotated BRIEF (ORB). Feature points are generally representative parts of the frame image, such as special places in the image, corners, edges and blocks. The same area can be found in different images. In the same image, the pixel values are quite different from those of the surrounding points. The number of feature points is much smaller than the number of pixels. This is just an example.
[0055] Specifically, the current frame image is downsampled to obtain the image to be processed; the feature points in the image to be processed are extracted using a feature extraction algorithm; and the feature points in the image to be processed are upsampled to obtain the feature points of the current frame image.
[0056] like Figure 4 As shown, the embodiment of the present invention can downsample the current frame image, that is, compress the current frame image by a multiple. For example, the size of the current frame image is M*N, and the current frame image can be downsampled by W times. Then, the size of the image to be processed after the downsampling is (M / W)*(N / W), which is just an example. Then, feature points are extracted from the image to be processed using a feature extraction algorithm, thereby saving cache resources. The feature extraction algorithm used in the present invention takes the ORB algorithm as an example. The ORB algorithm is implemented based on FAST feature detection and BRIEF feature descriptor matching. Its greatest advantage is that the feature extraction speed is fast, which can improve the efficiency of calculating the transformation matrix between frame images, and intercept the processing area of the image to be processed for feature point area, wherein the intercepted area is generally the central part of the image, and the size of the interception can be adjusted by parameters without limitation. The FAST feature extraction algorithm is used to quickly extract the feature information of the intercepted processing area, and the corresponding template information can be generated using the feature point as the center. The template information includes but is not limited to the feature point and the image information of the feature points in the neighborhood around the feature point. Then, the extracted feature point, the image information of the feature point and the image information of the feature points in the neighborhood can be upsampled and restored to the original resolution, which is only taken as an example.
[0057] Step S3022, feature point matching is performed on the feature points of the current frame image and the feature points of the reference frame image to determine mutually matching feature point pairs.
[0058] The embodiments of the present invention can match the feature points of the current frame image with the feature points of the reference frame image through a template matching method to determine a pair of feature points that match each other. Feature matching methods such as brute force matching, cross matching or nearest neighbor matching can be used to perform feature matching on the feature points of the current frame image with the feature points of the reference frame image. The BRIEF algorithm is used to generate a feature descriptor corresponding to each feature point. A feature descriptor of the current frame image can be arbitrarily selected to calculate the distance from the feature descriptor to all feature descriptors in the reference frame image. The distance can be the Euclidean distance or the Hamming distance. The obtained distances are then sorted. Finally, the feature point with the shortest distance can be selected and determined as a pair of feature points that match each other with the feature point of the current frame image. This is just an example.
[0059] Specifically, all feature points on the reference frame image and the current frame image are traversed, and a feature descriptor corresponding to the current feature point is generated based on the image information of the current feature point and the neighborhood feature points around the current feature point; the distance between the feature descriptor corresponding to the target feature point on the reference frame image and all feature descriptors on the current frame image is calculated; and the feature point on the current frame image that is closest to the feature descriptor corresponding to the target feature point is selected as the feature point that matches the target feature point.
[0060] In an embodiment of the present invention, the BRIEF algorithm can be used to traverse the feature points on the current frame image and the reference frame image, randomly select feature point pairs in the surrounding area, and compare the pixel values and the positions, directions and scales between the feature points to generate feature point descriptors. Then, the Hamming distances between the feature descriptors corresponding to the target feature points on the reference frame image and all the feature descriptors on the current frame image are calculated, and the feature point with the smallest Hamming distance is taken as the feature point that matches the target feature point, for example only.
[0061] Step S3023: Calculate the spatial transformation matrix of the current frame image relative to the reference frame image based on the matched feature point pairs.
[0062] In the embodiment of the present invention, the template matching method can be used to match the spatial transformation matrix of the current frame image relative to the reference frame image, determine the relative position relationship of the mutually matching feature point pairs, and the relative position relationship between the two can be regarded as the coordinate transformation between two two-dimensional point sets, calculate the similarity transformation coefficients between the feature point pairs, and use rotation, translation and scaling to represent the spatial transformation relationship between the two frame images, so as to obtain Figure 5 The spatial transformation matrix of the current frame image relative to the reference frame image is shown only as an example.
[0063] In one embodiment, the space transformation matrix corresponding to each frame image is written into the page header of the corresponding frame image, and each frame image and the page header in which the space transformation matrix is written are stored in a memory area.
[0064] In order to match the transformation matrix with the frame image one by one, the embodiment of the present invention can write the spatial transformation matrix corresponding to each frame image into the page header of the corresponding frame image, and each frame image and the page header in which the spatial transformation matrix is written can be stored in the memory area, as an example only.
[0065] Step S303: Use the first frame image in the stored target scanning area as the origin of the coordinate system to establish a wide-view coordinate system. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0066] Step S304: superimpose all frame images of the target scanning area except the first frame image into the wide-view coordinate system based on the corresponding space transformation matrix to obtain a wide-view image corresponding to the target scanning area. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0067] In one embodiment, the overlapping area after the current frame image is superimposed with the previous frame image is fused using a linear interpolation method.
[0068] Because the probe will slowly move to one side during real-time ultrasound scanning, resulting in a large overlap area when the image moves from the current frame to the next frame, the embodiment of the present invention can superimpose all frames on the wide-view coordinate system, and then fuse the current frame image and the previous frame image according to a certain ratio for the overlapping part through a linear interpolation method, and the linear interpolation method is not limited. For example, the quadratic linear interpolation method, the bicubic interpolation method, and the average value method are commonly used image difference algorithms, such as Figure 6 As shown, the fusion part closer to zero corresponds to a larger proportion of the reference frame image when fusion is performed, and the fusion part closer to 1 corresponds to a larger proportion of the current frame image when fusion is performed, which is only for example.
[0069] In a specific embodiment, Figure 7 As shown, multiple frames of grayscale two-dimensional images are acquired through an ultrasonic probe, and the images are checked for validity, valid two-dimensional images are screened and retained, and feature points of the reference frame image and the current frame image are extracted, and feature points of the current frame image and the reference frame image are matched to generate mutually matching feature point pairs, and the spatial transformation matrix of the current frame image relative to the reference frame image is calculated based on the mutually matching feature point pairs, until all frame images of the target scanning area and the corresponding spatial transformation matrices are obtained.
[0070] After responding to the user's command to play back the wide-view image of the target scanning area, all frame images and the corresponding space transformation matrix of the target scanning area are obtained, and the lower left corner of the first frame image is used as the origin of the coordinate system to establish a wide-view coordinate system, and then based on the corresponding space transformation matrix, all frame images are fused and superimposed on the wide-view coordinate system to generate a complete wide-view stitched image, and a ruler corresponding to the wide-view stitched image can be generated to describe the length of the wide-view stitched image. For detailed description, please refer to the above embodiment, which will not be repeated here.
[0071] In this embodiment, a wide-view image playback device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0072] This embodiment provides a wide-view image playback device, such as Figure 8 As shown, it includes: a change matrix calculation module 801, which is used to obtain a current frame image and calculate the spatial transformation matrix of the current frame image relative to a reference frame image, where the reference frame is an image previous to the current frame; an image storage module 802, which is used to store the current frame image and the corresponding spatial transformation matrix, and repeat the step of obtaining the current frame image until all frame images and the corresponding spatial transformation matrix of the target scanning area are stored; a coordinate system establishment module 803, which is used to establish a wide-view coordinate system by taking the first frame image in the stored target scanning area as the origin of the coordinate system; and an image stitching module 804, which is used to superimpose all frame images of the target scanning area except the first frame image into the wide-view coordinate system based on the corresponding spatial transformation matrix to obtain a wide-view image corresponding to the target scanning area.
[0073] In some optional embodiments, such as Fig. 9 As shown, before calculating the spatial transformation matrix of the current frame image relative to the reference frame image, the wide-view image playback device further includes: a depth division module, which is used to divide the current frame image into a first depth area and a second depth area based on a distance threshold from the image collector to each pixel in the current frame image, wherein the distance from the pixel in the first depth area to the image collector is greater than the distance from the pixel in the second depth area to the image collector; a gray value calculation module, which is used to calculate a first average value and a first standard deviation of the gray values of all pixels in the first depth area and a second average value and a second standard deviation of the gray values of all pixels in the second depth area; a difference calculation module, which is used to calculate a first difference between the first average value and the second average value and a second difference between the first standard deviation and the second standard deviation; and an image validity judgment module, which is used to determine that the current frame image is valid if both the first difference and the second difference are less than a preset difference threshold, and execute the step of calculating the spatial transformation matrix of the current frame image relative to the reference frame image.
[0074] In some optional embodiments, the change matrix calculation module 902 includes: a feature point extraction unit, used to extract feature points of the current frame image; a feature matching unit, used to match the feature points of the current frame image with the feature points of the reference frame image to determine mutually matching feature point pairs; a transformation matrix calculation unit, used to calculate the spatial transformation matrix of the current frame image relative to the reference frame image based on the mutually matching feature point pairs.
[0075] In some optional embodiments, the feature point extraction unit includes: a downsampling processing subunit, which is used to downsample the current frame image to obtain an image to be processed; a feature extraction subunit, which is used to extract feature points in the image to be processed using a feature extraction algorithm; and an upsampling processing subunit, which is used to upsample the feature points in the image to be processed to obtain feature points of the current frame image.
[0076] In some optional embodiments, the feature matching unit includes: a feature descriptor generation subunit, which is used to traverse all feature points on the reference frame image and the current frame image, and generate a feature descriptor corresponding to the current feature point based on the image information of the current feature point and the neighborhood feature points around the current feature point; a descriptor distance calculation subunit, which is used to calculate the distance between the feature descriptor corresponding to the target feature point on the reference frame image and all feature descriptors on the current frame image; and a feature matching subunit, which is used to select the feature point on the current frame image that is closest to the feature descriptor corresponding to the target feature point as the feature point that matches the target feature point.
[0077] In some optional embodiments, the wide-view image playback device further includes: a header storage module for writing the space transformation matrix corresponding to each frame image into the header of the corresponding frame image, and storing each frame image and the header written with the space transformation matrix into a memory area.
[0078] In some optional implementations, the wide-view image playback device further includes: an image fusion module, configured to fuse the overlapping area of the current frame image and the previous frame image by using a linear interpolation method.
[0079] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0080] The wide-view image playback device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0081] The embodiment of the present invention also provides a computer device having the above Figure 8 or Fig. 9 The wide-view image playback device shown.
[0082] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.10As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 10 is taken as an example.
[0083] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0084] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0085] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0086] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0087] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0088] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0089] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0090] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0091] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for replaying a wide-view image, characterized in that: The method comprises: Obtaining a current frame image, and calculating a spatial transformation matrix of the current frame image relative to a reference frame image, wherein the reference frame is a previous frame image compared to the current frame; The current frame image and the corresponding space transformation matrix are stored, and the step of obtaining the current frame image is repeated until all frame images and the corresponding space transformation matrices of the target scanning area are stored; Establishing a wide-view coordinate system by taking the first frame image in the stored target scanning area as the origin of the coordinate system; All frame images of the target scanning area except the first frame image are superimposed on the wide-view coordinate system based on the corresponding space transformation matrix to obtain a wide-view image corresponding to the target scanning area.
2. The method according to claim 1, characterized in that Before calculating the spatial transformation matrix of the current frame image relative to the reference frame image, the method further includes: Based on a distance threshold from the image collector to each pixel in the current frame image, the current frame image is divided into a first depth region and a second depth region, wherein the distance from the pixel in the first depth region to the image collector is greater than the distance from the pixel in the second depth region to the image collector; Calculating a first average value and a first standard deviation of the grayscale values of all pixels in the first depth region and a second average value and a second standard deviation of the grayscale values of all pixels in the second depth region; Calculate a first difference between the first average and the second average and a second difference between the first standard deviation and the second standard deviation; If both the first difference and the second difference are smaller than the preset difference threshold, the current frame image is determined to be valid, and the step of calculating the spatial transformation matrix of the current frame image relative to the reference frame image is performed.
3. The method according to claim 1, characterized in that The calculating of the spatial transformation matrix of the current frame image relative to the reference frame image includes: Extracting feature points of the current frame image; Performing feature point matching on the feature points of the current frame image and the feature points of the reference frame image to determine mutually matching feature point pairs; The spatial transformation matrix of the current frame image relative to the reference frame image is calculated based on the mutually matched feature point pairs.
4. The method according to claim 1, characterized in that: The extracting feature points of the current frame image includes: Performing downsampling processing on the current frame image to obtain an image to be processed; Extracting feature points in the image to be processed using a feature extraction algorithm; Upsampling is performed on the feature points in the image to be processed to obtain feature points of the current frame image.
5. The method according to claim 3, characterized in that: The step of matching the feature points of the current frame image with the feature points of the reference frame image to determine a pair of feature points that match each other includes: Traversing all feature points on the reference frame image and the current frame image, generating a feature descriptor corresponding to the current feature point based on image information of the current feature point and feature points in the neighborhood of the current feature point; Calculate the distance between the feature descriptor corresponding to the target feature point on the reference frame image and all feature descriptors on the current frame image; A feature point on the current frame image that is closest to the feature descriptor corresponding to the target feature point is selected as a feature point that matches the target feature point.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The space transformation matrix corresponding to each frame image is written into the page header of the corresponding frame image, and each frame image and the page header into which the space transformation matrix is written are stored in the memory area.
7. The method according to claim 1, characterized in that After all frame images of the target scanning area except the first frame image are superimposed on the wide-view coordinate system based on corresponding space transformation matrices, the method further includes: The overlapping area after the current frame image is superimposed with the previous frame image is fused using the linear interpolation method.
8. A wide-view image playback device, characterized in that: The device comprises: A change matrix calculation module, used to obtain a current frame image and calculate a spatial transformation matrix of the current frame image relative to a reference frame image, wherein the reference frame is a previous frame image compared to the current frame; An image storage module is used to store the current frame image and the corresponding space transformation matrix, and repeat the step of obtaining the current frame image until all frame images and the corresponding space transformation matrix of the target scanning area are stored; A coordinate system establishment module, used to establish a wide-view coordinate system by taking the first frame image in the stored target scanning area as the origin of the coordinate system; The image stitching module is used to superimpose all frame images of the target scanning area except the first frame image into the wide-view coordinate system based on the corresponding space transformation matrix to obtain a wide-view image corresponding to the target scanning area.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the wide-view image playback method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the wide-view image playback method according to any one of claims 1 to 7.
