An image color correction method based on characteristic color fitting in virtual dimensional space

Through the image color correction method fitted in virtual dimension space, using the Delaunay algorithm and the whole-domain mapping table, the limitations of the color reduction method in the existing technology in the full-domain corresponding calculation are solved, and the color reduction with higher accuracy is achieved , suitable for the digitalization of cultural relics and other fields.

CN114581582BActive Publication Date: 2024-11-08ZHEJIANG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210208199.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-04
Publication Date
2024-11-08
Estimated Expiration
2042-03-04

AI Technical Summary

Technical Problem

The existing color restoration methods have limitations in the calculation of the full color gamut corresponding to it, and cannot fully match more mapping points, resulting in insufficient accuracy of color restoration, especially in the fields of digitalization of cultural relics.

Method used

Using the image color correction method based on feature colors fitting in virtual dimension space, the color data set is constructed by obtaining the color card and subject RGB data, and the tetrahedron is divided using the three-dimensional space Delaunay algorithm to calculate the corrected RGB value of each point. , establish a global mapping table to achieve color correction of the entire image.

Benefits of technology

It improves the accuracy of color restoration, retains the relevance and spatial continuity of RGB channels, and is suitable for high-demand color restoration tasks, such as digitization of cultural relics, which significantly improves the accuracy and work efficiency of color research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114581582B_ABST
    Figure CN114581582B_ABST
Patent Text Reader

Abstract

The present invention discloses an image color correction method based on fitting of characteristic colors in a virtual dimensional space. Compared with the existing color restoration method, the technical method of the present invention can more accurately locate the area of ​​color to be restored, and restore it using high-precision measuring equipment, and use the interpolation space interpolation algorithm to retain the correlation of the three RGB channels and the continuity of the spatial interpolation, which can better retain the original color hierarchy, rather than simply using a linear interpolation algorithm. The present invention focuses on solving the technical difficulties in specific fields such as cultural relics digitization that require high color restoration, and its application is of great significance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of digital image color restoration correction, and in particular relates to a color restoration method based on a color card and multiple characteristic colors of a photographed object in a certain color space. Background Art

[0002] As a form of reproduction of physical objects, images are widely used in the field of computer use. However, the color difference between the collected images and the physical objects varies due to the different acquisition devices. This requires technology to correct this color difference, which leads to color restoration methods. Image color restoration methods have a wide range of applications and influences in various industries today, especially in industries that focus on color research, such as cultural relics digitization, machine vision, printing and other fields, which are in urgent need. A good image color restoration method can effectively improve the work efficiency and research accuracy in the above fields.

[0003] In response to the above needs, a large number of researchers have devoted their efforts to color restoration technology, and each has given their own research conclusions in different fields, different routes, and different levels.

[0004] However, most color restoration methods given by researchers have great limitations. For example, the color restoration given by the conversion matrix method uses variance as evaluation data, which cannot fully correspond to the correspondence of existing collection points, let alone other difference data. Other technologies only consider local color correspondence restoration and do not perform full color gamut correspondence calculations. In response to the above problems, a color restoration method that covers the entire color gamut and fully matches more mapping points is needed to improve the accuracy of color restoration. Summary of the invention

[0005] The purpose of the present invention is to solve the problems existing in the prior art and provide an image color correction method based on characteristic color fitting in a virtual dimensional space.

[0006] The specific technical solutions adopted by the present invention are as follows:

[0007] A method for image color correction based on characteristic color fitting in a virtual dimensional space comprises the following steps:

[0008] S1, obtaining a color card image and a subject image obtained by respectively capturing the color card and the subject by the same imaging device under the same light source, wherein the absolute value of the deviation between the RGB value of the gray color block or the white color block on the color card image and the official standard value of the same color block in the target RGB color space at the target color temperature does not exceed a threshold;

[0009] S2. For each characteristic color area on the surface of the object with uniform color distribution, the measuring instrument collects the RGB data of the area in the target RGB color space as standard data, and extracts the average RGB data of the area from the image of the object as the data to be restored; for each color block on the color card, the official standard value of the color block in the target RGB color space is used as the standard data, and the average RGB data of the color block in the color card image is used as the data to be restored; all the data to be restored and all the standard data of the object and the color card are constructed into a color data set with a mapping relationship, and all the data to be restored and all the standard data in the color data set are normalized respectively;

[0010] S3. Add all normalized data to be restored in the color data set as coordinate points into a three-dimensional RGB color space with R, G, and B channels as three coordinate axes. All data to be restored are located in a cube with (0,0,0), (0,0,1), (0,1,0), (1,0,0), (1,1,0), (1,0,1), (0,1,1), and (1,1,1) as vertices in the space.

[0011] S4, using a three-dimensional space Delaunay algorithm to divide all coordinate points including 8 vertices in the cube, so that every four coordinate points form a space tetrahedron;

[0012] S5, traverse each point in the entire domain of the target RGB color space, correct each current traversal point P with an initial RGB value of (r, g, b) and obtain a corrected RGB value (r', g', b'), and then construct a mapping table by denormalizing the initial RGB values ​​and the corrected RGB values ​​of all points in the entire domain of the target RGB color space; wherein, the correction method for each current traversal point P is:

[0013] First, determine the spatial tetrahedron W where point P is located, and obtain the four vertices of tetrahedron W, which are A(ar, ag, ab), B(br, bg, bb), C(cr, cg, cb), and D(dr, dg, db); then determine the intersection E of line AP and surface BCD, the intersection F of line BP and surface ACD, the intersection G of line CP and surface ABD, and the intersection H of line DP and surface ABC according to the spatial geometric relationship, so as to obtain the coefficient value k=1 / (PE / AE+PF / BF+PG / CG+PH / DH); finally, calculate the corrected RGB value (r', g', b') of point P as follows:

[0014] r'=rk*PE / AE*(ar-a'r')-k*PF / BF*(br-b'r')-k*PG / CG*(cr-c'r')-k*PH / DH*(dr-d'r')

[0015] g'=rk*PE / AE*(ag-a'g')-k*PF / BF*(bg-b'g')-k*PG / CG*(cg-c'g')-k*PH / DH*(dg-d'g')

[0016] b'=rk*PE / AE*(ab-a'b')-k*PF / BF*(bb-b'b')-k*PG / CG*(cb-c'b')-k*PH / DH*(db-d'b')

[0017] S6, traversing each pixel in the object image, taking the RGB value of each pixel as the initial RGB value, finding the corresponding corrected RGB value from the mapping table and performing correction, thereby completing the correction of the entire object image.

[0018] Preferably, in S1, the light source and imaging device used for capturing images of the color card and the subject need to be pre-adjusted in parameters so that the absolute value of the deviation between the RGB mean of the gray block or the white block on the color card image and the official standard mean of the same block in the target RGB color space at the target color temperature does not exceed a threshold.

[0019] Preferably, the imaging device is a camera or a scanner.

[0020] Preferably, the threshold is 2-5.

[0021] Preferably, the measuring instrument comprises a colorimeter or a spectrophotometer, and if the data directly collected by the measuring instrument is not RGB data in the target RGB color space, it needs to be converted into RGB data in the target RGB color space.

[0022] Preferably, the target color temperature is D65 color temperature.

[0023] Preferably, the target RGB color space is sRGB color space.

[0024] Preferably, the normalization operation is to divide the RGB three-channel values ​​by 255 respectively.

[0025] Preferably, the denormalization operation is to multiply the RGB three-channel values ​​by 255 respectively.

[0026] Preferably, in S5, the method for determining the point P in the space tetrahedron W is:

[0027] Traverse each spatial tetrahedron in the cube, and for each currently traversed spatial tetrahedron, obtain the intersection H of the straight line DP and the face ABC, the intersection E of the straight line AP and the face BCD, the intersection F of the straight line BP and the face ACD, and the intersection G of the straight line CP and the face ABD. If the four equations DH=PH+DP, BF=FP+PB, CG=GP+PC and AE=PE+AP are satisfied at the same time, it means that P is in the currently traversed spatial tetrahedron.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] Compared with the existing color restoration method, the technical method of the present invention can more accurately find the area of ​​color to be restored, and restore it using high-precision measurement equipment. The interpolation space interpolation algorithm is used to retain the correlation of the three RGB channels and the continuity of spatial interpolation, which can better retain the original color hierarchy, rather than simply using a linear interpolation algorithm. This method focuses on solving the technical difficulties of high color restoration requirements in specific fields such as cultural relics digitization, and the technical application of the present invention is of great significance. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of each point of the space tetrahedron;

[0031] Figure 2 It is a schematic diagram of cutting a cube into local space tetrahedrons in the embodiment. DETAILED DESCRIPTION

[0032] The present invention is further described and illustrated below in conjunction with the accompanying drawings and specific embodiments. The technical features of each embodiment of the present invention can be combined accordingly without conflicting with each other.

[0033] In a preferred implementation of the present invention, a method for image color correction based on characteristic color fitting in a virtual dimensional space is provided, which comprises the following steps:

[0034] S1. Acquire a color card image and a subject image obtained by respectively capturing the color card and the subject by the same imaging device under the same light source, wherein the absolute value of the deviation between the RGB value of the gray color block or the white color block on the color card image and the official standard value of the same color block in the target RGB color space at the target color temperature does not exceed a threshold.

[0035] It should be noted that before using a light source and an imaging device to capture images of the color card and the subject, it is necessary to adjust the parameters of the light source and the imaging device in advance so that the absolute value of the deviation between the RGB mean (average of three channels) of the gray or white color block on the color card image and the official standard mean of the same color block in the target RGB color space at the target color temperature does not exceed the threshold. The color block on the color card image used for threshold determination can be any gray color block or a white color block, and a white color block is recommended. Use photoshop or other image inspection software. The imaging device used in the present invention can be a camera or a scanner.

[0036] In addition, the threshold value in the present invention can be optimized according to actual conditions, but should not be too large to ensure the quality of image acquisition. The threshold value range is preferably 2 to 5, and 2 is recommended.

[0037] In addition, the target color temperature and the target RGB color space in the present invention are determined according to actual conditions and are not limited. As an implementation method, the target color temperature is preferably D65 color temperature, and the target RGB color space is preferably sRGB color space.

[0038] It should be noted that the subject in the present invention refers to a target object that needs to be subjected to image color correction, and its specific type needs to be determined according to the actual application scenario.

[0039] In addition, the color card used in the present invention is not limited. As an implementation method, the color card uses the X-Rite 24-color color card.

[0040] S2. For each characteristic color area with uniform color distribution on the surface of the object, the measuring instrument collects the RGB data of the area in the target RGB color space as standard data, and extracts the average RGB data of the area from the object image as the data to be restored; for each color block on the color card, the official standard value of the color block in the target RGB color space is used as the standard data, and the average RGB data of the color block in the color card image is used as the data to be restored; all the data to be restored and all the standard data of the object and the color card are constructed into a color data set with a mapping relationship, and all the data to be restored and all the standard data in the color data set are normalized respectively.

[0041] It should be noted that the characteristic color mentioned in the present invention refers to the characteristic color of the surface of the object, and such characteristic colors include colors that occupy a larger area and colors that occupy a smaller area but have obvious distinction. Since the more characteristic colors of the surface of the object are extracted, the more accurate the color restoration will be later. Therefore, as a preferred implementation method, all colors whose surface area of ​​the object exceeds the minimum area required for accurate measurement by the measuring instrument can be used as characteristic colors, and the measuring instrument selects an area with uniform color distribution for each characteristic color to measure the RGB data.

[0042] As an implementation method, since the range of RGB channel values ​​is 0 to 255, the normalization operation is to divide the RGB channel values ​​by 255 respectively. For example, if one set of RGB data is (R, G, B), the normalized data is (R / 255, G / 255, B / 255).

[0043] In the present invention, the measuring instrument can be a colorimeter or a spectrophotometer or other instrument. However, it should be noted that some measuring instruments (such as a colorimeter) cannot directly collect RGB data in the target RGB color space. The data collected is spectral reflectance data or CIELAB data under the target color temperature. For such measuring instruments, if the data directly collected by the measuring instrument is not RGB data in the target RGB color space, it is necessary to convert the original collected data into RGB data in the target RGB color space according to the corresponding conversion formula. However, for equipment such as a spectrophotometer, it can directly measure the RGB data in the target RGB color space, so no conversion is required.

[0044] S3. Add all normalized data to be restored in the color data set as coordinate points into a three-dimensional RGB color space with R, G, and B channels as three coordinate axes. All data to be restored are located in a cube with (0,0,0), (0,0,1), (0,1,0), (1,0,0), (1,1,0), (1,0,1), (0,1,1), and (1,1,1) as vertices.

[0045] It should be noted that the three coordinate axes in the three-dimensional RGB color space are the R, G, and B channels of the RGB color space, and the origin is (0,0,0). Since the data to be restored in the aforementioned color data set have been normalized, they must be in the aforementioned cube. In all the normalized data to be restored in the color data set, the R, G, and B channel values ​​of each set of data are used as three coordinates to determine the coordinate points in a cube. In the present invention, the 8 vertices of the cube are actually also used as standard data, but the deviation of these 8 vertices is 0, that is, its standard data is equivalent to the data to be restored.

[0046] S4. Using the three-dimensional space Delaunay algorithm, all coordinate points including the eight vertices in the cube are divided, and every four coordinate points form a space tetrahedron.

[0047] It should be noted that the three-dimensional space Delaunay algorithm is a Delaunay algorithm formed by generalizing the two-dimensional Delaunay algorithm to the three-dimensional space, and its specific implementation method belongs to the prior art. As an implementation method, the 3D Delaunay algorithm of the VTK library can be directly called to implement it. In addition to all the normalized data to be restored in the color data set, the 8 vertices in the cube are also included in the division of the three-dimensional space Delaunay algorithm.

[0048] S5. Traverse each point in the entire domain of the target RGB color space, correct each current traversal point P with an initial RGB value of (r, g, b) and obtain the corrected RGB value (r', g', b'), that is, the coordinates (r', g', b') of the corrected point P', and then construct a mapping table by denormalizing the initial RGB values ​​and the corrected RGB values ​​of all points in the entire domain of the target RGB color space.

[0049] Among them, the correction method for each current traversal point P is:

[0050] First, determine the spatial tetrahedron W where point P is located, and obtain the four vertices of tetrahedron W, which are A(ar, ag, ab), B(br, bg, bb), C(cr, cg, cb), and D(dr, dg, db); then determine the intersection E of line AP and surface BCD, the intersection F of line BP and surface ACD, the intersection G of line CP and surface ABD, and the intersection H of line DP and surface ABC according to the spatial geometric relationship, so as to obtain the coefficient value k=1 / (PE / AE+PF / BF+PG / CG+PH / DH); finally, calculate the corrected RGB value (r', g', b') of point P as follows:

[0051] r'=rk*PE / AE*(ar-a'r')-k*PF / BF*(br-b'r')-k*PG / CG*(cr-c'r')-k*PH / DH*(dr-d'r')

[0052] g'=rk*PE / AE*(ag-a'g')-k*PF / BF*(bg-b'g')-k*PG / CG*(cg-c'g')-k*PH / DH*(dg-d'g')

[0053] b'=rk*PE / AE*(ab-a'b')-k*PF / BF*(bb-b'b')-k*PG / CG*(cb-c'b')-k*PH / DH*(db-d'b')

[0054] It should be noted that PE, AE, PF, BF, PG, CG, PH, and DH in the above formulas all represent the length values ​​of line segments PE, AE, PF, BF, PG, CG, PH, and DH, that is, the distance values ​​between the two endpoints of the line segments, which can be calculated based on the coordinates of each point.

[0055] It should be noted that in the above mapping table, each set of mapping data corresponds to the coordinates (r', g', b') of a point P and the coordinates (r', g', b') of a point P', and the two coordinates are respectively denormalized as two associated values ​​in a set of mapping data.

[0056] It should be noted that the entire target RGB color space is composed of a series of discrete points. Since the range of the RGB three-channel values ​​is 0 to 255, and the values ​​are all integers, the number of points in the entire target RGB color space is 256×256×256. The entire mapping table contains 256×256×256 groups of mapping data.

[0057] As an implementation method, since the range of RGB three channel values ​​is 0 to 255, the denormalization operation is to divide the RGB three channel values ​​by 255. That is to say, each set of mapping data in the above mapping table consists of (255*r', 255*g', 255*b') and (255*r', 255*g', 255*b').

[0058] As an implementation method, the method for determining the point P in the space tetrahedron W is:

[0059] Traverse each spatial tetrahedron in the cube, and for each currently traversed spatial tetrahedron, obtain the intersection H of the straight line DP and the face ABC, the intersection E of the straight line AP and the face BCD, the intersection F of the straight line BP and the face ACD, and the intersection G of the straight line CP and the face ABD. If the four equations DH=PH+DP, BF=FP+PB, CG=GP+PC and AE=PE+AP are satisfied at the same time, it means that P is in the currently traversed spatial tetrahedron.

[0060] S6, traversing each pixel in the object image, taking the RGB value of each pixel as the initial RGB value, finding the corresponding corrected RGB value from the mapping table and performing correction, thereby completing the correction of the entire object image.

[0061] Thus, through the above S1 to S6, image color correction can be achieved based on the color card and the characteristic color of the object. Since the method establishes a mapping table covering the full color gamut, more mapping points can be completely matched, thereby improving the accuracy of color restoration. In order to better demonstrate the advantages of the present invention, it is applied to a specific example below to reflect its technical effects.

[0062] Example

[0063] In this embodiment, a certain digitized scene of calligraphy and painting cultural relics is used as the application scene. First, the environment for shooting cultural relics images is arranged to ensure that the ambient light source does not change during the shooting, and the lighting source is uniform for the main part of the cultural relics. Only one camera is used during the whole shooting process. Before starting to shoot, you first need to determine the RGB data (RGB value 0 to 255) under which color temperature and color space you want to restore the color of the picture. In the general application field of cultural relics display, this embodiment selects D65 color temperature as the target color temperature and sRGB color space as the target RGB color space.

[0064] In this embodiment, the image color correction method based on characteristic color fitting in virtual dimensional space includes the following steps:

[0065] Step 1: When starting to shoot, first place the X-Rite 24-color color card at the location where the subsequent cultural relics will be placed, adjust the light source and camera parameters, collect the color card image, and obtain the raw format color card image data.

[0066] Step 2: Use Photoshop to convert the raw color card image into a tiff image in the sRGB color space, and then check the RGB value of the 24th white color block on the color card image. At the same time, find the RGB standard value of the sRGB color space at the D65 color temperature given by the official X-Rite color card (243, 243, 242). In this way, the deviation of the RGB value of the white color block on the color card can be compared with the standard value in the sRGB color space at the target color temperature provided by the official. If the absolute value of the deviation between the RGB three-channel mean of the white color block on the color card image and the three-channel mean of the RGB standard value is greater than 2, adjust the light intensity and camera parameters, and repeat step 1 until the absolute value of the above deviation of the captured color card image is less than or equal to 2, which means that this color card image meets the requirements, retain the color card image (record the light source and camera parameters at this time as the first parameter), and at the same time, the average RGB value of each color block on the color card image is used as the data to be restored, and the RGB standard value in the sRGB color space at the D65 color temperature provided by the official color card is used as the standard data.

[0067] Step 3: Put away the color card and spread out the calligraphy and painting cultural relics. Under the condition that the light source and camera parameters remain unchanged (i.e., the first parameter mentioned above is used), use the camera to photograph the calligraphy and painting cultural relics to obtain the calligraphy and painting cultural relics image to be restored.

[0068] Step 4: Check the physical color of the surface of the photographed painting and calligraphy artifacts, and use a colorimeter as a measuring instrument to extract CIELab color space data at D65 color temperature and 2° observation angle in the characteristic color area with uniform color distribution on the surface of the artifact. When measuring, the characteristic color area of ​​the selected painting and calligraphy artifact image should cover all measurable color types on the painting and calligraphy artifacts as much as possible. The more characteristic colors of the photographed or scanned object are extracted, the more accurate the color restoration will be in the later stage.

[0069] Step 5: Convert the CIELab color space data obtained in step 4 into RGB data in the sRGB color space at D65 color temperature through the conversion formula.

[0070] Step 6: Find the characteristic color area in the calligraphy and painting cultural relic image obtained in step 3 that is the same as that in step 4, and extract the average RGB value of each characteristic color area in the image, that is, average the R, G, and B values ​​of all pixels in each characteristic color area to form an average RGB value.

[0071] Step 7: For each characteristic color area with uniform color distribution on the surface of the calligraphy and painting cultural relic, the RGB data obtained in step 5 is used as the standard data, and the RGB data obtained in step 6 is used as the data to be restored. At the same time, since the standard data and the data to be restored of the color card are also obtained for each color block on the color card in the aforementioned step 2, the official standard value of the color block in the target RGB color space is used as the standard data, and the average RGB data of the color block in the color card image is used as the data to be restored.

[0072] Step 8: Construct all the data to be restored and all the standard data of the calligraphy and painting cultural relics and color cards into a color data set with a mapping relationship, and normalize all the data to be restored in the color data set, and normalize all the standard data in the color data set. The specific normalization method is to divide the RGB three-channel values ​​by 255 respectively. Thus, each set of data in the color data set corresponds to the normalized data to be restored and the normalized standard data of a color block or a characteristic color area, and the mapping relationship can be stored in a table.

[0073] Step 9: Create a three-dimensional space in the sRGB color space with R, G, and B channels as coordinate axes.

[0074] Step 10: In the three-dimensional space established in step 9, establish a closed cube with coordinate points (0, 0, 0), (0, 0, 1), (0, 1, 0), (1, 0, 0), (1, 1, 0), (1, 0, 1), (0, 1, 1), (1, 1, 1) as vertices.

[0075] Step 11: The coordinates of the eight vertices of the above cube are also used as standard data, and each vertex is also used as data to be restored. The deviation between the standard data of these eight vertices and the data to be restored is 0, so interpolation fitting can be performed inside this cube.

[0076] Step 12: Add all normalized data to be restored in the color data set as coordinate points into the cube of step 10, that is, use each set of normalized R, G, B values ​​as the x, y, z axis coordinates of the spatial coordinate system.

[0077] Step 13: Use the three-dimensional space Delaunay algorithm to divide the above cube, and divide all the coordinate points in the cube including 8 vertices into a space tetrahedron with 4 coordinate points as a group of vertices. Finally, all areas in the cube are divided into space tetrahedrons, and each coordinate point is located in a space tetrahedron. In this embodiment, the normalized RGB values ​​of all the above 24 color blocks, all the normalized data to be restored of the calligraphy and painting cultural relics, and the values ​​of the 8 vertices are used as coordinates to directly call the 3DDelaunay algorithm of the VTK library to cut into different space tetrahedrons, such as Figure 2 shown.

[0078] These spatial tetrahedrons can be used to achieve full color gamut correction of the sRGB color space. The principle is as follows:

[0079] For any point P(r, g, b) in the cube, to determine its corrected value P'(r', g', b'), we first need to determine the tetrahedron W where the point P is located (e.g. Figure 1), the four vertices of tetrahedron W are A(ar, ag, ab), B(br, bg, bb), C(cr, cg, cb), D(dr, dg, db) (known points to be corrected). The standard points corresponding to these four vertices are A'(a'r', a'g', a'b'), B'(b'r', b'g', b'b'), C'(c'r', c'g', c'b'), D'(d'r', d'g', d'b') (known standard points). Assume that the straight line AP intersects with the plane BCD to form point E, the straight line BP intersects with the plane ACD to form point F, the straight line CP intersects with the plane ABD to form point G, and the straight line DP intersects with the plane ABC to form point H. Therefore, k*PE / AE is used as the correction weight for point A, k*PF / BF is used as the correction weight for point B, k*PG / CG is used as the correction weight for point C, and k*PH / DH is used as the correction weight for point D.

[0080] To calculate one of the weights PH / DH, first determine a plane equation u*x+v*y+w*z+j=0 through known points A, B, and C, then determine a straight line from known points D and P. The intersection of this straight line with plane ABC can determine the coordinates of point H as (hr, hg, hb). The known coordinates of points P and H can determine the length of PH, and the known coordinates of points D and H can determine the length of DH. The other three weights can also be obtained by the above method, and the total weight calculation formula is k*(PE / AE+PF / BF+PG / CG+PH / DH)=1. The k value can be obtained according to the total weight calculation formula. Using these weights calculated based on the k value, the problem of smooth correction of two adjacent tetrahedral data corrections can be solved. The point after point P is corrected is recorded as P', and the calculation formula for its coordinates (r', g', b') is:

[0081] r'=rk*PE / AE*(ar-a'r')-k*PF / BF*(br-b'r')-k*PG / CG*(cr-c'r')-k*PH / DH*(dr-d'r')

[0082] g'=rk*PE / AE*(ag-a'g')-k*PF / BF*(bg-b'g')-k*PG / CG*(cg-c'g')-k*PH / DH*(dg-d'g')

[0083] b'=rk*PE / AE*(ab-a'b')-k*PF / BF*(bb-b'b')-k*PG / CG*(cb-c'b')-k*PH / DH*(db-d'b')

[0084] In actual execution of this embodiment, each point in the entire sRGB color space is traversed, and each current traversal point P with an initial RGB value of (r, g, b) is corrected to obtain a corrected RGB value (r', g', b'), wherein the correction method for each current traversal point P is:

[0085] First, determine the spatial tetrahedron W where point P is located, and obtain the four vertices of tetrahedron W, which are A(ar, ag, ab), B(br, bg, bb), C(cr, cg, cb), and D(dr, dg, db); then determine the intersection E of the straight line AP and the surface BCD, the intersection F of the straight line BP and the surface ACD, the intersection G of the straight line CP and the surface ABD, and the intersection H of the straight line DP and the surface ABC according to the spatial geometric relationship, so as to obtain the coefficient value k=1 / (PE / AE+PF / BF+PG / CG+PH / DH); finally, calculate the corrected RGB value (r', g', b') of point P, and the calculation formula of the coordinates (r', g', b') of point P' is as described above.

[0086] Among them, the method for determining the point P in the space tetrahedron W is:

[0087] Traverse each spatial tetrahedron in the cube, and for each currently traversed spatial tetrahedron, obtain the intersection H of the straight line DP and the face ABC, the intersection E of the straight line AP and the face BCD, the intersection F of the straight line BP and the face ACD, and the intersection G of the straight line CP and the face ABD. If the four equations DH=PH+DP, BF=FP+PB, CG=GP+PC and AE=PE+AP are satisfied at the same time, it means that P is in the currently traversed spatial tetrahedron.

[0088] Step 14: Denormalize the initial RGB values ​​and corrected RGB values ​​of all points in the entire sRGB color space. Denormalization here means multiplying both the initial RGB values ​​and the corrected RGB values ​​by 255. Thus, the P(R,G,B) values ​​of all points in the entire sRGB color space are given, and after correction, P'(R',G',B') is obtained.

[0089] One-to-one correspondence, a global mapping table with a total mapping data number of 256×256×256 is established.

[0090] Step 15: Use the above mapping table to batch restore the calligraphy and painting cultural relics image data collected in step 3. The specific method is to traverse each pixel in the calligraphy and painting cultural relics image, use the RGB value of each pixel as the initial RGB value to find the corresponding corrected RGB value from the mapping table for correction, and after the traversal is completed, the color correction of the entire image is completed.

[0091] Experiments show that, given a photographed image of a painting or calligraphy artifact, the new color obtained after correction and restoration using the above mapping table is closer to the color of the artifact under the D65 color temperature.

[0092] Moreover, in the above correction and restoration process, if more characteristic colors of cultural relics are collected, the restored data will be more accurate. When all characteristic colors on the cultural relics are collected and restored, the image can be corrected to be very close to the color of the cultural relics under the D65 color temperature.

[0093] Of course, in the above implementation project, data under different color temperatures can be selected as standard values, such as another commonly used color temperature D50. The degree of restoration is also based on 100% deviation data as the restoration basis, and another ratio is set to reduce the degree of restoration, the purpose is to optimize the smoothness of the restored image, and to avoid image tearing under extremely small probability.

[0094] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. An image color correction method based on characteristic color fitting in virtual dimensional space, characterized in that: The following steps are involved: S1, obtaining a color card image and a subject image obtained by respectively capturing the color card and the subject by the same imaging device under the same light source, wherein the absolute value of the deviation between the RGB value of the gray color block or the white color block on the color card image and the official standard value of the same color block in the target RGB color space at the target color temperature does not exceed a threshold; S2, for each characteristic color area with uniform color distribution on the surface of the object, the measuring instrument collects RGB data of the area in the target RGB color space as standard data, and extracts average RGB data of the area from the object image as data to be restored; For each color block on the color card, the official standard value of the color block in the target RGB color space is used as the standard data, and the average RGB data of the color block in the color card image is used as the data to be restored; Constructing all the data to be restored and all the standard data of the object and the color card into a color data set with a mapping relationship, and normalizing all the data to be restored and all the standard data in the color data set respectively; S3. Add all normalized data to be restored in the color data set as coordinate points into a three-dimensional RGB color space with R, G, and B channels as three coordinate axes. All data to be restored are located in a cube with (0,0,0), (0,0,1), (0,1,0), (1,0,0), (1,1,0), (1,0,1), (0,1,1), and (1,1,1) as vertices in the space. S4, using a three-dimensional space Delaunay algorithm to divide all coordinate points including 8 vertices in the cube, so that every four coordinate points form a space tetrahedron; S5, traverse each point in the entire domain of the target RGB color space, correct each current traversal point P with an initial RGB value of (r, g, b) and obtain a corrected RGB value (r', g', b'), and then construct a mapping table by denormalizing the initial RGB values ​​and the corrected RGB values ​​of all points in the entire domain of the target RGB color space; wherein, the correction method for each current traversal point P is: First, determine the spatial tetrahedron W where point P is located, and obtain the four vertices of tetrahedron W, which are A (ar, ag, ab), B (br, bg, bb), C (cr, cg, cb), and D (dr, dg, db); then determine the intersection E of the line AP and the surface BCD, the intersection F of the line BP and the surface ACD, the intersection G of the line CP and the surface ABD, and the intersection H of the line DP and the surface ABC according to the spatial geometric relationship, so as to obtain the coefficient value k=1 / (PE / AE+PF / BF+PG / CG+PH / DH); finally, calculate the corrected RGB value (r', g', b') of point P as follows: r'= r - k*PE / AE*(ar-a'r')-k*PF / BF*(br-b'r')-k*PG / CG*(cr-c'r')-k*PH / DH*(dr-d'r') g'= r - k*PE / AE*(ag-a'g')-k*PF / BF*(bg-b'g')-k*PG / CG*(cg-c'g')-k*PH / DH*(dg-d'g') b'= r - k*PE / AE*(ab-a'b')-k*PF / BF*(bb-b'b')-k*PG / CG*(cb-c'b')-k*PH / DH*(db-d'b') S6, traversing each pixel in the object image, taking the RGB value of each pixel as the initial RGB value, finding the corresponding corrected RGB value from the mapping table and performing correction, thereby completing the correction of the entire object image.

2. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: In S1, the light source and imaging device used for capturing images of the color card and the subject need to be pre-adjusted in parameters so that the absolute value of the deviation between the RGB mean of the gray or white color block on the color card image and the official standard mean of the same color block in the target RGB color space at the target color temperature does not exceed a threshold.

3. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: The imaging device is a camera or a scanner.

4. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: The threshold is 2-5.

5. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: The measuring instrument includes a colorimeter or a spectrophotometer, and if the data directly collected by the measuring instrument is not RGB data in the target RGB color space, it needs to be converted into RGB data in the target RGB color space.

6. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: The target color temperature is D65 color temperature.

7. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: The target RGB color space is the sRGB color space.

8. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: The normalization operation is to divide the RGB three channel values ​​by 255 respectively.

9. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: The denormalization operation is to multiply the RGB three channel values ​​by 255 respectively.

10. The image color correction method based on characteristic color fitting in virtual dimensional space according to claim 1, characterized in that: In S5, the method for determining the point P in the space tetrahedron W is: Traverse each spatial tetrahedron in the cube, and for each currently traversed spatial tetrahedron, obtain the intersection H of the straight line DP and the face ABC, the intersection E of the straight line AP and the face BCD, the intersection F of the straight line BP and the face ACD, and the intersection G of the straight line CP and the face ABD. If the four equations DH = PH+DP, BF=FP+PB, CG=GP+PC and AE=PE+AP are satisfied at the same time, it means that P is in the currently traversed spatial tetrahedron.