Image correction method, device and image acquisition system
By downsampling, contrast adjustment and bias field removal of magnetic resonance images, the accuracy problem caused by image grayscale non-uniformity is solved, and efficient correction and accuracy improvement of image acquisition are achieved.
Patent Information
- Application Number
- CN202211137972.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-09-19
AI Technical Summary
In the prior art, the grayscale non-uniformity problem of magnetic resonance imaging equipment leads to low image accuracy, especially in areas such as the cervical and thoracic vertebrae. Conventional methods cannot effectively correct the problem, and some signals are excluded or noise is amplified.
By downsampling the original image, adjusting the contrast and segmenting the image, determining and removing the target bias field, and optimizing the image using Gaussian curve fitting and deconvolution algorithms, the contrast between image regions and the accuracy of threshold segmentation are improved.
It effectively removes the bias field, optimizes edge breaks caused by uneven image brightness, improves image acquisition accuracy and processing speed, and ensures contrast consistency between image areas.
Smart Images

Figure CN115456901B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image correction method, device and image acquisition system. Background Art
[0002] At present, in the related technology, there are two correction methods for the problem of image grayscale non-uniformity caused by the non-uniform signal received by the surface coil and factors related to the imaging object itself. They are prospective algorithm and retrospective algorithm. Among them, the prospective method is to correct the image grayscale non-uniformity during the MRI image acquisition process. A first uniformity enhanced image is obtained by a phase array uniformity enhancement method; the first uniformity enhanced image is divided by the receiving sensitivity distribution value of the body coil in the magnetic resonance imaging device to obtain a second uniformity enhanced image. Alternatively, the surface coil sensitivity correction of the magnetic resonance data received simultaneously by the surface coil and the body coil is used, but the prospective method must pre-scan the reference image in advance;
[0003] The retrospective method is to correct the grayscale non-uniformity of the MRI image after the image is acquired. An uneven image is a uniform image with an uneven bias field superimposed on it. Retrospective methods include surface fitting, image filtering, image segmentation, etc. Among them, the very famous N3 algorithm (non-parametric intensity non-uniform normalization) considers the grayscale non-uniformity problem from the perspective of signal processing. It is believed that the bias field blurs the high-frequency components in the magnetic resonance image. Correcting the grayscale non-uniformity of the magnetic resonance image is actually to restore the high-frequency frequency components in the image. Assuming that the probability distribution of the grayscale bias field is a Gaussian distribution, since any Gaussian distribution can be decomposed into the convolution of a narrower Gaussian distribution, the low-frequency narrow Gaussian field can be repeatedly used to perform deconvolution operations on the grayscale non-uniform image to maximize the high-frequency frequency components of the image until the bias field no longer changes. One method in the related art uses the Otsu method for threshold processing and adopts the projection estimation method to reconstruct the bias field estimation image of the phased array coil magnetic resonance image. Another method is to perform spherical harmonic function expansion on the nonlinear gradient field to obtain linear terms and high-order nonlinear terms, and use conventional fast Fourier transform to calculate the nonuniformity of the gradient field and the nonuniform mapping relationship between the image geometric position and brightness, and then calculate the weighting coefficient between the gradient field nonlinearity and the image grayscale distortion, thereby completing the image grayscale correction. However, due to the image nonuniformity, some image signals will be excluded from the mask due to their low intensity, resulting in inaccurate image correction.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] The embodiments of the present application provide an image correction method, an apparatus, and an image acquisition system to at least solve the technical problem of low accuracy of the acquired image due to uneven image grayscale.
[0006] According to one aspect of an embodiment of the present application, an image correction method is provided, comprising: acquiring a first image, the first image being obtained by downsampling an original image; adjusting the contrast of the first image, and segmenting the first image after contrast adjustment to obtain a second image; determining a target bias field in the second image, and removing the target bias field to obtain a target image.
[0007] Optionally, the grayscale value of the first target area in the first image is increased, and the first image is threshold segmented to obtain a grayscale image containing the first target area and the second target area; the connected domain with the largest area in the second target area is determined as the third target area; the first target area and the second target area are determined as the background area, and the third target area is determined as the mask area to obtain a mask; the mask is used to cover the first image to obtain the second image.
[0008] Optionally, determining the bias field in the second image includes: segmenting a plurality of sub-regions from the second image, and determining a sub-region having a pixel density greater than a set threshold among the plurality of sub-regions as a region of interest; determining a probability distribution of the region of interest, and fitting the probability distribution using a Gaussian curve to obtain an initial bias field; and adjusting the initial bias field multiple times to obtain a target bias field.
[0009] Optionally, the initial bias field is adjusted multiple times to obtain the bias field, including: substituting the initial bias field into a preset target function for adjustment, and when the number of adjustments reaches a set threshold, determining the bias field corresponding to the current number of adjustments as the target bias field.
[0010] Optionally, before substituting the initial bias field into a preset objective function for adjustment, the method includes: determining a blur kernel corresponding to the initial bias field according to the initial bias field; and determining the product of the blur kernel and the original image as the initial image.
[0011] Optionally, removing the target bias field to obtain the target image includes: adjusting the size of the target bias field to be consistent with the size of the original image; and removing the resized target bias field from the original image to obtain the target image.
[0012] Optionally, after dividing a plurality of sub-regions from the second image and determining a sub-region having a pixel density greater than a set threshold among the plurality of sub-regions as a region of interest, the method further includes: performing multiple filtering processes on the region of interest.
[0013] According to another aspect of an embodiment of the present application, an image correction device is provided, including: a first acquisition module, used to acquire a first image, where the first image is obtained by downsampling the original image; a second acquisition module, used to adjust the contrast of the first image and segment the first image after contrast adjustment to obtain a second image; and a correction module, used to determine a target bias field in the second image and remove the target bias field to obtain a corrected target image.
[0014] According to another aspect of an embodiment of the present application, an image acquisition system is provided, comprising: an image acquisition device and a target processor; the image acquisition device is connected to the target processor; the image acquisition device is used to acquire an original image; the target processor is used to obtain a first image after downsampling the original image; the system is further used to adjust the contrast of the first image and segment the first image after contrast adjustment to obtain a second image; determine a target bias field in the second image, and remove the target bias field to obtain a corrected target image.
[0015] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided. The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned image correction method.
[0016] In an embodiment of the present application, a first image is obtained by downsampling the original image, optimizing the edge breaks of the image due to uneven brightness, and adjusting the contrast of the first image. The first image after contrast adjustment is segmented to obtain a second image, thereby improving the contrast between image regions, thereby improving the accuracy of subsequent threshold segmentation, determining the target bias field in the second image, and removing the target bias field to obtain a target image with the bias field accurately removed, thereby solving the technical problem of low accuracy of the collected image due to uneven image grayscale. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for an image correction method according to an embodiment of the present application;
[0019] Figure 2 is a flow chart of an image correction method according to the present application;
[0020] Figure 3a is an optional schematic diagram of an original image according to an embodiment of the present application;
[0021] Figure 3b is a schematic diagram of an optional uniform image according to an embodiment of the present application;
[0022] Figure 3c is a schematic diagram of an optional bias field according to an embodiment of the present application;
[0023] Figure 4a is a schematic diagram of an optional region of interest of a second image according to an embodiment of the present application;
[0024] Figure 4b is an optional schematic diagram of probability distribution of regions of interest according to an embodiment of the present application;
[0025] Figure 5a is another optional schematic diagram of an original image according to an embodiment of the present application;
[0026] Figure 5b is an optional first image schematic diagram according to an embodiment of the present application;
[0027] Figure 5c is a schematic diagram of an optional mask according to an embodiment of the present application;
[0028] Figure 6 is a schematic diagram of an optional image correction device according to an embodiment of the present application;
[0029] Figure 7 is a schematic diagram of an optional image acquisition system according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Example 1
[0033] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a cloud server or a similar computing device. Figure 1 FIG1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing an image correction method. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (illustrated as 102a, 102b, ..., 102n) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0034] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0035] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image correction method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned image correction method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 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.
[0036] The transmission module 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission module 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission module 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0037] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0038] In the above-mentioned operating scenario, an embodiment of the present application provides an embodiment of an image correction method. 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.
[0039] Figure 2 is a flow chart of an image correction method according to an embodiment of the present application, such as Figure 2 As shown, the method includes steps S202-S206, wherein:
[0040] Step S202: Acquire a first image, where the first image is obtained by downsampling the original image.
[0041] Step S204, adjusting the contrast of the first image, and segmenting the contrast-adjusted first image to obtain a second image;
[0042] Step S206: determine the target bias field in the second image, and remove the target bias field to obtain the target image.
[0043] The image correction method provided in the present application obtains a first image by downsampling the original image, optimizes the edge breaks of the image caused by uneven brightness, adjusts the contrast of the first image, and segments the first image after contrast adjustment to obtain a second image, thereby improving the contrast between image regions, and further improving the accuracy of subsequent threshold segmentation, determining the target bias field in the second image, and removing the target bias field to obtain a target image with the bias field accurately removed, thereby solving the technical problem of low accuracy of the collected image caused by uneven image grayscale.
[0044] It should be noted that while prospective methods are effective for correcting grayscale nonuniformity, they require a pre-scanned body coil image as a reference, increasing scanning time. Furthermore, if the reference image is lost, the prospective method becomes ineffective. The mask is crucial for image uniformity correction, as it determines the image region to be calibrated. Conventional threshold segmentation methods can effectively generate a mask image for general images. However, for images of the cervical and thoracic spine, conventional threshold segmentation methods such as Otsu's will exclude portions of the image signal from the mask due to low intensity, resulting in subsequent uniformity correction failing to amplify these signals. Conversely, for images with a pre-defined saturation band, using the entire image region as a mask will result in the correction and amplification of the saturation band signal, thereby amplifying noise. Grayscale nonuniformity in MRI images is primarily due to the near-coil effect of the receiving coil, but also due to the influence of the tissue itself on the hardware.
[0045] In step S202, downsampling the original image can optimize the subsequent recognition of the image mask, especially the broken edges caused by uneven brightness. It also reduces the amount of data required for subsequent operations and significantly improves image processing speed. Image downsampling can use a variety of algorithms, such as nearest neighbor interpolation, linear interpolation, bicubic interpolation, cubic spline interpolation, B-spline interpolation, etc.
[0046] In step S204, conventional image segmentation algorithms can generate a mask image for general images. However, for images of human tissue, such as the cervical and thoracic vertebrae, using conventional image segmentation algorithms will result in the exclusion of some image signals from the mask due to image non-uniformity, resulting in the subsequent uniformity correction being unable to amplify these signals. Conversely, for images with pre-set saturation bands, using the entire image area as a mask will result in the correction and amplification of the saturated band signals, leading to amplified noise.
[0047] In step S206 , since the non-uniformity of the original image is caused by the bias field, a clear image can be obtained by removing the bias field in the original image.
[0048] Specifically, the mathematical model of the original image and bias field can be defined as v(x)' = u(x)b(x) + n(x), where v(x)' is the acquired non-uniform image signal, u(x) is the desired uniform image, b(x) is the bias field, and n(x) is the noise. The influence of n(x) can be removed by identifying an image mask. The mathematical model shows that the method for obtaining a uniform image is to remove the bias field.
[0049] Figure 3a 、 Figure 3b and Figure 3c An optional original image (non-uniform image), a uniform image, and a bias field are shown respectively.
[0050] Steps S202 to S206 are described in detail below.
[0051] Before segmenting the first image, it is first necessary to separate the various areas in the first image, and then use a mask to cover the first image to obtain the second image. Specifically, the grayscale value of the first target area in the first image is increased, and the first image is threshold segmented to obtain a grayscale image containing the first target area and the second target area; the connected domain with the largest area in the second target area is determined as the third target area; the first target area and the second target area are determined as the background area, and the third target area is determined as the mask area to obtain a mask; the mask is used to cover the first image to obtain the second image.
[0052] It should be noted that the first target area includes: the saturated band area of the first image, and the second target area includes: the background area of the first image and the mask area of the first image. Increasing the contrast of the first target area can more accurately determine the range framed by the first target area and the second target area, so as to improve the accuracy of subsequent threshold segmentation.
[0053] In specific application scenarios, contrast stretching the first image can increase the contrast between the saturated band region, background region, and mask region of the first image, thereby improving the accuracy of subsequent threshold segmentation. The image is segmented to obtain the mask region and background region. Conventional image segmentation methods, including threshold segmentation and region growing, can be used at this point. Morphological processing is performed on the mask, and preliminary processing of the mask is performed through operations such as corrosion and dilation. Holes are filled in the mask to optimize the mask coverage area to prevent parts of the image from being excluded from the mask due to low signal values. The largest connected domain in the mask is found, the mask processing is completed, and the mask is used to cover the first image to obtain the second image.
[0054] In an optional embodiment of the present application, based on the second image, multiple sub-regions are segmented from the second image, and the sub-regions in which the pixel density is greater than a set threshold are determined as regions of interest; the probability distribution of the region of interest is determined, and the probability distribution is fitted with a Gaussian curve to obtain an initial bias field; the initial bias field is adjusted multiple times to obtain a target bias field.
[0055] It should be noted that the probability distribution of the initial bias field conforms to the Gaussian distribution, but the probability distribution of the initial bias field of the original image of each part is different, and parameter fitting is required to obtain the initial bias field.
[0056] Specifically, the second image is further segmented by multi-threshold value to roughly divide the second image into several regions, each region belonging to the same tissue and having similar grayscale values. Among the multiple segmented regions, a region with more pixels can be selected as a region of interest.
[0057] It should be noted that the probability distribution of the initial bias field obtained by fitting the bias field of the Gaussian curve satisfies the full width at half maximum of the Gaussian distribution.
[0058] After the initial bias field distribution is obtained by fitting, the initial bias field is substituted into a preset objective function for adjustment. When the number of adjustments reaches a set threshold, the bias field corresponding to the current number of adjustments is determined as the target bias field.
[0059] It should be noted that before substituting the initial bias field into the preset objective function for adjustment, it is also necessary to determine the blur kernel corresponding to the initial bias field based on the initial bias field; and the product of the blur kernel and the original image is determined as the initial image.
[0060] Specifically, the initial corrected image U can be obtained according to the Wiener deconvolution algorithm. Wiener deconvolution is a commonly used non-blind linear image restoration algorithm. After obtaining the initial corrected image U, the expression of the objective function is:
[0061]
[0062] Where n represents the number of iterations, represents the residual bias field in the iteration, represents the target image obtained after the nth correction, Indicates smoothing of the residual bias field after the n-1th iteration. represents the residual bias field after the n-1th iteration.
[0063] It should be noted that when When the change is less than the set threshold or the specified number of iterations, the iteration stops, and the bias field remaining when the iteration stops is determined as the target bias field. The bias field can be smoothed by using a B-spline difference smoothing method.
[0064] Before correcting the second image, the second image may be processed, specifically including: determining the probability distribution of the region of interest of the second image, such as calculating the probability histogram of the region of interest of the second image. Optionally, the bin of the histogram (the number of bins into which the color space is divided in the histogram) may be set to 200. Figure 4a A schematic diagram of a second image region of interest is shown in FIG. Figure 4b A probability distribution diagram of a region of interest is shown in FIG.
[0065] After obtaining the target bias field, resize the target bias field to match the original image size, then remove the resized target bias field from the original image to obtain the target image. For example, if the original image size is 512*512, upsample the target bias field to 512*512.
[0066] Example 2
[0067] Take the cervical spine image as an example, the original image is as follows Figure 5a As shown in the figure, the cervical spine part is shown. The size of the original image is 384*384. The size of the original image is downsampled to 40*40 using the bilinear interpolation method to obtain the first image. The contrast of the first image is adjusted, as shown in FIG. Figure 5b As shown, the first image is then threshold segmented to obtain a mask, such as Figure 5c As shown, the mask is superimposed on the original image to obtain a second image, and the second image is segmented by multiple thresholds to divide the image into multiple sub-regions. The region of interest in the second image is determined, and the region of interest is subjected to multiple mean filtering processes to determine the probability distribution of the filtered region of interest. A Gaussian curve is used for fitting to obtain the full width at half maximum (FWHM) of the Gaussian distribution, for example: 0.2, 0.7, and then the initial bias field of the second image is determined.
[0068] After obtaining the initial bias field, the deconvolution algorithm is used to obtain the initial corrected image. The initial corrected image and the initial bias field are substituted into the objective function for adjustment to obtain the target bias field. Finally, the second image is divided by the target bias field to obtain the corrected target image.
[0069] Example 3
[0070] According to an embodiment of the present application, an image correction device for implementing the above-mentioned image correction method is also provided. Figure 6 As shown, the device includes:
[0071] The first acquisition module 60 is used to acquire a first image, which is obtained by downsampling the original image. The second acquisition module 62 is used to adjust the contrast of the first image and segment the first image after contrast adjustment to obtain a second image. The correction module 64 is used to determine the target bias field in the second image and remove the target bias field to obtain a corrected target image.
[0072] Among them, the second acquisition module 62 includes: a segmentation submodule, which is used to increase the grayscale value of the first target area in the first image, and perform threshold segmentation on the first image to obtain a grayscale image containing the first target area and the second target area; determine the connected domain with the largest area in the second target area as the third target area; determine the first target area and the second target area as the background area, and determine the third target area as the mask area to obtain a mask; and cover the first image with the mask to obtain the second image.
[0073] The correction module 64 includes: a determination submodule, which is used to segment multiple subregions from the second image, and determine the subregions with pixel density greater than a set threshold among the multiple subregions as regions of interest; determine the probability distribution of the regions of interest, and use a Gaussian curve to fit the probability distribution to obtain an initial bias field; adjust the initial bias field multiple times to obtain a target bias field, wherein the regions of interest are subjected to multiple filtering processes.
[0074] The determination submodule includes: an adjustment unit and a determination unit; the adjustment unit is used to substitute the initial bias field into a preset objective function for adjustment, and when the number of adjustments reaches a set threshold, determine the bias field corresponding to the current number of adjustments as the target bias field.
[0075] The determination unit is used to determine a blur kernel corresponding to the initial bias field according to the initial bias field before substituting the initial bias field into a preset objective function for adjustment; and determine the product of the blur kernel and the original image as the initial image.
[0076] The correction module 64 includes an adjustment submodule, which is used to adjust the size of the target bias field to be consistent with the size of the original image; and remove the resized target bias field from the original image to obtain the target image.
[0077] According to an embodiment of the present application, a non-volatile storage medium is further provided. The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned image correction method.
[0078] According to an embodiment of the present application, an image acquisition system is also provided. Figure 7As shown, the system includes: an image acquisition device 70 and a processor 72; the image acquisition device 70 is connected to the processor 72; the image acquisition device 70 is used to acquire an original image; the processor 72 is used to downsample the original image to obtain a first image; it is also used to adjust the contrast of the first image, and segment the first image after the contrast adjustment to obtain a second image; determine the target bias field in the second image, and remove the target bias field to obtain a corrected target image.
[0079] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0080] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0081] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0082] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.
[0083] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0084] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.
[0085] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An image correction method, characterized in that: include: Acquire a first image, where the first image is obtained by downsampling the original image; Adjusting the contrast of the first image and segmenting the contrast-adjusted first image to obtain a second image, wherein segmenting the contrast-adjusted first image to obtain the second image comprises: increasing the grayscale value of a first target region in the first image and performing threshold segmentation on the first image to obtain a grayscale image containing the first target region and a second target region; determining a connected domain with the largest area in the second target region as a third target region; determining the first target region and the second target region as background regions, and determining the third target region as a mask region to obtain a mask; and covering the first image with the mask to obtain the second image; A target bias field in the second image is determined, and the target bias field is removed to obtain a target image.
2. The method according to claim 1, characterized in that Determining a target bias field in the second image includes: Segmenting a plurality of sub-regions from the second image, and determining a sub-region having a pixel density greater than a set threshold among the plurality of sub-regions as a region of interest; Determining the probability distribution of the region of interest, and fitting the probability distribution using a Gaussian curve to obtain an initial bias field; The initial bias field is adjusted multiple times to obtain the target bias field.
3. The method according to claim 2, characterized in that The initial bias field is adjusted multiple times to obtain the bias field, comprising: The initial bias field is substituted into a preset objective function for adjustment. When the number of adjustments reaches a set threshold, the bias field corresponding to the current number of adjustments is determined as the target bias field.
4. The method according to claim 3, characterized in that Before substituting the initial bias field into a preset objective function for adjustment, the following steps are included: Determining a blur kernel corresponding to the initial bias field according to the initial bias field; The product of the blur kernel and the original image is determined as an initial image.
5. The method according to claim 1, wherein The target image obtained by removing the target bias field includes: Adjusting the size of the target bias field to be consistent with the size of the original image; The resized target bias field is removed from the original image to obtain the target image.
6. The method according to claim 2, characterized in that After segmenting a plurality of sub-regions from the second image and determining a sub-region having a pixel density greater than a set threshold among the plurality of sub-regions as a region of interest, the method further includes: The region of interest is subjected to multiple filtering processes.
7. An image correction device, characterized in that: include: A first acquisition module is used to acquire a first image, where the first image is obtained by downsampling the original image; a second acquisition module, configured to adjust the contrast of the first image and segment the first image after the contrast is adjusted to obtain a second image, wherein segmenting the first image after the contrast is adjusted to obtain the second image comprises: increasing the grayscale value of the first target area in the first image and performing threshold segmentation on the first image to obtain a grayscale image containing the first target area and a second target area; determining the connected domain with the largest area in the second target area as a third target area; determining the first target area and the second target area as background areas, and determining the third target area as a mask area to obtain a mask; and covering the first image with the mask to obtain the second image; The correction module is used to determine the target bias field in the second image and remove the target bias field to obtain a corrected target image.
8. An image acquisition system, characterized in that: include: Image acquisition device and processor; The image acquisition device is connected to the processor; The image acquisition device is used to acquire original images; The processor is used to obtain a first image after downsampling the original image; and is also used to adjust the contrast of the first image, and segment the first image after the contrast is adjusted to obtain a second image, wherein segmenting the first image after the contrast is adjusted to obtain the second image includes: increasing the grayscale value of the first target area in the first image, and performing threshold segmentation on the first image to obtain a grayscale image containing the first target area and the second target area; determining the connected domain with the largest area in the second target area as the third target area; determining the first target area and the second target area as the background area, and determining the third target area as the mask area to obtain a mask; covering the first image with the mask to obtain the second image; determining the target bias field in the second image, and removing the target bias field to obtain the corrected target image.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the image correction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Interactive type image segmentation and fusion method based on grabucut algorithm
CN107730528A
Cross-modal image synthesis method
CN113012086A