Iterative foreground segmentation method and device based on noise field transformation and storage medium
Through an iterative foreground segmentation method based on noise field transformation, the foreground area in the image is updated using the noise estimation field, which solves the problem of inaccurate segmentation of the foreground area in the image, achieving higher segmentation accuracy and meeting the needs of medical image processing.
Patent Information
- Application Number
- CN202311459533.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2025-05-06
AI Technical Summary
The problem of inaccurate segmentation of foreground areas in the prior art in images, especially in images with low signal-to-noise ratios, it is easy to ignore the low signal-to-noise ratio areas in the foreground, resulting in false negatives and segmentation results that do not meet the needs of medical image processing.
The iterative foreground segmentation method based on noise field transformation is adopted. By obtaining the image to be segmented, the foreground segmentation is iteratively performed, and the pixel value distribution of the foreground area is updated using the noise estimation field, and the accuracy of segmentation is gradually improved.
It is possible to more accurately segment the foreground area containing low signal-to-noise ratio areas in the image, solve the problem of the global solution of the foreground segmentation problem in the prior art, and improve the accuracy of the segmentation result.
Smart Images

Figure CN119941775A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an iterative foreground segmentation method, device, computer equipment, storage medium and computer program product based on noise field transformation. Background Art
[0002] Foreground segmentation is one of the important issues in image processing. Based on traditional image processing methods, common foreground segmentation methods include threshold segmentation, graph segmentation, clustering, etc.
[0003] In related technologies, the OTUS algorithm (maximum inter-class variance method) is often used for image threshold processing. It uses the maximization of inter-class variance to globally find the optimal threshold. For example, finding the threshold in the histogram of the image can globally divide the image into two categories: foreground and background. However, in images with too low signal-to-noise ratio, the pixel intensities of some foregrounds and backgrounds are close, and the threshold often appears between areas with good foreground signal-to-noise ratio and areas with poor foreground signal-to-noise ratio. The segmentation results of the OTSU automated threshold often ignore these low signal-to-noise ratio areas in the foreground, resulting in false negatives, which makes the segmentation results unable to meet the needs of medical image processing.
[0004] Therefore, there is a problem in the related art that the foreground area of the image is not accurately segmented. Summary of the invention
[0005] Based on this, it is necessary to provide an iterative foreground segmentation method, apparatus, computer device, computer-readable storage medium and computer program product based on noise field transformation, which can more accurately segment the foreground area in the image in order to solve the above technical problems.
[0006] In a first aspect, the present application provides an iterative foreground segmentation method based on noise field transformation. The method comprises:
[0007] Obtain an image to be segmented;
[0008] Iteratively segmenting the image to obtain a foreground area that meets the conditions;
[0009] During the iteration process, based on the noise estimation field corresponding to the image used in the current iteration, the foreground segmentation is performed on the image used in the current iteration to obtain the foreground area obtained in the current iteration, based on the background area that is not segmented out of the image used in the current iteration, the pixel value distribution of the foreground area obtained in the current iteration is updated, and based on the updated foreground area obtained in the current iteration and the background area that is not segmented out of the current iteration, the image used for the next iteration is obtained.
[0010] In one embodiment, the updating of the pixel value distribution of the foreground area obtained in the current iteration based on the background area not segmented from the image used in the current iteration includes:
[0011] Determine a replacement pixel value according to the pixel value of the background area that is not segmented in the current iteration;
[0012] The pixel values of the foreground area obtained in the current iteration are replaced by the replacement pixel values to obtain the updated foreground area obtained in the current iteration.
[0013] In one embodiment, the noise estimation field is a noise field distribution image corresponding to the image used in the current iteration; and performing foreground segmentation on the image used in the current iteration based on the noise estimation field corresponding to the image used in the current iteration to obtain the foreground area obtained in the current iteration includes:
[0014] Determining an image segmentation threshold according to the pixel value of the noise field distribution image;
[0015] Determining a foreground determination condition according to the image segmentation threshold;
[0016] According to the foreground determination condition, foreground segmentation is performed on the image used in the current iteration to obtain the foreground area obtained in the current iteration.
[0017] In one embodiment, determining the image segmentation threshold according to the pixel value of the noise field distribution image includes:
[0018] Determining a standard deviation of the noise field distribution image according to pixel values of the noise field distribution image;
[0019] The image segmentation threshold is determined according to the standard deviation of the noise field distribution image.
[0020] In one embodiment, the method further comprises:
[0021] Smoothing the image used in the current iteration to obtain a smoothed image used in the current iteration;
[0022] The image used in the current iteration is subtracted from the smoothed image used in the current iteration to obtain a noise estimation field corresponding to the image used in the current iteration.
[0023] In one embodiment, the image to be segmented includes a dual echo image obtained by magnetic resonance scanning; the dual echo image includes a water-fat in-phase image and a water-fat anti-phase image with one pixel corresponding to each other; the method further includes:
[0024] Input the water-fat in-phase image and the water-fat anti-phase image into a signal model of water-fat imaging to obtain a first candidate amplitude and a second candidate amplitude corresponding to corresponding pixel points in the water-fat in-phase image and the water-fat anti-phase image;
[0025] The noise estimation field corresponding to the image used in the current iteration is determined according to the target amplitude corresponding to the water-fat in-phase image, the first candidate amplitude, and the second candidate amplitude.
[0026] In one embodiment, determining the noise estimation field corresponding to the image used in the current iteration according to the target amplitude corresponding to the water-fat in-phase image, the first candidate amplitude, and the second candidate amplitude includes:
[0027] Determine the sum of the first candidate amplitude and the second candidate amplitude corresponding to the corresponding pixel point to obtain the candidate amplitude corresponding to the water-fat in-phase image;
[0028] The noise estimation field is obtained by subtracting the candidate amplitude corresponding to the water-fat in-phase image from the target amplitude corresponding to the water-fat in-phase image.
[0029] In a second aspect, the present application also provides an iterative foreground segmentation device based on noise field transformation.
[0030] The device comprises:
[0031] An acquisition module, used for acquiring an image to be segmented;
[0032] An iterative segmentation module, used for iteratively segmenting the foreground of the image to obtain a foreground area that meets the conditions;
[0033] Among them, the iterative segmentation module is specifically used to perform foreground segmentation on the image used in the current iteration based on the noise estimation field corresponding to the image used in the current iteration, to obtain the foreground area obtained in the current iteration, based on the background area that has not been segmented from the image used in the current iteration, to update the pixel value distribution of the foreground area obtained in the current iteration, and based on the updated foreground area obtained in the current iteration and the background area that has not been segmented from the current iteration, to obtain the image used for the next iteration.
[0034] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the above method are implemented.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0036] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0037] The above-mentioned iterative foreground segmentation method, device, computer equipment, storage medium and computer program product based on noise field transformation obtain the image to be foreground segmented; iteratively segment the image to obtain a foreground area that meets the conditions; during the iteration, based on the noise estimation field corresponding to the image used in the current iteration, foreground segmentation is performed on the image used in the current iteration to obtain the foreground area obtained in the current iteration, based on the background area that is not segmented from the image used in the current iteration, the pixel value distribution of the foreground area obtained in the current iteration is updated, and based on the updated foreground area obtained in the current iteration and the background area that is not segmented from the current iteration, the image used for the next iteration is obtained.
[0038] In this way, due to the poor image quality, for example, when there is a low signal-to-noise ratio area in the foreground, the segmentation algorithm used in the related art is easy to miss the segmentation of the foreground area of the low signal-to-noise ratio part, resulting in false negative areas (part of the low signal-to-noise ratio area in the foreground that is mistakenly judged as the background), and the global solution to the foreground segmentation problem cannot be determined. However, the present application uses the noise estimation field corresponding to the image to determine the noise distribution of the image, and based on the dynamic programming idea, uses the noise estimation field to perform iterative foreground segmentation on the image, which is conducive to segmenting the foreground area containing the low signal-to-noise ratio area. Among them, it is assumed that the foreground area segmented each time is the optimal solution to the foreground segmentation problem of the current image, based on the background area that has not been segmented, the pixel value distribution of the foreground area that has been segmented is updated, and the new image is recomposed with the background area that has not been segmented (including the false negative area), and the foreground segmentation is further performed as an independent sub-problem. In the next round of segmentation, the noise field is re-estimated based on the sub-problem, and then the foreground area of the sub-problem is segmented based on the re-estimated noise field, and the segmented foreground area is used as the optimal solution to the current sub-problem. Thereby, the foreground area containing the low signal-to-noise ratio area can be segmented out more accurately in the image, which solves the problem that the global solution of the foreground segmentation problem cannot be determined in the related art, and achieves the beneficial effect of more accurately segmenting the foreground area in the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flow chart of an iterative foreground segmentation method based on noise field transformation in one embodiment;
[0040] FIG2( a ) is a schematic diagram of a medical image in one embodiment;
[0041] FIG2( b ) is a schematic diagram of a segmentation result in one embodiment;
[0042] FIG2( c ) is a schematic diagram of another segmentation result in one embodiment;
[0043] Figure 3 is a schematic diagram of a noise field standard deviation variation curve in one embodiment;
[0044] Figure 4 is a schematic diagram of a 3D mapping image corresponding to a medical image in one embodiment;
[0045] FIG5( a ) is a schematic diagram of a noise field distribution image used in the first iterative segmentation in one embodiment;
[0046] FIG5( b ) is a schematic diagram of a noise field distribution image used in the last iterative segmentation in one embodiment;
[0047] FIG6( a) is a schematic diagram of pixel intensity distribution of an original input image in one embodiment;
[0048] FIG6( b ) is a schematic diagram of pixel intensity distribution of a segmented image in one embodiment;
[0049] Figure 7 is a flow chart of another iterative foreground segmentation method based on noise field transformation in one embodiment;
[0050] Figure 8 It is a flowchart of an iterative foreground segmentation method based on noise field transformation applied to water-fat imaging in one embodiment;
[0051] Fig. 9 is a structural block diagram of an iterative foreground segmentation device based on noise field transformation in one embodiment;
[0052] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0055] In one embodiment, Figure 1 As shown, an iterative foreground segmentation method based on noise field transformation is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0056] Step S110, obtaining an image to be segmented into foreground.
[0057] The image may be a medical image in the medical field, such as a CT (Computed Tomography) image, an MRI (Magnetic Resonance Imaging) image, etc. It is understandable that the image to be segmented may also be other types of images, which are not specifically limited herein. In the following embodiments, the image to be segmented is a medical image as an example for description.
[0058] In a specific implementation, the terminal may obtain an image that needs to be segmented. In some embodiments, the image may be a medical scan image corresponding to a scanned part of the scanned object.
[0059] It should be noted that the image to be segmented can be pre-stored in the memory of the terminal, and the terminal can directly obtain it from the memory when needed. This embodiment does not limit the specific method of obtaining the image to be segmented, as long as its function can be achieved.
[0060] Step S120, performing iterative foreground segmentation on the image to obtain a foreground area that meets the conditions.
[0061] In the iterative process, based on the noise estimation field corresponding to the image used in the current iteration, the foreground segmentation is performed on the image used in the current iteration to obtain the foreground area obtained in the current iteration, based on the background area that is not segmented out of the image used in the current iteration, the pixel value distribution of the foreground area obtained in the current iteration is updated, and based on the updated foreground area obtained in the current iteration and the background area that is not segmented out of the current iteration, the image used for the next iteration is obtained.
[0062] The termination condition of the iteration is that the area of the foreground region contained in the image used for the iteration reaches a set threshold. As an optional embodiment of the present application, the set threshold may be 0. That is, the termination condition of the iteration may be that the area of the foreground region contained in the image used for the iteration is 0 (that is, the image used for the iteration no longer has a foreground region that can be segmented). It is understandable that the set threshold may also be other values, which are not specifically limited here.
[0063] Among them, the foreground area that meets the conditions can be output in the form of a MASK (mask) image.
[0064] In a specific implementation, the terminal can perform iterative foreground segmentation on the image, and finally segment to obtain a foreground area that meets the conditions. Specifically, during the iteration, the terminal estimates the noise field corresponding to the image used in the current iteration, obtains the noise estimation field corresponding to the image used in the current iteration, and performs foreground segmentation on the image used in the current iteration based on the noise estimation field corresponding to the image used in the current iteration, and obtains the foreground area obtained in the current iteration, and the area of the image used in the current iteration that is not segmented is used as the background area.
[0065] The terminal can update the pixel value distribution of the foreground area obtained in the current iteration based on the background area not segmented out of the image used in the current iteration to obtain the updated foreground area obtained in the current iteration. In this way, the terminal can obtain the image used in the next iteration based on the updated foreground area obtained in the current iteration and the background area not segmented out of the current iteration, until the area of the foreground area included in the image used in the iteration reaches the set threshold.
[0066] Specifically, the terminal can recompose a new image based on the updated foreground area obtained in the current iteration and the background area that was not segmented in the current iteration to obtain an image used in the next iteration. Then, the terminal can use the image used in the next iteration as the new image used in the current iteration, return the noise estimation field corresponding to the image used in the current iteration, perform foreground segmentation on the image used in the current iteration, and obtain the foreground area obtained in the current iteration, until the area of the foreground area contained in the image used in the iteration reaches the set threshold.
[0067] In this way, assuming that the foreground area segmented each time is the optimal solution to the foreground segmentation problem of the current image, based on the unsegmented background area, update the pixel value distribution of the segmented foreground area, and recompose a new image with the unsegmented background area (including the false negative area), and further perform foreground segmentation as an independent sub-problem. In the next round of segmentation, re-estimate the noise field based on the sub-problem, and then segment the foreground area of the sub-problem based on the re-estimated noise field, and the segmented foreground area is used as the optimal solution to the current sub-problem. Iterate this process, and the termination condition is that the area of the foreground area contained in the sub-problem (the false negative area of the previous round) reaches the set threshold, that is, the global problem reaches the optimal solution. In this way, the foreground area containing the low signal-to-noise ratio area can be segmented more accurately in the image.
[0068] In the above-mentioned iterative foreground segmentation method based on noise field transformation, an image to be segmented is obtained; the image is iteratively segmented to obtain a foreground area that meets the conditions; during the iteration, based on the noise estimation field corresponding to the image used in the current iteration, the image used in the current iteration is segmented to obtain the foreground area obtained in the current iteration, based on the background area that has not been segmented from the image used in the current iteration, the pixel value distribution of the foreground area obtained in the current iteration is updated, and based on the updated foreground area obtained in the current iteration and the background area that has not been segmented from the current iteration, the image used for the next iteration is obtained.
[0069] In this way, due to the poor image quality, for example, when there is a low signal-to-noise ratio area in the foreground, the segmentation algorithm used in the related art is easy to miss the segmentation of the foreground area of the low signal-to-noise ratio part, resulting in false negative areas (part of the low signal-to-noise ratio area in the foreground that is mistakenly judged as the background), and the global solution to the foreground segmentation problem cannot be determined. However, the present application uses the noise estimation field corresponding to the image to determine the noise distribution of the image, and based on the dynamic programming idea, uses the noise estimation field to perform iterative foreground segmentation on the image, which is conducive to segmenting the foreground area containing the low signal-to-noise ratio area. Among them, it is assumed that the foreground area segmented each time is the optimal solution to the foreground segmentation problem of the current image, based on the background area that has not been segmented, the pixel value distribution of the foreground area that has been segmented is updated, and the new image is recomposed with the background area that has not been segmented (including the false negative area), and the foreground segmentation is further performed as an independent sub-problem. In the next round of segmentation, the noise field is re-estimated based on the sub-problem, and then the foreground area of the sub-problem is segmented based on the re-estimated noise field, and the segmented foreground area is used as the optimal solution to the current sub-problem. Thereby, the foreground area containing the low signal-to-noise ratio area can be segmented out more accurately in the image, which solves the problem that the global solution of the foreground segmentation problem cannot be determined in the related art, and achieves the beneficial effect of more accurately segmenting the foreground area in the image.
[0070] To facilitate understanding by those skilled in the art, FIG2(a) provides a schematic diagram of a medical image; FIG2(b) provides a schematic diagram of a segmentation result obtained by performing foreground segmentation of a medical image using the OTSU method in a related art; FIG2(c) provides a schematic diagram of a segmentation result obtained by performing foreground segmentation of a medical image using an iterative foreground segmentation method based on noise field transformation. It can be seen that when the image quality of the medical image is poor, FIG2(b) tends to ignore the low signal-to-noise ratio area in the foreground, resulting in a segmentation result that cannot meet the requirements of medical image processing. The method used in the present application can more accurately segment the foreground area of the medical image that contains the low signal-to-noise ratio area, so that the segmentation result of FIG2(c) is better than the segmentation result of FIG2(b).
[0071] In one embodiment, based on the background area that is not segmented from the image used in the current iteration, the pixel value distribution of the foreground area obtained in the current iteration is updated, including: determining a replacement pixel value based on the pixel value of the background area that is not segmented from the current iteration; replacing the pixel value of the foreground area obtained in the current iteration with the replacement pixel value to obtain an updated foreground area obtained in the current iteration.
[0072] In a specific implementation, in the process of updating the pixel value distribution of the foreground area obtained in the current iteration based on the background area that has not been segmented out of the image used in the current iteration, the terminal can determine the replacement pixel value based on the pixel value of the background area that has not been segmented out in the current iteration. For example, the terminal can determine the mean of the pixel values of the pixels in the background area as the replacement pixel value. Alternatively, the terminal can also determine the standard deviation of the pixel values of the pixels in the background area as the replacement pixel value. It is understandable that other values of the pixels in the background area that have not been segmented out in the current iteration can also be used to determine the replacement pixel value.
[0073] In this way, the terminal can replace the pixel values of the pixels in the foreground area obtained in the current iteration with the above-mentioned replacement pixel values to obtain the updated foreground area obtained in the current iteration. Thus, the terminal can use the updated foreground area obtained in the current iteration and the background area (including the false negative area) that has not been segmented in the current iteration to recompose a new image to obtain the image used in the next iteration, so that in the next iteration segmentation, the foreground area that has been segmented last time can be considered as the background area, and the previous false negative area can be segmented as the foreground area.
[0074] The technical solution of this embodiment determines the replacement pixel value according to the pixel value of the background area that has not been segmented in the current iteration; replaces the pixel value of the foreground area obtained in the current iteration with the replacement pixel value to obtain the updated foreground area obtained in the current iteration. In this way, the updated foreground area obtained in the current iteration and the background area (including the false negative area) that has not been segmented in the current iteration are used to recompose a new image to obtain an image used in the next iteration, so that in the next iteration segmentation, the foreground area that has been segmented last time can be considered as the background area, and the previous false negative area can be segmented as the foreground area, reducing the low signal-to-noise ratio area that belongs to the foreground area that is missed, so that the foreground area containing the low signal-to-noise ratio area can be segmented more accurately in the image.
[0075] In one embodiment, the noise estimation field includes a noise field distribution image corresponding to the image used in the current iteration; based on the noise estimation field corresponding to the image used in the current iteration, the image used in the current iteration is segmented foreground to obtain the foreground area obtained in the current iteration, including: determining an image segmentation threshold according to the pixel value of the noise field distribution image; determining a foreground judgment condition according to the image segmentation threshold; and performing foreground segmentation on the image used in the current iteration according to the foreground judgment condition to obtain the foreground area obtained in the current iteration.
[0076] The noise field distribution image corresponding to the image used in the current iteration is used to display the distribution of noise in the image used in the current iteration.
[0077] In a specific implementation, when the terminal performs foreground segmentation on the image used in the current iteration based on the noise estimation field corresponding to the image used in the current iteration to obtain the foreground area obtained in the current iteration, since the signal distribution of the background area in the image can be considered as the noise field distribution, and the signal intensity distribution of the foreground area is much higher than the signal intensity distribution of the background noise field, the terminal can determine the image segmentation threshold used in the current iteration based on the pixel value of the noise field distribution image used in the current iteration; then, the terminal can determine the foreground determination condition used in the current iteration based on the image segmentation threshold used in the current iteration. In this way, the terminal can perform foreground segmentation on the image used in the current iteration based on the foreground determination condition used in the current iteration to obtain the foreground area obtained in the current iteration.
[0078] Furthermore, the foreground determination condition used in the current iteration may be that the pixel points in the image used in the current iteration whose pixel values are greater than the image segmentation threshold used in the current iteration belong to the foreground area.
[0079] The technical solution of this embodiment determines the image segmentation threshold according to the pixel value of the noise field distribution image; determines the foreground determination condition according to the image segmentation threshold; and performs foreground segmentation on the image used for the current iteration according to the foreground determination condition to obtain the foreground area obtained in the current iteration. In this way, since the signal distribution of the background area in the image can be considered as the noise field distribution, and the signal intensity distribution of the foreground area is much higher than the signal intensity distribution of the background noise field, the image segmentation threshold is determined by the pixel value of the noise field distribution image to set the foreground determination condition, and the foreground determination condition can be used to more accurately segment the foreground area in the image.
[0080] In one embodiment, the method further includes: smoothing the image used in the current iteration to obtain a smoothed image used in the current iteration; subtracting the image used in the current iteration from the smoothed image used in the current iteration to obtain a noise estimation field corresponding to the image used in the current iteration.
[0081] In a specific implementation, for a noise estimation field including a noise field distribution image corresponding to an image used in a current iteration, the terminal may smooth the image used in the current iteration during the current iteration to obtain a smoothed image used in the current iteration; then, the terminal may subtract the image used in the current iteration from the smoothed image used in the current iteration to obtain a noise field distribution image corresponding to the image used in the current iteration, thereby obtaining a noise estimation field corresponding to the image used in the current iteration.
[0082] As an embodiment of the present application, the terminal may use a smoothing filter method to smooth the image used for the current iteration to obtain a smoothed image used for the current iteration. It is understandable that other common filtering and denoising methods may also be used to smooth the image used for the current iteration, or other non-filtering and denoising methods may also be used to smooth the image used for the current iteration. The specific means of smoothing are not specifically limited here, as long as the function can be achieved.
[0083] In this way, by smoothing the image used in the current iteration, the noise in the image used in the current iteration can be removed to obtain the denoised and smoothed image used in the current iteration. Then, the image used in the current iteration is subtracted from the denoised and smoothed image used in the current iteration, so that the noise field distribution in the image used in the current iteration can be determined more accurately, and the noise estimation field corresponding to the image used in the current iteration can be obtained.
[0084] Since the standard deviation of the noise field can tend to converge with iterative segmentation, in one embodiment, the image segmentation threshold is determined based on the pixel values of the noise field distribution image, including: determining the standard deviation of the noise field distribution image based on the pixel values of the noise field distribution image; determining the image segmentation threshold based on the standard deviation of the noise field distribution image.
[0085] In a specific implementation, since the standard deviation of the noise field can tend to converge with iterative segmentation, when the terminal determines the image segmentation threshold used for the current iteration based on the pixel value of the noise field distribution image used for the current iteration, the terminal can determine the standard deviation of the noise field distribution image used for the current iteration based on the pixel value of the pixel point in the noise field distribution image used for the current iteration, as the standard deviation of the noise field used for the current iteration, and then determine the image segmentation threshold used for the current iteration based on the standard deviation of the noise field used for the current iteration.
[0086] In some embodiments, the terminal may use a fixed multiple of the standard deviation of the noise field used in the current iteration as the image segmentation threshold used in the current iteration. Correspondingly, the foreground determination condition at this time may be that the pixel points in the image used in the current iteration whose pixel values are greater than the fixed multiple of the standard deviation of the noise field used in the current iteration belong to the foreground area. In this way, it is possible to determine the interface between the foreground area and the background area in the image used in the current iteration based on the interface where the image segmentation threshold used in the current iteration is located, so as to segment the foreground area in the image used in the current iteration based on the interface. The problem in the related art that there may be multiple pixel intensity sets due to the diverse distribution of pixels in the foreground area of the image is solved. The essence of Otsu is to find the dividing point for segmenting the two sets, but what is often found is the dividing point for segmenting the foreground elements, resulting in incomplete segmentation and the problem that the low signal-to-noise ratio part belonging to the foreground area is easily missed, thereby achieving the beneficial effect of more accurately segmenting the foreground area in the image.
[0087] Among them, the principle that the standard deviation of the noise field can converge with iterative segmentation is as follows:
[0088] As the iterative segmentation proceeds, more and more pixel values in the foreground of the image are placed at the mean of the background area, and more areas in the foreground of the image will tend to be smooth. When the smoothed image is subtracted from the input image, the pixel intensity distribution (pixel value distribution) of the segmented foreground area will become increasingly flat, and the global standard deviation will gradually decrease. As the iterative segmentation proceeds, when fewer and fewer areas in the image meet the foreground judgment conditions (greater than a fixed multiple of the standard deviation of the noise field distribution image), the pixel intensity distribution of the image will change less and less, and the corresponding noise field distribution will tend to be flat, and the standard deviation of the noise field will tend to converge, such as Figure 3 Schematic diagram of the noise field standard deviation change curve shown.
[0089] In order to facilitate the understanding of those skilled in the art, Figure 4A 3D (three-dimensional) mapping diagram corresponding to the medical image of FIG2(a) is provided, FIG5(a) provides a noise field distribution image used in the first iterative segmentation presented in the form of a 3D mapping diagram, and FIG5(b) provides a noise field distribution image used in the last iterative segmentation presented in the form of a 3D mapping diagram. It can be seen that the noise field distribution change of FIG5(b) is smoother than that of FIG5(a). Among them, the horizontal axis and the vertical axis in the 3D mapping diagram represent the pixel position, and the vertical axis represents the pixel intensity value.
[0090] It should be noted that, in the embodiments of the present application, the input image may be a grayscale image, and the pixel value of a pixel point may also be replaced by a grayscale value, a brightness value or a pixel intensity value.
[0091] It can be understood that the embodiments of the present application can determine the image segmentation threshold by calculating the standard deviation of the noise field distribution image to find the interface in the image used to segment the foreground area and the background area. The pixel intensity distribution of the original input image presented in the form of a 3D mapping diagram as shown in Figure 6(a), and the pixel intensity distribution of the segmented image presented in the form of a 3D mapping diagram as shown in Figure 6(b). Among them, in Figures 6(a) and 6(b), the segmentation surface of the upper layer is the interface where the image segmentation threshold used in the first segmentation is located, and the segmentation surface of the lower layer is the interface where the image segmentation threshold used in the last segmentation is located. In each iterative segmentation, all pixels whose pixel signal intensity (i.e., pixel value) is placed above the interface are judged to belong to the foreground area, and the interface is iteratively decreased until there is no pixel signal intensity higher than the interface used for segmentation, and the iteration converges.
[0092] In practical applications, the terminal can directly use the standard deviation of the noise field used in the current iteration as the image segmentation threshold used in the current iteration; or use the mean of the pixel values of the pixels in the noise field distribution image used in the current iteration (i.e., the noise field mean value used in the current iteration), or a fixed multiple of the noise field mean value used in the current iteration as the image segmentation threshold used in the current iteration. No specific limitation is made here.
[0093] In order to facilitate the understanding of those skilled in the art, Figure 7 A flowchart of another iterative foreground segmentation method based on noise field transformation is provided. Figure 7 As shown, the method includes the following process steps:
[0094] a) Calculate the noise field: Calculate the noise field of the image used in the current iteration to obtain the noise field distribution image used in the current iteration, and calculate the standard deviation of the noise field distribution image used in the current iteration to obtain the standard deviation of the noise field used in the current iteration.
[0095] b) Set the foreground determination condition: determine whether the pixels in the image used in the current iteration that are larger than a fixed multiple of the standard deviation of the noise field belong to the foreground area.
[0096] c) Foreground segmentation: Based on the foreground determination condition, the image used in the current iteration is segmented to determine whether the area of the segmented foreground region reaches the set threshold.
[0097] d) If not, replace the pixel value of the segmented foreground area with the mean value of the unsegmented background area (so that the segmented foreground area is used as the background area in the next iteration)
[0098] e) Repeat steps a) to d) until the area of the foreground region reaches the set threshold. The iteration ends, the segmentation is completed, and the foreground Mask is output.
[0099] It should be noted that the specific definition of the above steps can refer to the specific definition of an iterative foreground segmentation method based on noise field transformation mentioned above.
[0100] In one embodiment, the image to be foreground segmented includes a dual echo image obtained by magnetic resonance scanning; the dual echo image includes a water-fat in-phase image and a water-fat anti-phase image with one pixel to one correspondence; the method also includes: inputting the water-fat in-phase image and the water-fat anti-phase image into a signal model of water-fat imaging to obtain a first candidate amplitude and a second candidate amplitude corresponding to corresponding pixels in the water-fat in-phase image and the water-fat anti-phase image; and determining a noise estimation field corresponding to the image used in the current iteration based on the target amplitude, the first candidate amplitude and the second candidate amplitude corresponding to the water-fat in-phase image.
[0101] The present application provides an iterative foreground segmentation method based on noise field transformation, which can be applied to water-fat imaging in magnetic resonance imaging. Dual-echo water-fat imaging will capture images when water and fat are in the same phase and in opposite phases. Through the above-mentioned iterative foreground segmentation method based on noise field transformation, the foreground area in the dual-echo image can be extracted for the subsequent water-fat separation algorithm.
[0102] In a specific implementation, for the dual echo image obtained by magnetic resonance scanning in water-fat imaging, the dual echo image includes a water-fat in-phase image and a water-fat anti-phase image with one-to-one correspondence between pixels. Among them, the water-fat in-phase image and the water-fat anti-phase image are complex images. The terminal can input the water-fat in-phase image and the water-fat anti-phase image into the signal model of water-fat imaging. The signal model of water-fat imaging is a physical model of water-fat imaging and can be used for water-fat separation, so that two candidate amplitudes for each pixel can be obtained (generally a solution with a larger amplitude and a solution with a smaller amplitude). Specifically, the pixels of the water-fat in-phase image and the water-fat anti-phase image correspond one-to-one, and the spatial position is measured by the pixel point. The signal is collected twice at each spatial position to obtain two candidate amplitudes corresponding to each spatial position, which are used as the first candidate amplitude and the second candidate amplitude corresponding to each corresponding pixel in the water-fat in-phase image and the water-fat anti-phase image.
[0103] In this way, there is no phase difference between water and fat in the water-fat in-phase image, and the terminal can more accurately determine the noise estimation field corresponding to the dual echo image used in the current iteration in water-fat imaging based on the target amplitude, the first candidate amplitude and the second candidate amplitude corresponding to the water-fat in-phase image.
[0104] In one embodiment, a noise estimation field corresponding to the image used in the current iteration is determined based on the target amplitude, the first candidate amplitude, and the second candidate amplitude corresponding to the water-fat in-phase image, including: determining the sum of the first candidate amplitude and the second candidate amplitude corresponding to the corresponding pixel point to obtain the candidate amplitude corresponding to the water-fat in-phase image; and subtracting the candidate amplitude corresponding to the water-fat in-phase image from the target amplitude corresponding to the water-fat in-phase image to obtain the noise estimation field.
[0105] In a specific implementation, when the terminal determines the noise estimation field corresponding to the dual echo image used in the current iteration based on the target amplitude, the first candidate amplitude and the second candidate amplitude corresponding to the water-fat in-phase image, the terminal can determine the sum of the first candidate amplitude and the second candidate amplitude corresponding to the corresponding pixel point as the candidate amplitude corresponding to the water-fat in-phase image; then, the target amplitude corresponding to the water-fat in-phase image is subtracted from the candidate amplitude corresponding to the water-fat in-phase image to obtain the noise estimation field corresponding to the dual echo image used in the current iteration.
[0106] Furthermore, there is no phase difference between water and fat in the in-phase image, and the candidate amplitude size of the water and fat in-phase image can be expressed as the sum of two solutions (the first candidate amplitude and the second candidate amplitude) (represented by B+S). Therefore, the noise field corresponding to the double echo image used in the iteration can be estimated as: Noise Field = Mag-(B+S). Among them, Noise Field is the noise estimation field, and Mag is the target amplitude corresponding to the water and fat in-phase image. Among them, Mag can specifically be the amplitude signal strength of the water and fat in-phase image, which can be obtained by extracting the amplitude information of the water and fat in-phase image which is a complex image.
[0107] The technical solution of this embodiment obtains the candidate amplitude corresponding to the water-fat in-phase image by determining the sum of the first candidate amplitude and the second candidate amplitude corresponding to the corresponding pixel point; and obtains the noise estimation field by subtracting the candidate amplitude corresponding to the water-fat in-phase image from the target amplitude corresponding to the water-fat in-phase image. In this way, the noise estimation field in the water-fat imaging can be accurately obtained based on the difference between the target amplitude corresponding to the water-fat in-phase image without phase difference in water-fat and the sum of the first candidate amplitude and the second candidate amplitude corresponding to the fat in-phase image.
[0108] In order to facilitate the understanding of those skilled in the art, Figure 8 A flowchart of an iterative foreground segmentation method based on noise field transformation applied to water-fat imaging is provided. Figure 8 As shown, the following steps are included:
[0109] 1. According to the above embodiment, the candidate size solutions of the dual echo images used in the current iteration are calculated;
[0110] 2. According to the above embodiment, further calculating the noise estimation field corresponding to the dual echo image used in the current iteration;
[0111] 3. Set the foreground judgment condition: Determine that the pixels in the dual echo image used in the current iteration that are greater than a fixed multiple of the standard deviation of the noise field belong to the foreground area
[0112] 4. Foreground segmentation: Based on the foreground judgment condition, the foreground segmentation is performed on the dual echo image used in the current iteration to determine whether the area of the segmented foreground region reaches the set threshold.
[0113] 5. If not, replace the pixel value of the segmented foreground area with the mean value of the unsegmented background area (so that the segmented foreground area is used as the background area in the next iteration)
[0114] 6. Repeat steps 1 to 5 until the area of the segmented foreground region reaches the set threshold. The iteration ends, the segmentation is completed, and the foreground Mask is output.
[0115] It should be noted that the specific definition of the above steps can refer to the specific definition of an iterative foreground segmentation method based on noise field transformation mentioned above.
[0116] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0117] Based on the same inventive concept, the embodiment of the present application also provides an iterative foreground segmentation device based on noise field transformation for implementing the iterative foreground segmentation method based on noise field transformation mentioned above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of iterative foreground segmentation devices based on noise field transformation provided below can refer to the limitations of an iterative foreground segmentation method based on noise field transformation above, and will not be repeated here.
[0118] In one embodiment, Fig. 9 As shown, an iterative foreground segmentation device based on noise field transformation is provided, comprising: an acquisition module 910 and an iterative segmentation module 920, wherein:
[0119] The acquisition module 910 is used to acquire the image to be segmented.
[0120] The iterative segmentation module 920 is used to perform iterative foreground segmentation on the image to obtain a foreground area that meets the conditions.
[0121] Among them, the iterative segmentation module 920 is specifically used to perform foreground segmentation on the image used in the current iteration based on the noise estimation field corresponding to the image used in the current iteration, to obtain the foreground area obtained in the current iteration, to update the pixel value distribution of the foreground area obtained in the current iteration based on the background area that has not been segmented from the image used in the current iteration, and to obtain the image used for the next iteration based on the updated foreground area obtained in the current iteration and the background area that has not been segmented from the current iteration; the termination condition of the iteration is: the image used in the iteration no longer has a foreground area that can be segmented.
[0122] In one embodiment, the iterative segmentation module 920 is specifically used to determine the replacement pixel value based on the pixel value of the background area that has not been segmented in the current iteration; replace the pixel value of the foreground area obtained in the current iteration with the replacement pixel value to obtain the updated foreground area obtained in the current iteration.
[0123] In one embodiment, the noise estimation field includes a noise field distribution image corresponding to the image used in the current iteration; the iterative segmentation module 920 is specifically used to determine an image segmentation threshold according to the pixel value of the noise field distribution image; determine a foreground judgment condition according to the image segmentation threshold; and perform foreground segmentation on the image used in the current iteration according to the foreground judgment condition to obtain the foreground area obtained in the current iteration.
[0124] In one embodiment, the iterative segmentation module 920 is specifically used to determine the standard deviation of the noise field distribution image according to the pixel values of the noise field distribution image; and determine the image segmentation threshold according to the standard deviation of the noise field distribution image.
[0125] In one embodiment, the iterative segmentation module 920 is further specifically used to smooth the image used in the current iteration to obtain a smoothed image used in the current iteration; subtract the image used in the current iteration from the smoothed image used in the current iteration to obtain a noise estimation field corresponding to the image used in the current iteration.
[0126] In one embodiment, the image to be foreground segmented includes a dual echo image obtained by magnetic resonance scanning; the dual echo image includes a water-fat in-phase image and a water-fat anti-phase image with one pixel to one correspondence; the iterative segmentation module 920 is further specifically used to input the water-fat in-phase image and the water-fat anti-phase image into a signal model of water-fat imaging to obtain a first candidate amplitude and a second candidate amplitude corresponding to corresponding pixels in the water-fat in-phase image and the water-fat anti-phase image; and determine the noise estimation field corresponding to the image used in the current iteration based on the target amplitude corresponding to the water-fat in-phase image, the first candidate amplitude and the second candidate amplitude.
[0127] In one embodiment, the iterative segmentation module 920 is further specifically used to determine the sum of the first candidate amplitude and the second candidate amplitude corresponding to the corresponding pixel point to obtain the candidate amplitude corresponding to the water-fat in-phase image; and subtract the candidate amplitude corresponding to the water-fat in-phase image from the target amplitude corresponding to the water-fat in-phase image to obtain the noise estimation field.
[0128] Each module in the above-mentioned iterative foreground segmentation device based on noise field transformation can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0129] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an iterative foreground segmentation method based on noise field transformation is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0130] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0131] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0132] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0133] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0134] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0135] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An iterative foreground segmentation method based on noise field transformation, characterized in that: The method comprises: Obtain an image to be segmented; Iteratively segmenting the image to obtain a foreground area that meets the conditions; During the iteration process, based on the noise estimation field corresponding to the image used in the current iteration, the foreground segmentation is performed on the image used in the current iteration to obtain the foreground area obtained in the current iteration, based on the background area that is not segmented out of the image used in the current iteration, the pixel value distribution of the foreground area obtained in the current iteration is updated, and based on the updated foreground area obtained in the current iteration and the background area that is not segmented out of the current iteration, the image used for the next iteration is obtained.
2. The method according to claim 1, characterized in that The updating of the pixel value distribution of the foreground area obtained in the current iteration based on the background area not segmented from the image used in the current iteration comprises: Determine a replacement pixel value according to the pixel value of the background area that is not segmented in the current iteration; The pixel values of the foreground area obtained in the current iteration are replaced by the replacement pixel values to obtain the updated foreground area obtained in the current iteration.
3. The method according to claim 1, characterized in that The noise estimation field includes a noise field distribution image corresponding to the image used in the current iteration; The foreground segmentation of the image used in the current iteration is performed based on the noise estimation field corresponding to the image used in the current iteration to obtain the foreground area obtained in the current iteration, including: Determining an image segmentation threshold according to the pixel value of the noise field distribution image; Determining a foreground determination condition according to the image segmentation threshold; According to the foreground determination condition, foreground segmentation is performed on the image used in the current iteration to obtain the foreground area obtained in the current iteration.
4. The method according to claim 3, characterized in that Determining the image segmentation threshold according to the pixel value of the noise field distribution image includes: Determining a standard deviation of the noise field distribution image according to pixel values of the noise field distribution image; The image segmentation threshold is determined according to the standard deviation of the noise field distribution image.
5. The method according to claim 1, characterized in that The method further comprises: Smoothing the image used in the current iteration to obtain a smoothed image used in the current iteration; The image used in the current iteration is subtracted from the smoothed image used in the current iteration to obtain a noise estimation field corresponding to the image used in the current iteration.
6. The method according to claim 1, characterized in that The image to be segmented includes a dual echo image obtained by magnetic resonance scanning; the dual echo image includes a water-fat in-phase image and a water-fat anti-phase image in which pixels correspond to each other one by one; the method further includes: Input the water-fat in-phase image and the water-fat anti-phase image into a signal model of water-fat imaging to obtain a first candidate amplitude and a second candidate amplitude corresponding to corresponding pixel points in the water-fat in-phase image and the water-fat anti-phase image; The noise estimation field corresponding to the image used in the current iteration is determined according to the target amplitude corresponding to the water-fat in-phase image, the first candidate amplitude, and the second candidate amplitude.
7. The method according to claim 6, characterized in that The step of determining the noise estimation field corresponding to the image used in the current iteration according to the target amplitude corresponding to the water-fat in-phase image, the first candidate amplitude, and the second candidate amplitude includes: Determine the sum of the first candidate amplitude and the second candidate amplitude corresponding to the corresponding pixel point to obtain the candidate amplitude corresponding to the water-fat in-phase image; The noise estimation field is obtained by subtracting the candidate amplitude corresponding to the water-fat in-phase image from the target amplitude corresponding to the water-fat in-phase image.
8. An iterative foreground segmentation device based on noise field transformation, characterized in that: The device comprises: An acquisition module, used for acquiring an image to be segmented; An iterative segmentation module, used for iteratively segmenting the foreground of the image to obtain a foreground area that meets the conditions; Among them, the iterative segmentation module is specifically used to perform foreground segmentation on the image used in the current iteration based on the noise estimation field corresponding to the image used in the current iteration, to obtain the foreground area obtained in the current iteration, based on the background area that has not been segmented from the image used in the current iteration, to update the pixel value distribution of the foreground area obtained in the current iteration, and based on the updated foreground area obtained in the current iteration and the background area that has not been segmented from the current iteration, to obtain the image used for the next iteration.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.