Image correction methods, apparatus, computer equipment and storage media
By identifying and classifying pixel types in the display image, and combining DICOM and GAMMA correction, the problems of color blocks and banding caused by brightness differences were solved, achieving high-quality grayscale and color image transitions and improving the display effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2026-04-03
AI Technical Summary
When medical digital images and gamma effects are displayed simultaneously on a monitor, the large difference in brightness between adjacent areas can cause color blocks, banding, or grayscale smoothing problems in the image, resulting in poor image quality.
By identifying the pixel type in the image, grayscale and color pixels are grouped together, and grayscale smoothing is performed on the first and last pixel subsets. Combined with DICOM and GAMMA correction, brightness differences are reduced.
It improves image quality, reduces color blocks and banding, achieves a smooth transition between grayscale and color images, and enhances display performance.
Smart Images

Figure CN115880182B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an image correction method, apparatus, computer equipment, and storage medium. Background Technology
[0002] With the continuous improvement and development of modern medical display technology, monitors have evolved from high-brightness monochrome monitors to multi-functional high-brightness color monitors. More and more doctors hope that the effects of Digital Imaging and Communications in Medicine (DICOM) and Gamma (GAMMA) can be displayed simultaneously and intelligently on the same monitor, so that the image information can be displayed in a realistic and perfect way.
[0003] To achieve the above effects, a display is provided that can simultaneously display color images and grayscale images, wherein the color image is composed of multiple color pixels, and the grayscale image is composed of multiple grayscale pixels. Medical displays require DICOM calibration when displaying grayscale images and GAMMA calibration when displaying color images.
[0004] However, when DICOM and GAMMA are used to correct adjacent areas separately, the brightness difference between adjacent areas may be very large, resulting in serious color blocks, banding, or grayscale smoothing problems in the image, and the resulting image quality is poor. Summary of the Invention
[0005] This application provides an image correction method, apparatus, computer device, and storage medium that can improve image quality.
[0006] In a first aspect, embodiments of this application provide an image correction method, which includes:
[0007] Pixel type identification processing is performed on multiple pixels in the first image to determine each pixel as a grayscale pixel or a color pixel.
[0008] The first image is grouped into a target set by classifying multiple grayscale pixels in the horizontal and vertical directions, where the number of consecutive grayscale pixels is greater than or equal to a first preset number, to obtain multiple target sets.
[0009] Based on the second preset quantity, determine the first pixel subset and the last pixel subset corresponding to each target set, and obtain multiple first pixel subsets and multiple last pixel subsets;
[0010] The first pixel set and the last pixel set are subjected to grayscale smoothing to obtain the second image.
[0011] The second image is subjected to brightness correction processing to obtain the target image.
[0012] Secondly, embodiments of this application also provide an image correction device, which includes a transceiver unit and a processing unit, wherein:
[0013] The transceiver unit is used to acquire the first image;
[0014] The processing unit is configured to perform pixel type identification processing on multiple pixels in the first image, and determine each pixel as a grayscale pixel or a color pixel; group multiple grayscale pixels in the horizontal and vertical directions of the first image with a consecutive number greater than or equal to a first preset number into a target set, thereby obtaining multiple target sets; determine the first pixel subset and the last pixel subset corresponding to each target set according to a second preset number, thereby obtaining multiple first pixel sets and multiple last pixel sets; perform grayscale smoothing processing on each first pixel set and each last pixel set to obtain a second image; and perform brightness correction processing on the second image to obtain a target image.
[0015] Thirdly, embodiments of this application also provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0016] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, can implement the above-described method.
[0017] This application provides an image correction method, apparatus, computer device, and storage medium. The method includes: performing pixel type identification processing on multiple pixels in a first image, determining each pixel as a grayscale pixel or a color pixel; then grouping multiple grayscale pixels in the horizontal and vertical directions of the first image into a target set, obtaining multiple target sets; further determining a first pixel subset and a last pixel subset corresponding to each target set according to a second preset number, obtaining multiple first pixel subsets and multiple last pixel subsets; performing grayscale smoothing processing on each first pixel subset and each last pixel subset to obtain a second image; and finally performing brightness correction processing on the second image to obtain a target image. Because this application performs grayscale smoothing processing on the first and last pixels in the target sets, and these first and last pixels are adjacent to color pixels, this solution can reduce the problem of excessive brightness difference between adjacent areas, which can lead to severe color blocks, banding, or grayscale smoothing issues in the image, thus improving image quality. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic flowchart illustrating the image correction method provided in this application embodiment;
[0020] Figure 2 A schematic block diagram of the image correction apparatus provided in the embodiments of this application;
[0021] Figure 3 A schematic block diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0024] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0025] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0026] This application provides an image correction method, apparatus, computer device, and storage medium.
[0027] The execution subject of this image correction method can be the image correction device provided in the embodiments of this application, or a computer device that integrates the image correction device. The image correction device can be implemented in hardware or software. The computer device can be a terminal or a server. The terminal can be an image display, such as a Picture Archiving and Communication Systems (PACS) display. When the computer device is a server, the server can send the processed image to the image display and display the processed image through the image display.
[0028] This embodiment eliminates problems such as uneven display due to excessively large grayscale brightness gradients in the same grayscale level of the DICOM and GAMMA curves by selectively smoothing the transition between grayscale and color pixels along vertical and horizontal lines in the image. This allows existing systems to fully utilize their display capabilities, perfectly presenting the smooth transition between grayscale and color images. Consequently, it better displays image information, enhances doctors' control over the information, increases the accuracy of patient diagnosis, and elevates the display to a more professional technical level. The specific solution is as follows:
[0029] Figure 1 This is a schematic flowchart of the image correction method provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps S110-S150.
[0030] S110. Perform pixel type recognition processing on multiple pixels in the first image, and determine each pixel as a grayscale pixel or a color pixel.
[0031] In this embodiment, the first image is the image that needs to be corrected. The first image is composed of multiple pixels, and each pixel has a corresponding R (Red) value, G (Green) value, and B (Blue) value. In this embodiment, the multiple pixels in the first image are processed to identify the pixel type. Pixels with R value = G value = B value are identified as grayscale pixels, and pixels with R value ≠ G value = B value, R value = G value ≠ B value, or R value ≠ G value ≠ B value are identified as color pixels.
[0032] S120. Group the multiple grayscale pixels in the horizontal and vertical directions of the first image into a target set, thereby obtaining multiple target sets.
[0033] In this embodiment, the first preset quantity can be 10 or other integers greater than 5. The specific value can be adjusted according to actual needs, and is not limited here.
[0034] When the first preset quantity is 8, this embodiment determines multiple grayscale pixels with a consecutive number greater than or equal to 8 in the horizontal and vertical directions as a target set. For example, when there are 8 grayscale pixels arranged consecutively in the horizontal direction, the 8 grayscale pixels are classified into a target set, and when there are 10 grayscale pixels arranged consecutively in the vertical direction, the 10 grayscale pixels are classified into a target set.
[0035] S130. Determine the first pixel subset and the last pixel subset corresponding to each target set according to the second preset quantity, and obtain multiple first pixel subsets and multiple last pixel subsets.
[0036] Specifically, for each target set, the first set of pixels of the second preset number are determined as the first pixel subset, resulting in multiple first pixel subsets; and for each target set, the last set of pixels of the second preset number are determined as the last pixel subset, resulting in multiple last pixel subsets.
[0037] In this embodiment, the value of the second preset quantity can be 4, or it can be any other integer greater than 2 and less than 10. The specific value is not limited here, and the second preset quantity * 2 ≤ the first preset quantity.
[0038] For example, when the second preset quantity is 4, for each target set, the first 4 grayscale pixels in the target set are determined as the first pixel subset, and the last 4 grayscale pixels in the target set are determined as the last pixel subset, resulting in multiple first pixel subsets and last pixel subsets containing 4 consecutive grayscale pixels.
[0039] S140. Perform grayscale smoothing on each set of first pixels and each set of last pixels to obtain the second image.
[0040] Specifically, in some embodiments, step S140 specifically includes: performing grayscale smoothing processing on each set of first pixels and each set of last pixels according to a preset smoothing processing formula to obtain the second image; wherein, the smoothing processing formula is as follows:
[0041]
[0042]
[0043]
[0044] Where m is the second preset quantity;
[0045] n is the pixel ordinal number of the target pixel in each of the first pixel subset and each of the last pixel subset. The target pixel is the other pixel in each of the first pixel subset except the last pixel, and the other pixel in each of the last pixel subset except the first pixel. The value of n is [1, m-1]. In the first pixel subset, n is in ascending order, and in the last pixel subset, n is in descending order.
[0046] LR n The R-LUT value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets;
[0047] LG n The G-LUT (lookup table) value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets;
[0048] LB n The B-LUT value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets;
[0049] LG R The R-LUT value corresponding to the GAMMA of the target pixel;
[0050] LG GThe GAMMA corresponding to the target pixel is represented by the GAMMA LUT value.
[0051] LG B The B-LUT value corresponding to the GAMMA of the target pixel;
[0052] LD R The R-LUT value corresponding to the DICOM of the target pixel;
[0053] LD G The G-LUT value corresponding to the DICOM of the target pixel;
[0054] LD B The B-LUT value corresponding to the DICOM of the target pixel.
[0055] Further, the step of performing grayscale smoothing processing on each set of first pixels and each set of last pixels according to a preset smoothing formula to obtain the second image includes:
[0056] According to the smoothing formula, the target pixels in each of the first pixel subsets and each of the last pixel subsets are subjected to grayscale smoothing to obtain multiple processed first pixel subsets and multiple processed last pixel subsets; then, the multiple processed first pixel subsets, the multiple processed last pixel subsets, and other pixels in the first image are merged to obtain the second image, wherein the other pixels are the pixels in the first image other than the multiple processed first pixel subsets and the multiple processed last pixel subsets.
[0057] In some embodiments, since the first pixel set and the last pixel set located at the screen edge have no adjacent colored pixels, the loudness difference between the first pixel set and the last pixel set located at the screen edge will not be too large when using DICOM. Therefore, this embodiment does not require grayscale smoothing processing of the first pixel set and the last pixel set located at the screen edge. In this case, before performing the step of performing grayscale smoothing processing on the target pixels in each first pixel set and each last pixel set according to the smoothing processing formula to obtain multiple processed first pixel sets and multiple processed last pixel sets, the method further includes:
[0058] Determine whether the first pixel in each set of first pixel points is located at the screen edge, and determine whether the last pixel in each set of last pixel points is located at the screen edge; determine the set of first pixel points whose first pixel is not located at the screen edge as the set of first pixel points to be processed, and determine the set of last pixel points whose last pixel is not located at the screen edge as the set of last pixel points to be processed.
[0059] In other words, horizontally, if the starting point (first pixel) of the first pixel subset is located at the far left of the screen, then grayscale smoothing is not required for that first pixel subset; similarly, if the last pixel of the last pixel subset is located at the far right of the screen, then smoothing is not required for that last pixel subset either. Vertically, if the starting point (first pixel) of the first pixel subset is located at the top of the screen, then grayscale smoothing is not required for that first pixel subset; similarly, if the last pixel of the last pixel subset is located at the bottom of the screen, then smoothing is not required for that last pixel subset either. For the first and last pixel subsets that do not require smoothing, they can be directly output using DICOM.
[0060] At this time, the step of performing grayscale smoothing processing on the target pixels in each of the first pixel subsets and each of the last pixel subsets according to the smoothing processing formula to obtain multiple processed first pixel subsets and multiple processed last pixel subsets includes: performing grayscale smoothing processing on the target pixels in each of the first pixel subsets to be processed and each of the last pixel subsets to be processed according to the smoothing processing formula to obtain multiple processed first pixel subsets and multiple processed last pixel subsets.
[0061] S150. Perform brightness correction processing on the second image to obtain the target image.
[0062] Specifically, this step includes: performing DICOM correction processing on the grayscale pixels in the target set; performing GAMMA correction processing on the grayscale pixels outside the target set; and performing GAMMA correction processing on the color pixels to obtain the target image.
[0063] That is, in this embodiment, DICOM correction processing (i.e., processing using DICOM curves) is performed on grayscale pixels with a consecutive number greater than or equal to the first preset threshold, and DICOM correction processing is performed on grayscale pixels with a consecutive number less than the first preset threshold. It should be noted that if there is a situation where the number of consecutive grayscale pixels in the horizontal direction is greater than or equal to the first preset threshold, but the number of consecutive grayscale pixels in the vertical direction is less than the first preset threshold, then DICOM correction processing is performed on that pixel. Similarly, if there is a situation where the number of consecutive grayscale pixels in the vertical direction is greater than or equal to the first preset threshold, but the number of consecutive grayscale pixels in the horizontal direction is less than the first preset threshold, then DICOM correction processing is also performed on that pixel.
[0064] In addition, this embodiment performs GAMMA (i.e., GAMMA curve processing) correction on grayscale pixels with a continuous number less than a first preset threshold to avoid excessive brightness differences between grayscale pixels in small areas and adjacent color pixels.
[0065] In this embodiment, all colored pixels in the image are subjected to GAMMA correction.
[0066] S150, Display the target image.
[0067] In this embodiment, after obtaining the target image, the target image is displayed on the monitor.
[0068] The image correction method provided in this application not only solves the current requirement for single (grayscale) color mixed display on monitors, but more importantly, it overcomes the problem of unsatisfactory color image quality when viewed using DICOM curves in hospitals, while GAMMA curves fail to accurately represent key lesions in PACS images. The solution provided in this application allows a single monitor to simultaneously meet the application requirements for both grayscale and color images. This reduces the number of monitors required in hospitals, thereby significantly saving costs, while simultaneously improving doctors' work efficiency, achieving truly lossless display, greatly enhancing image display quality, and enabling doctors to make more accurate diagnoses.
[0069] In summary, this application provides an image correction method, apparatus, computer device, and storage medium. The method includes: performing pixel type identification processing on multiple pixels in a first image, determining each pixel as a grayscale pixel or a color pixel; then grouping multiple grayscale pixels in the horizontal and vertical directions of the first image into a target set, obtaining multiple target sets; further determining the first pixel subset and the last pixel subset corresponding to each target set according to a second preset number, obtaining multiple first pixel subsets and multiple last pixel subsets; performing grayscale smoothing processing on each first pixel subset and each last pixel subset to obtain a second image; and finally performing brightness correction processing on the second image to obtain a target image. Because this application performs grayscale smoothing processing on the first and last pixels in the target sets, and these first and last pixels are adjacent to color pixels, this solution can reduce the problem of excessive brightness differences between adjacent areas, which can lead to severe color blocks, banding, or grayscale smoothing issues in the image, thus improving image quality.
[0070] Specifically, this application reduces the brightness gradient in the LUT during abrupt transitions between color and grayscale by effectively smoothing the first and last points of consecutive grayscale pixels, resulting in grayscale brightness levels between DICOM and GAMMA in the transition grayscale. This smooths the image transition between grayscale and color GAMMA, making this method adaptable to various grayscale and color image mixing display scenarios. It results in a natural and smooth display without compromising image quality, greatly facilitating practical use by doctors. It solves the objective problem of doctors wanting to achieve DICOM display effects in PACS, rather than the GAMMA 2.2 effect.
[0071] Figure 2 This is a schematic block diagram of an image correction device provided in an embodiment of this application. Figure 2 As shown, corresponding to the above image correction method, this application also provides an image correction apparatus. This image correction apparatus includes a unit for performing the above image correction method, and the apparatus can be configured in a PACS display. Specifically, please refer to... Figure 2 The image correction device 200 includes a transceiver unit 201 and a processing unit 202, wherein:
[0072] The transceiver unit 201 is used to acquire the first image;
[0073] The processing unit 202 is configured to perform pixel type identification processing on multiple pixels in the first image, and determine each pixel as a grayscale pixel or a color pixel; group multiple grayscale pixels in the horizontal and vertical directions of the first image with a consecutive number greater than or equal to a first preset number into a target set, thereby obtaining multiple target sets; determine the first pixel subset and the last pixel subset corresponding to each target set according to a second preset number, thereby obtaining multiple first pixel sets and multiple last pixel sets; perform grayscale smoothing processing on each first pixel set and each last pixel set to obtain a second image; and perform brightness correction processing on the second image to obtain a target image.
[0074] In some embodiments, when the processing unit 202 performs the step of performing grayscale smoothing processing on each of the first pixel subsets and each of the last pixel subsets to obtain a second image, it is specifically used for:
[0075] The first pixel set and the last pixel set are subjected to grayscale smoothing according to a preset smoothing formula to obtain the second image; wherein the smoothing formula is as follows:
[0076]
[0077]
[0078]
[0079] Where m is the second preset quantity;
[0080] n is the pixel ordinal number of the target pixel in each of the first pixel subset and each of the last pixel subset. The target pixel is the other pixel in each of the first pixel subset except the last pixel and the other pixel in each of the last pixel subset except the first pixel. It is the pixel that needs to be smoothed. The value of n is [1, m-1]. In the first pixel subset, n is in ascending order, and in the last pixel subset, n is in descending order.
[0081] LR n The R-LUT value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets;
[0082] LG n The G-LUT value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets;
[0083] LB nThe B-LUT value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets;
[0084] LG R The R-LUT (lookup table) value corresponding to the GAMMA of the target pixel;
[0085] LG G The GAMMA corresponding to the target pixel is represented by the GAMMA LUT value.
[0086] LG B The B-LUT value corresponding to the GAMMA of the target pixel;
[0087] LD R The R-LUT value corresponding to the DICOM of the target pixel;
[0088] LD G The G-LUT value corresponding to the DICOM of the target pixel;
[0089] LD B The B-LUT value corresponding to the DICOM of the target pixel.
[0090] In some embodiments, when the processing unit 202 performs grayscale smoothing processing on each set of first pixels and each set of last pixels according to a preset smoothing formula to obtain the second image, it is specifically used for:
[0091] According to the smoothing formula, the target pixels in each set of first pixels and each set of last pixels are subjected to grayscale smoothing to obtain multiple sets of first pixels and multiple sets of last pixels.
[0092] The second image is obtained by merging multiple processed sets of first pixels, multiple processed sets of last pixels, and other pixels in the first image. The other pixels are the pixels in the first image other than the multiple processed sets of first pixels and multiple processed sets of last pixels.
[0093] In some embodiments, before performing the step of performing grayscale smoothing processing on the target pixels in each of the first pixel subsets and each of the last pixel subsets according to the smoothing processing formula to obtain multiple processed first pixel subsets and multiple processed last pixel subsets, the processing unit 202 is further configured to:
[0094] Determine whether the first pixel in each set of first pixel points is located at the screen edge, and determine whether the last pixel in each set of last pixel points is located at the screen edge;
[0095] The subset of first pixels whose first pixel is not located at the edge of the screen is determined as the subset of first pixels to be processed, and the subset of last pixels whose last pixel is not located at the edge of the screen is determined as the subset of last pixels to be processed.
[0096] The step of performing grayscale smoothing on the target pixels in each of the first pixel set and each of the last pixel set according to the smoothing formula to obtain multiple processed first pixel sets and multiple processed last pixel sets includes:
[0097] The target pixels in each set of first pixels to be processed and each set of last pixels to be processed are subjected to grayscale smoothing according to the smoothing formula, so as to obtain multiple sets of first pixels and multiple sets of last pixels after processing.
[0098] In some embodiments, when the processing unit 202 performs the step of performing brightness correction processing on the second image to obtain the target image, it is specifically used for:
[0099] Perform DICOM correction processing on the grayscale pixels in the target set; and,
[0100] GAMMA correction is performed on the grayscale pixels outside the target set; and,
[0101] The target image is obtained by performing the GAMMA correction process on the colored pixels.
[0102] In some embodiments, when the processing unit 202 performs the step of determining the first pixel subset and the last pixel subset corresponding to each of the target sets according to a second preset number, and obtaining a plurality of first pixel subsets and a plurality of last pixel subsets, it is specifically used for:
[0103] For each target set, the first set of pixels (the first second preset number) is determined as the first pixel subset, resulting in multiple first pixel subsets; and,
[0104] For each target set, the last number of pixels in the target set are determined as the tail pixel subset, thus obtaining multiple tail pixel subsets.
[0105] In some embodiments, after performing the step of performing brightness correction processing on the second image to obtain the target image, the processing unit 202 is further configured to:
[0106] Display the target image.
[0107] The processing unit 202 in this embodiment can perform grayscale smoothing on the first and last pixels in the target set. Since the first and last pixels are adjacent to the color pixels, this solution can reduce the problem of excessive brightness difference between adjacent areas, which may cause serious color blocks, banding, or grayscale smoothing in the image, thereby improving image quality.
[0108] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned image correction device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0109] The aforementioned image correction device can be implemented as a computer program, which can, for example... Figure 3 It runs on the computer device shown.
[0110] Please see Figure 3 , Figure 3 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 300 can be a terminal or a server. The terminal can be an electronic device with a single-color display function, such as a PACS display. The server can be a standalone server or a server cluster composed of multiple servers.
[0111] See Figure 3 The computer device 300 includes a processor 302, a memory, and a network interface 305 connected via a system bus 301. The memory may include a non-volatile storage medium 303 and internal memory 304.
[0112] The non-volatile storage medium 303 may store an operating system 3031 and a computer program 3032. The computer program 3032 includes program instructions that, when executed, cause the processor 302 to perform an image correction method.
[0113] The processor 302 provides computing and control capabilities to support the operation of the entire computer device 300.
[0114] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can perform an image correction method.
[0115] This network interface 305 is used for network communication with other devices. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 300 to which the present application is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0116] The processor 302 is used to run a computer program 3032 stored in the memory to perform the following steps:
[0117] Pixel type identification processing is performed on multiple pixels in the first image to determine each pixel as a grayscale pixel or a color pixel.
[0118] The first image is grouped into a target set by classifying multiple grayscale pixels in the horizontal and vertical directions, where the number of consecutive grayscale pixels is greater than or equal to a first preset number, to obtain multiple target sets.
[0119] Based on the second preset quantity, determine the first pixel subset and the last pixel subset corresponding to each target set, and obtain multiple first pixel subsets and multiple last pixel subsets;
[0120] The first pixel set and the last pixel set are subjected to grayscale smoothing to obtain the second image.
[0121] The second image is subjected to brightness correction processing to obtain the target image.
[0122] It should be understood that in the embodiments of this application, the processor 302 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0123] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0124] Therefore, this application also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the following steps:
[0125] Pixel type identification processing is performed on multiple pixels in the first image to determine each pixel as a grayscale pixel or a color pixel.
[0126] The first image is grouped into a target set by classifying multiple grayscale pixels in the horizontal and vertical directions, where the number of consecutive grayscale pixels is greater than or equal to a first preset number, to obtain multiple target sets.
[0127] Based on the second preset quantity, determine the first pixel subset and the last pixel subset corresponding to each target set, and obtain multiple first pixel subsets and multiple last pixel subsets;
[0128] The first pixel set and the last pixel set are subjected to grayscale smoothing to obtain the second image.
[0129] The second image is subjected to brightness correction processing to obtain the target image.
[0130] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0131] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0132] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0133] The steps in the methods of this application embodiment can be adjusted, merged, or deleted according to actual needs. The units in the apparatus of this application embodiment can be merged, divided, or deleted according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0134] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0135] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An image correction method, characterized in that, The method is applied to a display of a medical imaging information system, including: Pixel type identification processing is performed on multiple pixels in the first image to determine each pixel as a grayscale pixel or a color pixel. The first image is grouped into a target set by classifying multiple grayscale pixels in the horizontal and vertical directions, where the number of consecutive grayscale pixels is greater than or equal to a first preset number, to obtain multiple target sets. Based on the second preset quantity, determine the first pixel subset and the last pixel subset corresponding to each target set, and obtain multiple first pixel subsets and multiple last pixel subsets; The first pixel set and the last pixel set are subjected to grayscale smoothing to obtain the second image. The second image is subjected to brightness correction processing to obtain the target image, including: Perform DICOM correction processing on the grayscale pixels in the target set; and, GAMMA correction is performed on the grayscale pixels outside the target set; and, The target image is obtained by performing the GAMMA correction process on the colored pixels.
2. The method according to claim 1, characterized in that, The step of performing grayscale smoothing on each of the first pixel set and each of the last pixel set to obtain the second image includes: The first pixel set and the last pixel set are subjected to grayscale smoothing according to a preset smoothing formula to obtain the second image; wherein the smoothing formula is as follows: ; ; ; Where m is the second preset quantity; n is the pixel ordinal number of the target pixel in each of the first pixel subset and each of the last pixel subset. The target pixel is the other pixel in each of the first pixel subset except the last pixel and the other pixel in each of the last pixel subset except the first pixel. It is the pixel that needs to be smoothed. The value of n is [1, m-1]. In the first pixel subset, n is in ascending order, and in the last pixel subset, n is in descending order. The R-LUT value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets; The G-LUT value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets; The B-LUT value of the nth target pixel in each of the first pixel subsets and each of the last pixel subsets; LG R The R-LUT value corresponding to the GAMMA of the target pixel; LG G The GAMMA corresponding to the target pixel is represented by the GAMMA LUT value. LG B The B-LUT value corresponding to the GAMMA of the target pixel; LD R The R-LUT value corresponding to the DICOM of the target pixel; LD G The G-LUT value corresponding to the DICOM of the target pixel; LD B The B-LUT value corresponding to the DICOM of the target pixel.
3. The method according to claim 2, characterized in that, The step of performing grayscale smoothing processing on each set of first pixels and each set of last pixels according to a preset smoothing formula to obtain the second image includes: According to the smoothing formula, the target pixels in each set of first pixels and each set of last pixels are subjected to grayscale smoothing to obtain multiple sets of first pixels and multiple sets of last pixels. The second image is obtained by merging multiple processed sets of first pixels, multiple processed sets of last pixels, and other pixels in the first image. The other pixels are the pixels in the first image other than the multiple processed sets of first pixels and multiple processed sets of last pixels.
4. The method according to claim 3, characterized in that, Before performing grayscale smoothing on the target pixels in each of the first pixel subsets and each of the last pixel subsets according to the smoothing formula to obtain multiple processed first pixel subsets and multiple processed last pixel subsets, the method further includes: Determine whether the first pixel in each set of first pixel points is located at the screen edge, and determine whether the last pixel in each set of last pixel points is located at the screen edge; The subset of first pixels whose first pixel is not located at the edge of the screen is determined as the subset of first pixels to be processed, and the subset of last pixels whose last pixel is not located at the edge of the screen is determined as the subset of last pixels to be processed. The step of performing grayscale smoothing on the target pixels in each of the first pixel set and each of the last pixel set according to the smoothing formula to obtain multiple processed first pixel sets and multiple processed last pixel sets includes: The target pixels in each set of first pixels to be processed and each set of last pixels to be processed are subjected to grayscale smoothing according to the smoothing formula, so as to obtain multiple sets of first pixels and multiple sets of last pixels after processing.
5. The method according to any one of claims 1 to 4, characterized in that, The step of determining the first pixel subset and the last pixel subset corresponding to each of the target sets according to the second preset quantity, to obtain multiple first pixel subsets and multiple last pixel subsets, includes: For each target set, the first set of pixels (the first second preset number) is determined as the first pixel subset, resulting in multiple first pixel subsets; and, For each target set, the last number of pixels in the target set are determined as the tail pixel subset, thus obtaining multiple tail pixel subsets.
6. The method according to any one of claims 1 to 4, characterized in that, After performing brightness correction processing on the second image to obtain the target image, the method further includes: Display the target image.
7. An image correction device, characterized in that, The image correction device is configured in the display of the medical imaging information system, and the image correction device includes a transceiver unit and a processing unit, wherein: The transceiver unit is used to acquire the first image; The processing unit is configured to perform pixel type identification processing on multiple pixels in the first image, and determine each pixel as a grayscale pixel or a color pixel; group multiple grayscale pixels in the horizontal and vertical directions of the first image with a consecutive number greater than or equal to a first preset number into a target set, thereby obtaining multiple target sets; determine the first pixel subset and the last pixel subset corresponding to each target set according to a second preset number, thereby obtaining multiple first pixel subsets and multiple last pixel subsets; perform grayscale smoothing processing on each first pixel subset and each last pixel subset to obtain a second image; and perform brightness correction processing on the second image to obtain a target image. When the processing unit performs the step of performing brightness correction processing on the second image to obtain the target image, it is specifically used for: Perform DICOM correction processing on the grayscale pixels in the target set; and, GAMMA correction is performed on the grayscale pixels outside the target set; and, The target image is obtained by performing the GAMMA correction process on the colored pixels.
8. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Method and apparatus for positioning gray scale image region during medical image displaying
CN104200792A
Image processing method and device
CN112313700A