Film image correction method and device and computer readable storage medium
By obtaining the film color distribution and true dose distribution, and determining the color correction curve, the problem of inconsistent color in the lateral direction of the film scanning equipment is solved, and the accuracy of the film dose distribution is improved.
Patent Information
- Application Number
- CN202311306873.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-09
- Publication Date
- 2025-04-11
AI Technical Summary
The existing film scanning equipment has the problem of color inconsistent in the lateral direction, which leads to errors during film scanning and cannot truly reflect the dose distribution.
By obtaining the film color distribution of the preset film in the first direction of the scanning device, and combining the real dose distribution, the color correction curve is determined, and the color distribution of the film to be corrected is then color correction.
It solves the problem of color inconsistency in scanning the scanning device in the first direction, reduces the errors between the scanning device and the film itself, and improves the accuracy of the film dose distribution.
Smart Images

Figure CN119814938A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image correction, and in particular to a film image correction method, device and computer-readable storage medium. Background Art
[0002] The film dose measurement method refers to the fact that when rays pass through the photosensitive film, the sensitive substances in the film, such as silver bromide, form a latent image. After chemical treatment (such as development and fixing), its optical blackness (also called optical color) changes. The degree of change in blackness is related to the amount of radiation energy absorbed by the film. Therefore, in practical applications, a specific film is selected and the dose level is controlled within the linear range of the photosensitive curve. The optical blackness curve can be used to represent the relative dose curve.
[0003] Currently, in the medical field, in order to realize the digital processing of films, a film scanning device (for example, a scanner or other device that can scan image information) is generally used to scan the films, so as to convert the films into standard DICOM (Digital Imaging and Communications in Medicine) images for storage and subsequent processing.
[0004] However, due to the limitations of the scanning technology of the scanning device, the scanning device has the problem of inconsistent scanning colors in the horizontal direction (i.e., in the direction perpendicular to the scanning direction of the scanning device), which will increase the error in the film scanning process and make it impossible to truly reflect the dose distribution through film scanning. Summary of the invention
[0005] Based on this, it is necessary to provide a film image correction method, device and computer-readable storage medium that can reflect the actual dose distribution through film scanning in order to solve the above technical problems.
[0006] In a first aspect, the present application provides a film image correction method, the method comprising:
[0007] Acquire a film color distribution of a preset film in a first direction of a scanning device;
[0008] determining a color correction curve in a first direction according to the film color distribution and a true dose distribution corresponding to the film color distribution; and
[0009] Perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0010] In one embodiment, the step of obtaining the color distribution of the preset film in the first direction of the scanning device includes:
[0011] A plurality of film color distributions of a plurality of preset films in a first direction are obtained.
[0012] In one embodiment, the step of obtaining a plurality of film color distributions of a plurality of preset films in a first direction includes:
[0013] Scanning a plurality of preset films at one time using a scanning device to obtain a single scan image; and
[0014] Based on a single scan image, a plurality of film color distributions of a plurality of preset films in a first direction are obtained.
[0015] In one embodiment, the step of obtaining the color distribution of the preset film in the first direction of the scanning device includes:
[0016] Determine m first elements from the initial film color distribution; wherein m is greater than or equal to 1, and the m first elements correspond to m pixel points in a first direction; and
[0017] The film color distribution is determined according to the colors of the m first elements.
[0018] In one embodiment, determining the color correction curve in the first direction according to the film color distribution and the real dose distribution corresponding to the film color distribution includes:
[0019] Obtaining m second elements in the real dose distribution; the positions of the m second elements correspond to the positions of the m first elements;
[0020] Normalizing the first elements at corresponding positions in the film color distribution according to the m second elements in the real dose distribution to determine the color correction factor corresponding to each first element in the film color distribution; and
[0021] A color correction curve is determined according to the color of each first element and the corresponding color correction factor.
[0022] In one embodiment, determining the color correction curve according to the color of each first element and the corresponding color correction factor includes:
[0023] Determining a relationship curve corresponding to each first element according to the color of each first element and the corresponding color correction factor; and
[0024] Perform curve fitting processing on each relationship curve to determine the color correction curve.
[0025] In one embodiment, the color correction of the color distribution of the film to be corrected according to the color correction curve includes:
[0026] Color correction is performed on the colors of corresponding pixels in the color distribution of the film to be corrected according to the color correction curve.
[0027] In one of the embodiments, the preset film is pre-set at a depth where the dose distribution is flat in the uniform phantom when irradiation is performed with a preset dose.
[0028] In a second aspect, the present application further provides a film image correction device, the device comprising:
[0029] An acquisition module, used for acquiring a film color distribution of a preset film in a first direction of a scanning device;
[0030] a determination module, configured to determine a color correction curve in a first direction according to a film color distribution and a true dose distribution corresponding to the film color distribution; and
[0031] The correction module is used to perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0032] In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0033] Acquire a film color distribution of a preset film in a first direction of a scanning device;
[0034] determining a color correction curve in a first direction according to the film color distribution and a true dose distribution corresponding to the film color distribution; and
[0035] Perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0037] Acquire a film color distribution of a preset film in a first direction of a scanning device;
[0038] determining a color correction curve in a first direction according to the film color distribution and a true dose distribution corresponding to the film color distribution; and
[0039] Perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0040] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0041] Acquire a film color distribution of a preset film in a first direction of a scanning device;
[0042] determining a color correction curve in a first direction according to the film color distribution and a true dose distribution corresponding to the film color distribution; and
[0043] Perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0044] The above-mentioned film image correction method, device and computer-readable storage medium obtain the film color distribution of the preset film in the first direction of the scanning device, and determine the color correction curve in the first direction in combination with the real dose distribution corresponding to the film color distribution, and then perform color correction on the color distribution of the film to be corrected according to the color correction curve. In this method, since the color correction curve can be obtained by the actual color distribution and the real dose distribution of the preset film in the first direction of the scanning device, the color correction curve can be used to correct the color distribution of other films obtained by the scanning device in the future, thereby solving the problem of inconsistent colors scanned by the scanning device in the first direction, reducing errors caused by the scanning device scanning in the first direction and errors of the film itself, and improving the accuracy of the film dose distribution finally obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is an internal structure diagram of a computer device in one embodiment;
[0046] Figure 2 is a schematic flow chart of a film image correction method in one embodiment;
[0047] Figure 3 An exemplary diagram of two directions of a scanning device in another embodiment;
[0048] Figure 4 is an example diagram of a plurality of preset film arrangements in another embodiment;
[0049] Figure 5 is a schematic flow chart of a film image correction method in another embodiment;
[0050] Figure 6 is a schematic flow chart of a film image correction method in another embodiment;
[0051] Figure 7 is a schematic flow chart of a film image correction method in another embodiment;
[0052] Figure 8 is an example graph of a curve of film color distribution and actual dose distribution in another embodiment;
[0053] Fig. 9 FIG. 4 is a structural block diagram of a film image correction device in one embodiment. DETAILED DESCRIPTION
[0054] 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.
[0055] The film image correction method provided in the embodiment of the present application can be applied to a computer device, which can be a terminal or a server. Taking the terminal as an example, its internal structure diagram can be as follows: Figure 1 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, 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 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 achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a film image correction method is implemented. The display screen of the computer device 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 covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0056] Those skilled in the art will understand that Figure 1 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.
[0057] In one embodiment, Figure 2 As shown, a film image correction method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps:
[0058] S202: Obtain film color distribution of a preset film in a first direction of a scanning device.
[0059] Among them, the preset films and / or other films described in the specification can be various physical films or virtual films. As non-limiting examples, the films can be various types of image recording materials (for example, polyester films or nitrocellulose films coated with or containing photosensitive materials, etc.), or can also be image recording information or data (for example, virtual digital films, etc.).
[0060] The number of preset films is not specifically limited in this embodiment, for example, it can be one or more; the preset film can be obtained from a memory, or can be obtained by shooting at a historical time, or can be obtained by shooting at a current time; the shooting here can be shooting of a certain object.
[0061] After obtaining the preset film, the preset film can be scanned once by a scanning device to obtain color data corresponding to the preset film, and the color data may include color data corresponding to each point of the preset film in each direction of the scanning device. For example, the color data may include color data on the scanned surface of the preset film. In this embodiment, a first direction can be first determined from each direction of the scanning device, and then a group of color data in the first direction can be extracted from the above color data, and the film color distribution of the preset film in the first direction of the scanning device can be obtained through the group of color data. The specific acquisition method can be to directly use the group of color data as the above film color distribution, or to obtain a fitting curve after fitting the group of color data, and then use the fitted curve as the above film color distribution.
[0062] The first direction of the scanning device may be the horizontal direction of the scanning device, but is not limited thereto; see Figure 3 As shown, the transverse direction of the scanning device here can be a direction perpendicular to the scanning direction. For example, the transverse direction is a solid line in the figure, and the direction indicated by the arrow is the scanning direction.
[0063] It should be noted that, generally, the color data of each point obtained after scanning the preset film in the scanning direction of the scanning device will not have too much deviation. It is mainly that the color data of each point obtained after scanning the preset film in the first direction of the scanning device may have a large deviation, and the deviations of each group of color data along the first direction (the points with the same coordinates in the scanning direction can be regarded as the same group of points, and the color data of the same group of points can be recorded as a group of color data) are roughly the same. Therefore, here a group of color data can be selected from the scanned color data along the first direction to represent the color data of the preset film in the first direction, and the film color distribution is obtained through the group of color data to obtain the subsequent correction curve, without selecting all the points to obtain the subsequent correction curve. This can ensure the effect of subsequent film image correction and reduce the amount of calculation in the correction process.
[0064] In addition, the color data of each point obtained after scanning the preset film may be color data or grayscale data. The color data may be, for example, RGB (red, green, and blue) data, HSV (hue-saturation-brightness) data, HSB (hue-saturation-brightness) data, etc.
[0065] Furthermore, for the color data of each point, the color data is related to the irradiation dose of the corresponding point on the preset film, and specifically, different color data may represent different irradiation doses. In other words, the color distribution of the film may correspond to the dose distribution. For example, dark colors correspond to larger irradiation doses, and light colors correspond to smaller irradiation doses. For another example, red corresponds to larger irradiation doses, and blue corresponds to smaller irradiation doses, and so on.
[0066] As a non-limiting example, when the film image correction method described in this article is applied to dose measurement film for radiotherapy, for example, obtaining the film grayscale distribution as the film color distribution and using it for subsequent processing can reduce the requirements for the film image scanning equipment and also save the size of the data space used to store the film image scanning data.
[0067] S204 , determining a color correction curve in a first direction according to the film color distribution and the actual dose distribution corresponding to the film color distribution.
[0068] In this step, the real dose distribution corresponding to the preset film can be obtained by measuring the dose of the preset film in advance using a three-dimensional water tank or other measuring means, or directly obtaining the pre-stored dose data of the preset film. The real dose distribution here can essentially refer to the real color distribution corresponding to the real dose.
[0069] As an example, after obtaining the film color distribution of a preset film in the first direction of a scanning device, each point in the film color distribution can be compared with each point in the actual dose distribution to obtain the difference between each point in the film color distribution and each point in the actual dose distribution; then, the correction factor for correcting each point in the film color distribution can be determined according to the difference between each point. The correction factor here is mainly a factor for correcting the film color distribution to be close to the actual dose distribution, and then the color correction curve can be obtained through the correction factor of each point.
[0070] As another example, after obtaining the film color distribution of a preset film in the first direction of the scanning device, a corresponding film color distribution curve can be drawn and compared with the real dose distribution curve drawn based on the real dose distribution (or the real color distribution curve corresponding to the real dose distribution curve) to obtain a color correction curve.
[0071] S206, performing color correction on the color distribution of the film to be corrected according to the color correction curve.
[0072] In this step, the color correction curve substantially corresponds to a curve for compensating for a scanning error of the scanning device in the first direction.
[0073] After obtaining the film to be corrected, the film to be corrected can be scanned once by a scanning device to obtain the color distribution to be corrected corresponding to the film to be corrected, and then the color correction curve is used to perform color correction processing on the color distribution to be corrected to obtain the corrected color distribution corresponding to the film to be corrected.
[0074] The color correction processing here may be, for example, superimposing the correction factor in the color correction curve on the color data in the color distribution to be corrected, or removing the correction factor corresponding to the color correction curve from the color data in the color distribution to be corrected, etc., or other situations may also be possible. In short, color correction of the color distribution of the film to be corrected can be achieved.
[0075] After the color distribution of the film to be corrected is corrected, the corrected color distribution can be obtained. Then, a calibration method for determining the dose according to the color can be used to convert the corrected color distribution into a dose distribution to obtain the dose distribution corresponding to the film to be corrected.
[0076] In the above-mentioned film image correction method, the color distribution of the preset film in the first direction of the scanning device is obtained, and the color correction curve in the first direction is determined in combination with the real dose distribution corresponding to the film color distribution, and then the color correction of the color distribution of the film to be corrected is performed according to the color correction curve. In this method, since the color correction curve can be obtained by the actual color distribution and the real dose distribution of the preset film in the first direction of the scanning device, the color correction curve can be used to correct the color distribution of other films obtained by the scanning device in the future, so as to solve the problem of inconsistent colors scanned by the scanning device in the first direction, reduce the errors caused by the scanning device scanning in the first direction and the errors of the film itself, and improve the accuracy of the film dose distribution finally obtained.
[0077] The above embodiment mentioned that the preset film can be one or more. As a non-limiting example, the following embodiment will illustrate an example case of multiple preset films.
[0078] In another embodiment, another film image correction method is provided. Based on the above embodiment, the above S202 may include the following steps:
[0079] Step A: obtaining a plurality of film color distributions of a plurality of preset films in a first direction.
[0080] In this step, when there are multiple preset films, generally these multiple preset films can be pre-processed into films of the same size, and then the multiple preset films can be arranged. After that, a scanning device can be used to scan the multiple preset films once to obtain corresponding scanned images, and multiple film color distributions of the multiple preset films in the first direction can be obtained through the scanned images.
[0081] Here, when arranging multiple preset films, as an optional embodiment, see Figure 4 As shown, multiple preset films may be arranged in sequence along a second direction perpendicular to the first direction, and each of the multiple preset films corresponds to an irradiation dose. The second direction may be, for example, the scanning direction of the scanning device mentioned above, that is, Figure 3 Considering the width of the scanning device in the first direction, the length of the preset film in the first direction may be greater than or equal to the width of the scanning device to be used in the first direction.
[0082] Here, each preset film can be irradiated with an irradiation dose in advance, and the irradiation doses of each preset film can be different. Here, the maximum dose of the preset film irradiation generally needs to be as close as possible to the sensitivity limit of the film itself, so as to cover all irradiation situations. As a non-limiting specific embodiment, the above-mentioned multiple preset films can be pre-set at the depth of the flat dose distribution in the uniform phantom when irradiated with the preset dose. The uniform phantom here can be, for example, a uniform water phantom, and the depth of the flat dose distribution in the uniform phantom can be obtained based on the basic performance requirements of the radiotherapy equipment (such as a medical electron linear accelerator). The radiotherapy equipment here can be set to irradiate each preset film with a different irradiation dose.
[0083] For the exemplary embodiment in which the above-mentioned multiple preset films are physical films, a plurality of long strips of preset films of the same size can be obtained by cutting a larger physical film in advance. When cutting, it is necessary to pay attention to that the difference between the length of each preset film in the horizontal direction of the scanner and the width of the scanner in the horizontal direction is less than a preset threshold, specifically, the length of the preset film in the horizontal direction needs to be greater than or equal to the width of the scanner in the horizontal direction, so that the color correction curve obtained by the preset film can achieve color error correction of all points in the horizontal direction of the scanner.
[0084] Further, here, when specifically obtaining the color distributions of multiple films of multiple preset films in the first direction, as a non-limiting example, see Figure 5 As shown, the following steps can be used to obtain:
[0085] S302, using a scanning device to scan a plurality of preset films at one time to obtain a single scan image.
[0086] In this step, after arranging multiple preset films and irradiating corresponding doses, a scanning device can be used to scan the multiple preset films at one time to obtain a scanned image, which is recorded as a single scan image. The single scan image includes color data of all preset films.
[0087] S304, based on the single scan image, obtaining a plurality of film color distributions of a plurality of preset films in a first direction.
[0088] In this step, after obtaining a single scan image, a scan image corresponding to each preset film can be obtained from the single scan image, and then the corresponding film color distribution can be determined from the scan image corresponding to each preset film.
[0089] Specifically, when determining the corresponding film color distribution from the scanned image of each preset film, the scanned image of each preset film here is the color data of each preset film after being scanned by the scanning device, and then a group of color data can be selected from the color data of each preset film in accordance with the method in S202 above, and the film color distribution corresponding to the preset film can be obtained through the group of color data of each preset film.
[0090] That is to say, each preset film here corresponds to a film color distribution, that is, the number of film color distributions is the same as the number of preset films. Then, the color correction curve in the first direction of the scanning device can be obtained through the film color distribution of each preset film and the actual dose distribution corresponding to each preset film. In this way, the final color correction curve can be obtained through multiple film color distributions and corresponding actual dose distributions, and the data is more and richer, which can improve the accuracy of the final color correction curve.
[0091] In this embodiment, by obtaining multiple film color distributions of multiple preset films in the first direction, the data richness of the color correction curve can be increased, and the accuracy of the color correction curve obtained subsequently can be improved. Further, by using a scanning device to scan multiple preset films at one time to obtain a single scan image to obtain multiple film color distributions in the first direction, wherein each preset film is arranged in sequence along the scanning direction of the scanning device and each corresponds to an irradiation dose, the film color distribution of films with different irradiation doses can be used to obtain a color correction curve, so that the color correction curve obtained subsequently can cover preset films of more colors as much as possible, thereby improving the accuracy and correction range of the color correction curve.
[0092] In the above embodiment, it is mentioned that the color distribution of the preset film in the first direction of the scanning device can be obtained from the color data of the preset film after one scan. The following is a description of the process of obtaining the film color distribution of a preset film with reference to an exemplary embodiment.
[0093] In another embodiment, another film image correction method is provided. Based on the above embodiment, Figure 6 As shown, the above S202 may include the following steps:
[0094] S402, determining m first elements from the initial film color distribution; wherein m is greater than or equal to 1, and the m first elements correspond to m pixel points in a first direction.
[0095] The initial film color distribution here may be a set of color data selected from the color data of the preset film scanned along the first direction mentioned above, and the set of color data constitutes the initial film color distribution. Generally, when color correction is performed, correction is mainly performed on the flat area, and the initial film color distribution here usually includes color data of the flat area and other surrounding areas, so the color data of the flat area can be selected in the initial film color distribution.
[0096] Specifically, multiple color data located in a flat area may be selected from the initial film color distribution and recorded as m first elements, where m is generally greater than or equal to 1, and generally corresponds to the pixel points of the scanning device in the first direction, that is, the m first elements correspond to the m pixel points in the first direction of the scanning device (the pixel points here can also be considered as probes in the first direction of the scanning device).
[0097] S404, determining film color distribution according to the colors of the m first elements.
[0098] In this step, after obtaining the m first elements in the initial film color distribution, the color data of these m first elements and m points can be used directly as the film color distribution corresponding to the preset film, or the color data of these m points can be subjected to curve fitting, and the obtained fitting curve can be used as the film color distribution corresponding to the preset film, or other methods can be used, which are not specifically limited here.
[0099] It should be noted that in this embodiment, a preset film is mainly used as an example to illustrate how to obtain the corresponding film color distribution. For other preset films, the film color distribution corresponding to each preset film can also be obtained in the above manner or other manners substantially the same as the above manner. In other words, if there are multiple preset films, multiple film color distributions can be obtained, and each preset film corresponds to a film color distribution.
[0100] In this embodiment, m first elements located in a flat area are determined from the initial film color distribution, and then the film color distribution of the preset film is determined by the m first elements. This can reduce the amount of calculation and improve the calculation efficiency while ensuring that the accuracy of the subsequent correction curve is not affected.
[0101] The following describes how to determine the color correction curve based on the m first elements with reference to an exemplary embodiment.
[0102] In another embodiment, another film image correction method is provided. Based on the above embodiment, Figure 7 As shown, the above S204 may include the following steps:
[0103] S502, obtaining m second elements in the real dose distribution; the positions of the m second elements correspond to the positions of the m first elements.
[0104] In this step, corresponding to the m first elements of the above-mentioned preset film, m second elements located in the flat area can be selected in the real dose distribution, and the m second elements here can be m color data / dose data in the real dose distribution.
[0105] In addition, when selecting m second elements in the real dose distribution data, it is generally necessary to correspond to the positions of the m first elements selected above. For example, the above initial color distribution includes 5 color data, which are respectively represented as 11, 12, 13, 14, and 15. The real dose distribution here includes 5 color data, which are respectively represented as 21, 22, 23, 24, and 25. For example, if 3 color data are selected in the initial color distribution, and 12, 13, and 14 are selected, then correspondingly, 3 color data are also selected in the real dose distribution, and they must correspond to the positions of the m first elements, and 22, 23, and 24 should be selected.
[0106] S504, performing normalization processing on the first elements at corresponding positions in the film color distribution according to the m second elements in the real dose distribution, and determining the color correction factor corresponding to each first element in the film color distribution.
[0107] In this step, after obtaining the film color distribution including m first elements and m second elements selected from the actual dose distribution, since both the first elements and the second elements can be color data, the color data of each second element can be used to normalize the color data of the first element at the corresponding position to obtain the normalized processing result corresponding to each first element, and the normalized processing result of each first element can be recorded as the corresponding color correction factor.
[0108] When the normalization processing is specifically performed here, the color data of each first element may be divided by the color data of the second element at the corresponding position to obtain the normalization processing result corresponding to each first element.
[0109] Of course, the m second elements in the film color distribution and the real dose distribution may also be normalized as a whole to obtain an overall normalized result, which includes a normalized result corresponding to each first element.
[0110] For example, assuming that there are n preset films (n is greater than or equal to 1), the n preset films can be normalized as a whole, specifically using the following formula (1):
[0111]
[0112] Among them, profile n (1:m) represents the film color distribution of each of the n preset films, and the film color distribution of each preset film includes m first elements; dose(1:m) represents the m second elements in the actual dose distribution; norm n (1:m) represents the normalized processing results of n preset films.
[0113] S506: Determine a color correction curve according to the color of each first element and the corresponding color correction factor.
[0114] In this step, after obtaining the color correction factor of each first element, the color data of each first element can also be obtained. Then, as an optional embodiment, the relationship curve corresponding to each first element can be determined according to the color of each first element and the corresponding color correction factor; and curve fitting processing can be performed on each relationship curve to determine the color correction curve.
[0115] Specifically, for each preset film, there are m first elements in its film color distribution, each first element has corresponding color data and a corresponding color correction factor, and then a curve fitting can be performed between the color correction factor of each element and the corresponding color data to obtain a relationship curve between the color data and the color correction factor of each first element, and then a curve fitting can be performed on the relationship curves of each first element to obtain a final color correction curve. The color correction curve includes the color correction factor of each pixel position in the first direction of the scanning device.
[0116] For the above method of determining the color correction curve, as an example, the following formula (2) can be used for fitting:
[0117]
[0118] Where f(gray(i)) represents the color correction curve of the first element of the i-th element; norm (1:n) (i) represents the color correction factor (also called normalization result) of the i-th first element in the preset films from 1 to n; profile (1:n) (i) represents the color data of the i-th first element in the preset films from 1 to n; It represents output, that is, curve fitting is performed by the color correction factor of the first element and the corresponding color data to obtain the corresponding color correction curve of the first element.
[0119] Further, after obtaining the color correction curve, other films can be color corrected. As an optional embodiment, the above S206 may include: color correcting the color at the corresponding pixel point in the color distribution of the film to be corrected according to the color correction curve. That is, after obtaining the color correction curve, the color data at the corresponding pixel position in the color distribution of the film to be corrected can be color corrected in sequence according to the correction curve of each element in the color correction curve to obtain the real color distribution corresponding to the film to be corrected, so that the real dose distribution corresponding to the film to be corrected can be obtained through the real color distribution to reflect its real dose distribution and improve the accuracy of the film digital scanning process. As an example, the color distribution of the film to be corrected can be determined by real-time or instant scanning by a scanning device, can be determined based on image data pre-stored in a storage device, and so on. In addition, as an example, the grayscale-dose calibration method described in various standards can be used to obtain the dose distribution according to the color distribution, for example, see YY / T 1548-2017.
[0120] As a non-limiting example, for example, a scanner may be used to scan the film to be corrected to obtain a two-dimensional grayscale image G(x, y). The grayscale correction of each pixel on the two-dimensional grayscale image may be performed using the above-mentioned color correction curve to obtain a corrected grayscale image. The distribution of the grayscale image corresponds to the distribution of the dose. The grayscale correction process may be expressed by the following formula (3):
[0121] New_G(x,y)=G(x,y)×f(gray(i)) (3)
[0122] Wherein, New_G(x,y) represents the corrected grayscale image, G(x,y) represents the two-dimensional grayscale image obtained by scanning the film to be corrected, f(gray(i)) represents the color correction curve obtained by the above formula (2), and × represents the matrix cross product.
[0123] For example, see Figure 8 The curve example diagram of the actual dose distribution and the film color distribution is shown, where the horizontal axis represents the pixel point / pixel position and the vertical axis represents the color data (such as color value or gray value, etc.). The solid line is the film color distribution and the dotted line is the actual dose distribution. It can be seen that the middle area of the actual dose distribution of the dotted line is relatively flat, while the middle area of the film color distribution obtained by scanning is not flat, that is, there is an error between it and the actual dose distribution. Therefore, in this embodiment, the color correction curve between the two is mainly determined so that the actual film color distribution can be corrected to be close to the actual dose distribution.
[0124] In this embodiment, m second elements corresponding to the m first elements of the preset film are selected in the real dose distribution, and the m first elements are normalized by the m second elements to obtain each color correction factor, and then the color correction curve is obtained by the color correction factor of each element. In this way, the elements in the film color distribution are normalized by each element corresponding to the position in the real dose distribution to obtain the color correction curve. This process is simple and effective, so the efficiency and accuracy of obtaining the color correction curve can be improved. Further, by performing curve fitting on each first element in the film color distribution to obtain the final color correction curve, the color correction curve obtained in this way can include the correction curve of each first element, so that other films can be color corrected according to each first element in the future, and the granularity of color correction can be refined, thereby improving the accuracy of color correction.
[0125] A detailed embodiment is given below to illustrate the exemplary technical solution of the present application. Based on the above embodiment, the above method may include the following steps:
[0126] S1, scanning a plurality of preset films at one time using a scanning device to obtain a single scan image; and
[0127] S2, based on a single scan image, determining m first elements from an initial film color distribution; wherein m is greater than or equal to 1, and the m first elements correspond to m pixel points in a first direction; and
[0128] S3, determining the film color distribution according to the colors of the m first elements;
[0129] S4, obtaining m second elements in the real dose distribution; the positions of the m second elements correspond to the positions of the m first elements;
[0130] S5, performing normalization processing on the first elements at corresponding positions in the film color distribution according to the m second elements in the real dose distribution, and determining a color correction factor corresponding to each first element in the film color distribution;
[0131] S6, determining a relationship curve corresponding to each first element according to the color of each first element and the corresponding color correction factor;
[0132] S7, performing curve fitting processing on each relationship curve to determine a color correction curve;
[0133] S8, performing color correction on the color of the corresponding pixel point in the color distribution of the film to be corrected according to the color correction curve.
[0134] 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.
[0135] Based on the same inventive concept, the embodiment of the present application also provides a film image correction device for implementing the film image correction method involved 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 of one or more film image correction device embodiments provided below can refer to the limitations of the film image correction method above, and will not be repeated here.
[0136] In one embodiment, Fig. 9As shown, a film image correction device is provided, comprising: an acquisition module, a determination module and a correction module, wherein:
[0137] An acquisition module, used for acquiring a film color distribution of a preset film in a first direction of a scanning device;
[0138] a determination module, configured to determine a color correction curve in a first direction according to a film color distribution and a true dose distribution corresponding to the film color distribution; and
[0139] The correction module is used to perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0140] In another embodiment, another film image correction device is provided. Based on the above embodiment, the acquisition module may include:
[0141] The acquisition unit is used to acquire a plurality of film color distributions of a plurality of preset films in a first direction.
[0142] Optionally, the preset film is pre-set at a depth where the dose distribution is flat in the uniform phantom when irradiation is performed with a preset dose.
[0143] Optionally, the acquisition unit may include:
[0144] A scanning subunit, used for scanning a plurality of preset films at one time using a scanning device to obtain a single scanned image;
[0145] The acquisition subunit is used to acquire multiple film color distributions of multiple preset films in a first direction based on a single scan image; wherein the multiple preset films are arranged in sequence along a second direction perpendicular to the first direction, and each of the multiple preset films corresponds to an irradiation dose.
[0146] In another embodiment, another film image correction device is provided. Based on the above embodiment, the acquisition module may include:
[0147] A first element acquisition unit, configured to determine m first elements from an initial film color distribution; wherein m is greater than or equal to 1, and the m first elements correspond to m pixel points in a first direction; and
[0148] The color distribution determining unit is used to determine the film color distribution according to the colors of the m first elements.
[0149] In another embodiment, another film image correction device is provided. Based on the above embodiment, the above determination module may include:
[0150] A second element acquisition unit, used for acquiring m second elements in the real dose distribution; the positions of the m second elements correspond to the positions of the m first elements;
[0151] A normalization unit, used to normalize the first elements at corresponding positions in the film color distribution according to the m second elements in the real dose distribution, and determine the color correction factor corresponding to each first element in the film color distribution;
[0152] The curve determination unit is used to determine a color correction curve according to the color of each first element and the corresponding color correction factor.
[0153] Optionally, the curve determination unit may include:
[0154] A relationship curve determination subunit, used to determine a relationship curve corresponding to each first element according to the color of each first element and the corresponding color correction factor;
[0155] The fitting subunit is used to perform curve fitting processing on each relationship curve to determine the color correction curve.
[0156] In another embodiment, another film image correction device is provided. Based on the above embodiment, the correction module is specifically used to perform color correction on the color of corresponding pixel points in the color distribution of the film to be corrected according to the color correction curve.
[0157] Each module in the above-mentioned film image correction device can be implemented in whole or in part by software, hardware or 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.
[0158] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0159] Acquire a film color distribution of a preset film in a first direction of a scanning device; determine a color correction curve in the first direction according to the film color distribution and a true dose distribution corresponding to the film color distribution; and perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0160] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0161] A plurality of film color distributions of a plurality of preset films in a first direction are obtained.
[0162] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0163] A scanning device is used to scan multiple preset films at one time to obtain a single scan image; and based on the single scan image, multiple film color distributions of the multiple preset films in a first direction are obtained; wherein the multiple preset films are arranged in sequence along a second direction perpendicular to the first direction, and each of the multiple preset films corresponds to an irradiation dose.
[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0165] Determine m first elements from the initial film color distribution; wherein m is greater than or equal to 1, and the m first elements correspond to m pixels in a first direction; and determine the film color distribution according to the colors of the m first elements.
[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0167] Obtain m second elements in the real dose distribution; the positions of the m second elements correspond to the positions of the m first elements; normalize the first elements at the corresponding positions in the film color distribution according to the m second elements in the real dose distribution, and determine the color correction factor corresponding to each first element in the film color distribution; and determine the color correction curve according to the color of each first element and the corresponding color correction factor.
[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0169] According to the color of each first element and the corresponding color correction factor, a relationship curve corresponding to each first element is determined; and a curve fitting process is performed on each relationship curve to determine a color correction curve.
[0170] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0171] Color correction is performed on the colors of corresponding pixels in the color distribution of the film to be corrected according to the color correction curve.
[0172] In one embodiment, the preset film is pre-set at a depth where the dose distribution is flat in the uniform phantom when irradiation is performed with a preset dose.
[0173] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0174] Acquire a film color distribution of a preset film in a first direction of a scanning device; determine a color correction curve in the first direction according to the film color distribution and a true dose distribution corresponding to the film color distribution; and perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0176] A plurality of film color distributions of a plurality of preset films in a first direction are obtained.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] A scanning device is used to scan multiple preset films at one time to obtain a single scan image; and based on the single scan image, multiple film color distributions of the multiple preset films in a first direction are obtained; wherein the multiple preset films are arranged in sequence along a second direction perpendicular to the first direction, and each of the multiple preset films corresponds to an irradiation dose.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] Determine m first elements from the initial film color distribution; wherein m is greater than or equal to 1, and the m first elements correspond to m pixels in a first direction; and determine the film color distribution according to the colors of the m first elements.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0182] Obtain m second elements in the real dose distribution; the positions of the m second elements correspond to the positions of the m first elements; normalize the first elements at the corresponding positions in the film color distribution according to the m second elements in the real dose distribution, and determine the color correction factor corresponding to each first element in the film color distribution; and determine the color correction curve according to the color of each first element and the corresponding color correction factor.
[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0184] According to the color of each first element and the corresponding color correction factor, a relationship curve corresponding to each first element is determined; and a curve fitting process is performed on each relationship curve to determine a color correction curve.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0186] Color correction is performed on the colors of corresponding pixels in the color distribution of the film to be corrected according to the color correction curve.
[0187] In one embodiment, the preset film is pre-set at a depth where the dose distribution is flat in the uniform phantom when irradiation is performed with a preset dose.
[0188] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0189] Acquire a film color distribution of a preset film in a first direction of a scanning device; determine a color correction curve in the first direction according to the film color distribution and a true dose distribution corresponding to the film color distribution; and perform color correction on the color distribution of the film to be corrected according to the color correction curve.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0191] A plurality of film color distributions of a plurality of preset films in a first direction are obtained.
[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0193] A scanning device is used to scan multiple preset films at one time to obtain a single scan image; and based on the single scan image, multiple film color distributions of the multiple preset films in a first direction are obtained; wherein the multiple preset films are arranged in sequence along a second direction perpendicular to the first direction, and each of the multiple preset films corresponds to an irradiation dose.
[0194] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0195] Determine m first elements from the initial film color distribution; wherein m is greater than or equal to 1, and the m first elements correspond to m pixels in a first direction; and determine the film color distribution according to the colors of the m first elements.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] Obtain m second elements in the real dose distribution; the positions of the m second elements correspond to the positions of the m first elements; normalize the first elements at the corresponding positions in the film color distribution according to the m second elements in the real dose distribution, and determine the color correction factor corresponding to each first element in the film color distribution; and determine the color correction curve according to the color of each first element and the corresponding color correction factor.
[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0199] According to the color of each first element and the corresponding color correction factor, a relationship curve corresponding to each first element is determined; and a curve fitting process is performed on each relationship curve to determine a color correction curve.
[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0201] Color correction is performed on the colors of corresponding pixels in the color distribution of the film to be corrected according to the color correction curve.
[0202] In one embodiment, the preset film is pre-set at a depth where the dose distribution is flat in the uniform phantom when irradiation is performed with a preset dose.
[0203] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all data fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0204] 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.
[0205] 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.
[0206] 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 understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations 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. A film image correction method, characterized in that: The method comprises: Acquire a film color distribution of a preset film in a first direction of a scanning device; determining a color correction curve in the first direction according to the film color distribution and a true dose distribution corresponding to the film color distribution; and Color correction is performed on the color distribution of the film to be corrected according to the color correction curve.
2. The film image correction method according to claim 1, characterized in that: The step of obtaining the color distribution of a preset film in a first direction of a scanning device includes: A plurality of film color distributions of a plurality of preset films in the first direction are obtained.
3. The film image correction method according to claim 2, characterized in that: The step of obtaining a plurality of film color distributions of a plurality of preset films in the first direction includes: Scanning the plurality of preset films once using a scanning device to obtain a single scan image; and Based on the single scan image, the plurality of film color distributions of the plurality of preset films in the first direction are acquired.
4. The film image correction method according to claim 1, characterized in that: The step of obtaining the color distribution of a preset film in a first direction of a scanning device includes: Determine m first elements from the initial film color distribution; wherein m is greater than or equal to 1, and the m first elements correspond to m pixel points in the first direction; and The film color distribution is determined according to the colors of the m first elements.
5. The film image correction method according to claim 4, characterized in that: The step of determining the color correction curve in the first direction according to the film color distribution and the real dose distribution corresponding to the film color distribution comprises: Acquire m second elements in the real dose distribution; positions of the m second elements correspond to positions of the m first elements; Normalizing the first elements at corresponding positions in the film color distribution according to the m second elements in the real dose distribution to determine a color correction factor corresponding to each of the first elements in the film color distribution; and The color correction curve is determined according to the color of each of the first elements and the corresponding color correction factor.
6. The film image correction method according to claim 5, characterized in that: The step of determining the color correction curve according to the color of each of the first elements and the corresponding color correction factor includes: Determining a relationship curve corresponding to each of the first elements according to the color of each of the first elements and the corresponding color correction factor; and Curve fitting processing is performed on each of the relationship curves to determine the color correction curve.
7. The film image correction method according to claim 5, characterized in that: The color correction of the color distribution of the film to be corrected according to the color correction curve comprises: Color correction is performed on the colors of corresponding pixels in the color distribution of the film to be corrected according to the color correction curve.
8. The film image correction method according to claim 1, characterized in that: The preset film is pre-set at a depth where the dose distribution is flat in the uniform phantom when irradiation is performed with a preset dose.
9. A film image correction device, characterized in that: The device comprises: An acquisition module, used for acquiring a film color distribution of a preset film in a first direction of a scanning device; a determination module, configured to determine a color correction curve in the first direction according to the film color distribution and a real dose distribution corresponding to the film color distribution; and The correction module is used to perform color correction on the color distribution of the film to be corrected according to the color correction curve.
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 film image correction method according to any one of claims 1 to 8 are implemented.