Image Color Transfer Method, Device and Electronic Device
By aligning the two images and color migration is performed according to the pixel values, the problem of inconsistent image color is solved, and the image effect with consistent colors is achieved, and the appearance of the photo is improved.
Patent Information
- Application Number
- CN202111189726.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-12
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2041-10-12
AI Technical Summary
The color effects of the two images corresponding to the same scene are inconsistent, which affects the appearance of the photos.
By acquiring two images, the alignment process is performed to generate the corresponding third and fourth images, and the preset image is color-transferred according to the pixel values of pixel points corresponding to the same position among these images.
Optimize the color effect of the image to make it consistent and enhance the appearance of the photo.
Smart Images

Figure CN113838160B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of image processing, and particularly relates to an image color transfer method, apparatus, and electronic device. Background Art
[0002] For two images corresponding to the same scene, there may be a situation where the color effects of the two images are inconsistent. For example, the color effects of photos taken by different cameras in the same scene may be inconsistent, thus affecting the visual perception of the photos. Summary of the Invention
[0003] The purpose of the embodiments of this application is to provide an image color transfer method, apparatus, and electronic device, which can solve the problem of inconsistent color effects of two images.
[0004] In a first aspect, the embodiments of this application provide an image color transfer method, which includes: obtaining a first image and a second image; performing alignment processing on the first image and the second image to obtain a third image corresponding to the first image and a fourth image corresponding to the second image; and performing color transfer on a preset image according to the pixel values of the pixel points at the same position in the third image and the fourth image.
[0005] In a second aspect, the embodiments of this application provide an image color transfer apparatus, including: a first obtaining module, configured to obtain a first image and a second image; an alignment module, configured to perform alignment processing on the first image and the second image to obtain a third image corresponding to the first image and a fourth image corresponding to the second image; and a first processing module, configured to perform color transfer on a preset image according to the pixel values of the pixel points at the same position in the third image and the fourth image.
[0006] In a third aspect, the embodiments of this application provide an electronic device, which includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0007] In a fourth aspect, the embodiments of this application provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0008] In a fifth aspect, the embodiments of this application provide a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the method described in the first aspect.
[0009] In an embodiment of the present application, an image color transfer method is provided. By aligning a first image and a second image, a third image corresponding to the first image and a fourth image corresponding to the second image can be obtained. Furthermore, based on the pixel values of the pixel points at the same position in the third image and the fourth image, color transfer can be performed on a preset image. This embodiment can transfer the color of the preset image based on the aligned images, thereby optimizing the color effect of the images. Description of the Drawings
[0010] Figure 1 is a flowchart of an image color transfer method provided in this embodiment;
[0011] Figures 2 to 8 is a schematic diagram of the first image or the second image provided in this embodiment;
[0012] Figure 9 is a schematic diagram of the spliced picture provided in this embodiment;
[0013] Figure 10 is a block schematic diagram of an image color transfer device provided in this embodiment;
[0014] Figure 11 is a schematic diagram of the hardware structure of an electronic device provided in this embodiment;
[0015] Figure 12 is a schematic diagram of the hardware structure of another electronic device provided in this embodiment. Detailed Embodiments
[0016] Next, the technical solutions in the embodiments of the present application will be clearly described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0017] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order different from those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the associated objects.
[0018] The following will combine the accompanying drawings and, through specific embodiments and their application scenarios, elaborate in detail on the image color transfer method provided by the embodiments of the present application.
[0019] Please refer to Figure 1 , a method for image color transfer provided in this embodiment may include the following steps 110 to 130:
[0020] Step 110, obtain a first image and a second image.
[0021] In this embodiment, the two images may be preview images captured by a camera. For example, when the user turns on the secondary camera of the camera, the image captured by the main camera of the camera, or may also be non-preview images captured by the camera and displayed to the user, such as photos.
[0022] In this embodiment, the two images are related. This correlation can be reflected at least in that both images include that part of the image for the same scene. For example, the two images may be Figures 2 to 4 two of the images shown in Figures 5 to 8 or two of the images shown in
[0023] In this embodiment, first obtain the two images so as to align the two images subsequently.
[0024] Step 120, perform alignment processing on the first image and the second image to obtain a third image corresponding to the first image and a fourth image corresponding to the second image.
[0025] In this embodiment, the two images can be aligned based on that part of the image for the same scene in the two images.
[0026] In this embodiment, by aligning the two images, color transfer can be performed on a preset image according to the pixel values at the same position in the aligned images. This same position refers to the position of the same pixel point.
[0027] This embodiment does not limit the image alignment method. For example, it can be based on feature points to estimate the homography transformation matrix, or the optical flow method can be used on this basis to achieve a more accurate alignment accuracy. Among them, the homography transformation can refer to the mapping relationship from one plane to another plane.
[0028] Step 130, perform color transfer on a preset image according to the pixel values of the corresponding pixel points at the same position in the third image and the fourth image.
[0029] In this embodiment, the preset image can be one of the first image and the second image. Thus, in an embodiment of the present disclosure, the preset image includes the first image or the second image.
[0030] In an embodiment of the present disclosure, the first image includes an image captured by a first camera, and the second image includes an image captured by a second camera; the magnification factors of the first camera and the second camera are different.
[0031] In this embodiment, the preset image may also be other images.
[0032] By performing color transfer on the preset image, a new image with the expected image color effect and the same image content can be obtained.
[0033] In an embodiment of the present disclosure, step 130 of performing color transfer on the preset image according to the pixel values of the pixel points at the same corresponding positions in the third image and the fourth image may include the following steps 1301 to 1304:
[0034] Step 1301, obtain the pixel values of the pixel points at the same corresponding positions in the third image and the fourth image.
[0035] Specifically, color transfer of the preset image can be performed by the moving least squares method. The moving least squares method is a mathematical optimization modeling method that can find the best function match for data by minimizing the sum of the squares of the errors to support the implementation of image color transfer.
[0036] In this way, the pixel values of the pixel points at the same corresponding positions (that is, one pixel position corresponds to a pair of pixel points, or a pair of corresponding pixel points) can be used as the sample points of the moving least squares method.
[0037] In an embodiment of the present disclosure, downsampling may be performed on the third image and the fourth image, and the downsampling results are used to construct a sample point set.
[0038] For example, according to a set sampling number range, such as usually 1000 - 100000 pairs of pixel points are more appropriate, the third image and the fourth image can be downsampled several times to sample some pairs of pixel points in the two images instead of all pairs of pixel points.
[0039] In this embodiment, through the downsampling process, not only can the influence of too few sample points on the algorithm effect be avoided, but also the low algorithm efficiency caused by too many sample points can be avoided.
[0040] Step 1302, use the pixel values of the pixel points at the same corresponding positions as a set of sample points to construct a sample point set.
[0041] In this step, based on the obtained groups of sample points, a sample point set can be constructed.
[0042] Step 1303: For each first pixel point in the preset image, obtain a second pixel value corresponding to the first pixel point according to the set of sample points and the first pixel value of the first pixel point in the preset image.
[0043] In a feasible implementation, the sample points in the set of sample points can be used as the sample points for the moving least squares method, so that the color conversion matrix corresponding to each pixel in the preset image can be estimated based on the moving least squares method. Then, according to the pixel value of the pixel and the color conversion matrix corresponding to the pixel, a new pixel value of the pixel can be obtained to achieve the color migration of the pixel.
[0044] Step 1304: Obtain a seventh image according to the obtained second pixel values corresponding to each of the first pixel points. The seventh image is an image obtained by performing color migration on the preset image.
[0045] Based on the second pixel values (i.e., new pixel values) of each pixel point in the preset image, a new image with unchanged image content but changed color effect can be obtained as the image obtained by performing color migration on the preset image.
[0046] Specifically, in this embodiment, there are the following two requirements for the time delay of calculating the second pixel point:
[0047] Requirement 1: High time delay;
[0048] Requirement 2: Low time delay.
[0049] Specifically, corresponding to the above Requirement 1:
[0050] In an embodiment of the present disclosure, in Step 1303, the obtaining of the second pixel value corresponding to the first pixel point according to the set of sample points and the first pixel value of the first pixel point in the preset image may include the following Steps 1303a1 to 1303a2:
[0051] Step 1303a1: Obtain a color conversion matrix corresponding to the first pixel point according to the set of sample points and the first pixel value of the first pixel point in the preset image.
[0052] In this embodiment, under the requirement of high time delay, to ensure a better image color migration effect, the color conversion matrix corresponding to each pixel point in the preset image can be calculated.
[0053] That is, there is a one-to-one correspondence between the pixel points in the preset image and the calculated color conversion matrices, and the number of color conversion matrices is relatively large.
[0054] Step 1303a2: Obtain a second pixel value corresponding to the first pixel point according to the first pixel value and the color conversion matrix.
[0055] In this step, based on the pixel value of the pixel point and the color conversion matrix corresponding to the pixel point, the new pixel value of the pixel point can be obtained.
[0056] In this embodiment, through the calculation requirements with high latency, good image color transfer effect and image color transfer performance meeting the requirements can be ensured.
[0057] Specifically, corresponding to the above requirement 2:
[0058] In an embodiment of the present disclosure, in step 1303, for each first pixel point in the preset image, according to the sample point set and the first pixel value of the first pixel point in the preset image, obtaining the second pixel value corresponding to the first pixel point may include the following steps 1303b1 to 1303b3:
[0059] Step 1303b1, for each first grid point in the preset three-dimensional grid, according to the sample point set and the pixel value of the first grid point, obtaining the color conversion matrix corresponding to the first grid point, where the preset three-dimensional grid is obtained by dividing the RGB space.
[0060] Specifically, RGB represents the colors of three channels: red (R), green (G), and blue (B). The value range of each color is 0 to 256. In this way, the RGB space (256×256×256) can be divided into three-dimensional grids, for example, the grid size can be 20×20×20.
[0061] In this embodiment, under the requirement of low latency, to ensure better image color transfer performance, the color conversion matrix corresponding to each grid point in the preset three-dimensional grid can be calculated. Among them, based on the pixel value of the pixel point and the pixel value of the grid point, each pixel point in the preset image can be mapped to a corresponding grid point, and a grid point can correspond to multiple pixel points in the preset image. The number of grid points is less than the number of pixel points in the preset image.
[0062] That is, there is a one-to-one correspondence between the grid points in the preset three-dimensional grid and the calculated color conversion matrices, and there is a many-to-one correspondence between the pixel points in the preset image and the calculated color conversion matrices, and the number of color conversion matrices is relatively small.
[0063] Step 1303b2, for each first pixel point in the preset image, according to the first pixel value of the first pixel point in the preset image, determining the target grid point corresponding to the first pixel value.
[0064] In this embodiment, to calculate the new pixel value of a pixel point, since the calculated color conversion matrix corresponds to the grid point, the grid point corresponding to this pixel point can be determined according to the pixel value of this pixel point, and the color conversion matrix corresponding to this grid point is used as the color conversion matrix corresponding to this pixel point.
[0065] Step 1303b3, obtain the second pixel value corresponding to the first pixel point according to the first pixel value and the color conversion matrix corresponding to the target grid point.
[0066] In this step, the new pixel value is obtained according to the pixel value of the pixel point and the corresponding color conversion matrix.
[0067] In this embodiment, through the low-latency calculation requirements, good image color migration performance and compliant image color migration effects can be ensured.
[0068] Next, in combination with the implementation manners of the above Requirements 1 and 2, the implementation manner of solving the color conversion matrix by the moving least squares method will be described.
[0069] In this embodiment, a sample point set u is composed of some or all of the pixel points in the fourth image (such as the sub-camera aligned image), and a sample point set v is composed of some or all of the pixel points in the third image (such as the main-camera aligned image). u i is the pixel value of the i-th sample point in the sample point set u, and v i is the pixel value of the i-th sample point in the sample point set v. The position of the i-th sample point in the sample point set u in the fourth image is consistent with the position of the i-th sample point in the sample point set v in the third image, and the two are a pair of sample points (or called a sample point pair). Among them, the pixel value of any sample point is expressed as [r, g, b] T , and T represents the transpose operation.
[0070] j represents the j-th pixel point in the preset image (such as the sub-camera image) (corresponding to the implementation manner described in the above Requirement 1) or the j-th grid point in the set grid (corresponding to the implementation manner described in the above Requirement 2). To solve its color conversion matrix, we establish a moving least squares equation:
[0071]
[0072] In formula (1), m is the total number of sample point pairs, w i is the weight of the i-th pair of sample point pairs for j, and T j is the affine transformation matrix for j (the color conversion matrix can be defined as the affine transformation matrix).
[0073] Specifically, an affine transformation can refer to a linear transformation followed by a translation in geometry, which transforms one vector space into another vector space.
[0074] where w i is defined as:
[0075]
[0076] In formula (2), x is the pixel value of j, and σ is the weight parameter.
[0077] where the magnitude of the weight parameter σ depends on the difference between the pixel value x of j and u i Therefore, different j values have different weights and all need to be calculated.
[0078] where the affine transformation matrix T j is defined as:
[0079] T j (x) = A j × x + b j (3)
[0080] In formula (3), A j is a parameter, specifically a 3×3 matrix, and b j is another parameter, specifically a translation matrix.
[0081] Solving the partial derivative of the above formula (1) can obtain A j and b j :
[0082]
[0083]
[0084] In formula (4), is the weighted average of the pixel values of all sample points in the sample point set u, is the weighted average of the pixel values of all sample points in the sample point set v. and are defined as:
[0085]
[0086]
[0087] Based on the above, w i can be calculated first according to formula (2), and then and can be calculated respectively according to formulas (6) and (7), and then A j and b can be calculated respectively according to formulas (4) and (5)j , and then obtain the affine transformation matrix T corresponding to j according to formula (3). j , finally substitute the pixel value x of j into formula (3), and the new pixel value of j can be calculated.
[0088] As can be seen from the above, this embodiment provides an image color transfer method. By aligning the first image and the second image, a third image corresponding to the first image and a fourth image corresponding to the second image can be obtained. Furthermore, based on the pixel values of the pixel points at the same corresponding positions in the third image and the fourth image, color transfer can be performed on a preset image. This embodiment can transfer the color of the preset image based on the aligned images, thereby optimizing the color effect of the images.
[0089] Specifically, the image color transfer method provided in this embodiment can be applied to at least the following scenarios 1 to 3:
[0090] Scenario 1: Switch to the secondary camera (i.e., use the secondary camera for shooting);
[0091] Scenario 2: Panoramic stitching;
[0092] Scenario 3: Video post-production.
[0093] Among them, in Scenarios 1 and 2, the preset image can be one of the first image and the second image, that is, color transfer is performed on the first image or the second image.
[0094] Among them, in Scenario 3, the preset image can be other images, that is, color transfer is performed on other images different from the first image and the second image.
[0095] Next, based on the above three scenarios respectively, the image color transfer method provided in this embodiment will be described.
[0096] Specifically, corresponding to the above Scenario 1:
[0097] In this embodiment, the camera of the electronic device includes at least two cameras.
[0098] Among the at least two cameras, the camera with a magnification of 1.0× is usually the main camera (abbreviated as the main camera), and the cameras with other magnifications, such as the wide-angle camera with a magnification of 0.5× and the telephoto camera with a magnification of 2.0×, are all secondary cameras (abbreviated as the secondary camera). When the camera is turned on, the main camera is usually used by default, and the user can switch to any secondary camera as needed based on personal needs.
[0099] Specifically, during the photo preview stage, video preview stage, photo shooting stage, and video shooting stage of the camera, the main camera or any secondary camera can be used for shooting operations.
[0100] During the process of using a camera, the switching of cameras with different magnification factors is involved. To avoid inconsistent color effects of the images captured by different cameras and affect the user's sensory experience, color transfer can be performed on the images captured by some cameras to ensure that the color effects of the images captured by each camera are consistent.
[0101] Thus, in an embodiment of the present disclosure, the first image includes the image captured by the first camera, and the second image includes the image captured by the second camera; the magnification factors of the first camera and the second camera are different.
[0102] In this embodiment, the preset image is the first image or the second image. For example, preferably, according to the image captured by the main camera and the image captured by the secondary camera, color transfer can be performed on the image captured by the secondary camera.
[0103] In a feasible implementation, when the camera includes two cameras, namely a main camera and a secondary camera, color transfer can be performed on the image captured by the main camera, or color transfer can also be performed on the image captured by the secondary camera. Considering that the usage frequency of the main camera is usually much higher than that of the secondary camera, to reduce the amount of data processing, it is preferably to perform color transfer on the image captured by the secondary camera.
[0104] And when the camera includes multiple cameras, namely a main camera and at least two secondary cameras, based on the color effect of the main camera image, color transfer can be performed on any image captured by the secondary camera, so that when any image captured by the secondary camera is presented to the user, the user can feel the same color effect as the image captured by the main camera, that is, the user can always feel a uniform and consistent image color effect during the process of using the camera, thereby improving the user experience.
[0105] Based on the above content, in an embodiment of the present disclosure, the preset image includes the second image.
[0106] In this embodiment, preferably, the first camera is the main camera, the second camera is the secondary camera, and the second image is the image captured by the secondary camera. Color transfer is performed on the secondary camera image according to the main camera image and the secondary camera image to support the image captured by the secondary camera seen by the user to have the same color effect as the image captured by the main camera.
[0107] Correspondingly, step 110, obtaining the first image and the second image, may include the following steps 1101:
[0108] Step 1101, when using the second camera to take a picture, obtain the first image by obtaining the preview image captured by the first camera, and obtain the second image by obtaining the preview image captured by the second camera.
[0109] Taking the second camera as the secondary camera as an example, when the user switches to any secondary camera, that is, when shooting with the secondary camera, obtain the preview image captured by the main camera and the preview image captured by the secondary camera, so as to facilitate subsequent color transfer processing of the secondary camera image.
[0110] When the user switches to the main camera, that is, when shooting with the main camera, since the main camera image is default to have a standard image color effect, no image color transfer processing is performed.
[0111] Preferably, two preview images can be obtained simultaneously to ensure that the parts of the two images corresponding to the same scene can be kept corresponding as much as possible, so as to ensure the alignment effect and further ensure the color transfer effect.
[0112] In this embodiment, the two obtained preview images can be used as the first image and the second image respectively.
[0113] In this embodiment, when using any secondary camera, according to the preview images of the main camera and the secondary camera, perform color transfer on the preview image of the secondary camera, and display the image obtained after color transfer of the secondary camera image to the user. In this way, the color effects of the images seen by the user using the main camera and the images seen by the user using any secondary camera are consistent, so that the user experience can be avoided from being affected by the switching of the camera.
[0114] Based on the above content, for the alignment of the two images, in an embodiment of the present disclosure, the aligning the first image and the second image may include the following step 1201:
[0115] Step 1201, using one of the first image and the second image as a reference image, align the first image and the second image.
[0116] In this embodiment, the two images are respectively captured by two cameras with different magnification factors.
[0117] For the same scene, such as Figures 2 to 4 the scene in the area where the identifier B is located in Figures 2 to 4 are respectively schematic diagrams of images captured by the wide-angle camera, the main camera, and the telephoto camera of the camera.
[0118] It can be seen that for the same scene, the larger the magnification factor of the camera, the relatively larger area of the part of the image corresponding to that scene can occupy in the captured image. To improve the alignment effect, in this embodiment, preferably use the image captured by the camera with a smaller magnification factor as the reference image to align the two images.
[0119] Specifically, when the magnification of the first camera is less than that of the second camera, the second image is used as the reference image, and when the magnification of the first camera is greater than that of the second camera, the first image is used as the reference image.
[0120] Among them, when the second image is used as the reference image, the second image and the fourth image can be the same; when the first image is used as the reference image, the first image and the third image can be the same.
[0121] The image taken with the first image as the main camera Figure 3 The image shown, and the second image is the image taken by the telephoto camera Figure 4 Taking the image shown as an example, Figure 4 Taking the image shown as the reference image, Figure 3 and Figure 4 Align the images shown.
[0122] As Figure 3 and Figure 4 shown, Figure 4 The image shown can be Figure 3 a part of the image shown, so this part of the image can be cropped from Figure 3 and enlarged to the same size as the Figure 4 image shown, and then this enlarged part of the image is aligned with Figure 4 . In this way, this enlarged part of the image can be used as the third image, Figure 4 and the image shown can be used as the fourth image.
[0123] As Figure 2 and Figure 3 shown, please refer to the scene corresponding to the identifier A. Figure 3 The image shown can be Figure 2 a part of the image shown, so this part of the image can be cropped from Figure 2 and enlarged to the same size as the Figure 3 image shown, and then this enlarged part of the image is aligned with Figure 3 . In this way, this enlarged part of the image can be used as the third image, Figure 3 and the image shown can be used as the fourth image.
[0124] It can be seen that the alignment method provided in this embodiment can improve the alignment effect, thereby ensuring the color transfer effect of the preset image.
[0125] As described above, in the above-mentioned Scenario 1, this embodiment can ensure that when the user uses the camera, no matter how the user switches the camera as needed, the color effect of the image seen by the user can be kept consistent, avoiding the situation that when the user takes pictures with different focal length cameras during mobile phone photography, the color effects of the pictures taken by different cameras are inconsistent, thus affecting the visual experience of the photos. In addition, based on the image color migration method provided in this embodiment, when the user performs a sliding zoom, the colors of the pictures seen before and after switching the camera are consistent, without the feeling of sudden color change, and the user experience is good.
[0126] As described above, since the embodiment of the present invention can achieve the effect of image color consistency under multiple cameras, for the application scenario where the user often needs to switch cameras with different focal lengths to take pictures, the color consistency effect provided by this embodiment will improve the visual experience of the photos. And when the user uses a sliding zoom in the preview interface, the color consistency effect will ensure the smoothness of the picture color when switching the camera, improving the user experience.
[0127] In addition, for Implementation Method 1 in which the AWB (Auto White Balance) parameters of different cameras are calibrated and synchronized, and then the images of multiple cameras reach a color consistency effect through the AWB algorithm after white balance correction, since it is difficult to obtain the non-linear differences in the responses of the sensors of different cameras to different spectral bands through calibration, the method of calibrating and synchronizing AWB parameters is difficult to achieve the color consistency effect, so Implementation Method 1 is difficult to ensure the color consistency effect.
[0128] And for Implementation Method 2 in which image engineers finely modulate the color and brightness modules in the ISP (Image Signal Processor) to make the colors of the images of multiple cameras consistent, since it involves fine modulation of multiple color and brightness modules and different color temperature scenarios, and different modules will affect each other, Implementation Method 2 is also difficult to achieve the state of ensuring color consistency.
[0129] This embodiment does not involve the problems involved in the above two implementation methods. In the case of switching to the secondary camera, this embodiment can obtain the preview images of the main camera and the secondary camera, and then align the two preview images, and perform color migration on the preview image of the secondary camera according to the pixel values of the pixel points corresponding to the same position in the two aligned images, so that the color effect of the secondary camera image seen by the user is consistent with that of the main camera image, so it can ensure the color consistency effect.
[0130] Specifically, corresponding to the above Scenario 2:
[0131] In an embodiment of the present disclosure, before obtaining the first image and the second image in step 110, the method may further include the following steps A1 to A2:
[0132] Step A1, receiving a first input for requesting panoramic stitching of the first image and the second image.
[0133] Specifically, when panoramic stitching is required, the user can issue a corresponding input. For example, the user can input a request for panoramic stitching. Figures 5 to 8
[0134] Step A2, in response to the first input, performing the step of obtaining the first image and the second image.
[0135] In this step, after the image color transfer device receives the first input, it can obtain the first image and the second image, and perform subsequent panoramic stitching processing based on this.
[0136] Correspondingly, please refer to Figures 5 to 9 , after color transfer of the preset image, the method may further include the following step 140 or step 150.
[0137] In this embodiment, the preset image is the first image or the second image.
[0138] In this embodiment, the first image and the second image can be obtained by a same camera shooting different associated scenes, or can be obtained by different cameras shooting these scenes.
[0139] As Figures 5 to 8 shown, the first image and the second image can be two associated images in the Figures 5 to 8 shown image. The image contents of the two associated images are different, but both include the part of the image for the same scene.
[0140] For example, the first image is the Figure 5 shown image, and the second image is the Figure 6 or Figure 7 shown image. Or, the second image is the Figure 5 shown image, and the first image is the Figure 6 or Figure 7 shown image.
[0141] For another example, the first image is the Figure 6 shown image, and the second image is the Figure 7 or Figure 8 shown image.
[0142] For yet another example, the first image is the Figure 7 shown image, and the second image is the Figure 8 shown image.
[0143] In this embodiment, without requiring which image's color effect to be the standard, the preset image can be either the first image or the second image. After performing color transfer on one image and then splicing it with the other image, a spliced image with a uniform color effect can be obtained.
[0144] Based on this, in step 140, obtain the fifth image obtained by performing color transfer on the first image, and perform image splicing on the second image and the fifth image.
[0145] Specifically, when the preset image is the first image, execute step 140 to perform color transfer on the first image. The color effect of the image obtained after color transfer is basically the same as that of the second image, so the two can be spliced to obtain a spliced image.
[0146] In step 150, obtain the sixth image obtained by performing color transfer on the second image, and perform image splicing on the first image and the sixth image.
[0147] Specifically, when the preset image is the second image, execute step 150 to perform color transfer on the second image. The color effect of the image obtained after color transfer is basically the same as that of the first image, so the two can be spliced to obtain a spliced image.
[0148] For example, please refer to Figures 5 to 8 , assume that Figure 5 and Figure 7 have the same color effect, Figure 6 and Figure 8 have the same color effect (the image color effect is not shown in Figures 5 to 8 ). If color transfer is performed based on the color effect of Figure 6 and Figure 8 , then Figure 5 can be set as the first image, Figure 6 as the second image, Figure 5 simultaneously as the preset image, and perform color transfer on Figure 5 . Then let Figure 7 be the first image, Figure 8 be the second image, Figure 7 simultaneously as the preset image, and perform color transfer on Figure 7 .
[0149] After that, the images obtained by performing color transfer on Figure 5 , Figure 6 , the images obtained by performing color transfer on Figure 7 , and Figure 8 can be spliced in sequence to obtain the spliced image as shown in Figure 9 , Figure 9The color effect is uniform (the image color effect is not shown in Figure 9 ), and Figure 9 is the same as the color effects of Figure 6 and Figure 8 .
[0150] As can be seen from the above, when a user wants to splice pictures taken by different cameras, to avoid affecting the image effect after splicing due to inconsistent color styles, the method provided in this embodiment can be used for image color transfer, and then image splicing can be performed based on the images after color transfer, so as to obtain a better splicing effect and improve the panoramic splicing effect.
[0151] Specifically, corresponding to the above scenario 3:
[0152] In an embodiment of the present disclosure, the first image is any frame image in a preset video; the second image includes an image obtained according to the first image; the preset image is any other frame image in the preset video.
[0153] Specifically, the color of the first image can be adjusted manually as needed to obtain the second image. The image contents of the first image and the second image are the same but the image colors are different.
[0154] In a feasible implementation manner, after obtaining the pixel point pairs in step 130, each frame image (i.e., each other frame image) in the preset video that is different from the first image can be sequentially used as the preset image, and based on the obtained pixel point pairs, these images can be sequentially subjected to color transfer. Since there is no need to repeatedly obtain pixel point pairs, the video color transfer efficiency can be improved.
[0155] For example, the preset video may include N frame images, namely image 1, image 2,..., image N. In order to be able to change the color effect of the preset video, any frame image can be taken. For example, image 1 is used as the first image, and in combination with the expected color effect, image 1 is processed to obtain image 1.1 as the second image.
[0156] Among them, the color effects of image 1 and image 1-1 are different but the image contents are the same. Therefore, the two images can be directly aligned, and based on the pixel values of the pixels at the same positions in the two images, the other frame images can be sequentially subjected to color transfer processing. Among them, for the i-th (2≤i≤N) frame image, the image i is subjected to color transfer processing to obtain image i.1, and the color effects of image i and image i.1 are different but the image contents are the same.
[0157] Furthermore, a new video can be composed of image 1.1 to image N.1. The color effect of the new video is different from that of the preset video, but the video content is the same, so as to achieve the purpose of changing the color effect of the preset video.
[0158] In another feasible implementation, after obtaining the pixel pairs in step 130, the color conversion matrix corresponding to each pixel in the preset image can be calculated accordingly to calculate the new pixel value of each pixel in the preset image. Then, the color conversion matrix can be used as the color conversion matrix corresponding to the pixels at the same position in other preset images to calculate the new pixel value of each pixel in the other preset images. Since there is no need to repeatedly calculate the color conversion matrix corresponding to each pixel, the video color transfer efficiency can be improved.
[0159] As can be seen from the above, for the style transfer of a video, in this embodiment, it is not necessary to calculate each frame image in the video. Instead, the color conversion matrix of only one frame image can be calculated and applied to the processing of all frame images. Since the user does not need to manually modify each frame of the picture, the processing efficiency is higher.
[0160] As can be seen from the above, the image color transfer method provided by this embodiment can at least support the image color transfer requirements in the above three scenarios of switching to the secondary camera, panoramic stitching, and video post-modification, and has a wide range of applications.
[0161] Based on the above content, it can be seen that the image color transfer method provided by this embodiment can achieve the effect of consistent image colors for multiple images, improving the photo-taking perception and user experience. This embodiment can at least have the following characteristics:
[0162] 1) This embodiment supports consistent image color effects for the images captured by multiple cameras in the same scene in the preview and photo-taking / video-recording modes;
[0163] 2) This embodiment can achieve the effect through a pure software algorithm without the need to modify the hardware;
[0164] 3) This embodiment does not require any calibration work for any module;
[0165] 4) This embodiment can achieve an accurate color transfer effect without the need for an accurate image alignment effect.
[0166] It should be noted that for the image color transfer method provided in the embodiments of the present application, the execution subject can be an image color transfer device or a control module in the image color transfer device for executing the image color transfer method. In the embodiments of the present application, the image color transfer method is executed by the image color transfer device as an example to illustrate the image color transfer device provided in the embodiments of the present application.
[0167] As Figure 10 shown, this embodiment provides an image color transfer device 200, which may include a first acquisition module 210, an alignment module 220, and a first processing module 230.
[0168] Among them, the first acquisition module 210 is configured to acquire a first image and a second image. The alignment module 220 is configured to perform alignment processing on the first image and the second image to obtain a third image corresponding to the first image and a fourth image corresponding to the second image. The first processing module 230 is configured to perform color transfer on a preset image according to the pixel values of the pixel points at the same position in the third image and the fourth image.
[0169] In this embodiment, by performing alignment processing on the first image and the second image, a third image corresponding to the first image and a fourth image corresponding to the second image can be obtained. Furthermore, color transfer can be performed on the preset image according to the pixel values of the pixel points at the same position in the third image and the fourth image. Based on the aligned images, this embodiment can transfer the color of the preset image, thereby optimizing the color effect of the image.
[0170] In an embodiment of the present disclosure, the preset image includes the first image or the second image.
[0171] In an embodiment of the present disclosure, the image color transfer device 200 further includes a receiving module and a stitching module.
[0172] Among them, the receiving module is configured to receive a first input before the first acquisition module 210 acquires the first image and the second image. The first input is used to request panoramic stitching of the first image and the second image. In response to the first input, the first acquisition module 210 is triggered to execute the step of acquiring the first image and the second image.
[0173] The stitching module is configured to, after the first processing module 230 performs color transfer on the preset image, acquire a fifth image obtained by performing color transfer on the first image, and perform image stitching on the second image and the fifth image.
[0174] Alternatively, the stitching module is configured to, after the first processing module 230 performs color transfer on the preset image, acquire a sixth image obtained by performing color transfer on the second image, and perform image stitching on the first image and the sixth image.
[0175] In an embodiment of the present disclosure, the first image includes an image captured by a first camera, and the second image includes an image captured by a second camera; the magnification factors of the first camera and the second camera are different.
[0176] In an embodiment of the present disclosure, the alignment module 220 is configured to align the first image and the second image with one of the first image and the second image as a reference image; wherein, when the magnification of the first camera is less than the magnification of the second camera, the second image is used as the reference image, and when the magnification of the first camera is greater than the magnification of the second camera, the first image is used as the reference image; the third image is obtained according to the part of the first image aligned with the second image, and the fourth image is obtained according to the part of the second image aligned with the first image.
[0177] In an embodiment of the present disclosure, the preset image includes the second image. The first acquisition module 210 is configured to obtain a first image by acquiring a preview image captured by the first camera and obtain a second image by acquiring a preview image captured by the second camera when the second camera is used for shooting.
[0178] In an embodiment of the present disclosure, the first image is any frame image in a preset video; the second image includes an image obtained according to the first image; the preset image is any other frame image in the preset video.
[0179] In an embodiment of the present disclosure, the first processing module 230 includes a second acquisition module, a construction module, a second processing module, and a third processing module.
[0180] Among them, the second acquisition module is configured to acquire pixel values of pixel points at the same corresponding position in the third image and the fourth image. The construction module is configured to construct a set of sample points with the pixel values of the pixel points at the same corresponding position as a set of sample points. The second processing module is configured to obtain a second pixel value corresponding to each first pixel point in the preset image according to the set of sample points and the first pixel value of the first pixel point in the preset image. The third processing module is configured to obtain a seventh image according to the obtained second pixel values corresponding to each first pixel point respectively, and the seventh image is an image obtained by performing color transfer on the preset image.
[0181] In an embodiment of the present disclosure, the second processing module is configured to obtain a color conversion matrix corresponding to the first pixel point according to the set of sample points and the first pixel value of the first pixel point in the preset image; and obtain a second pixel value corresponding to the first pixel point according to the first pixel value and the color conversion matrix.
[0182] In an embodiment of the present disclosure, the second processing module is configured to, for each first grid point in a preset three-dimensional grid, obtain a color conversion matrix corresponding to the first grid point according to the sample point set and the pixel value of the first grid point, where the preset three-dimensional grid is obtained by dividing the RGB space; for each first pixel point in the preset image, determine a target grid point corresponding to the first pixel value according to the first pixel value of the first pixel point in the preset image; and obtain a second pixel value corresponding to the first pixel point according to the first pixel value and the color conversion matrix corresponding to the target grid point.
[0183] The image color migration device in the embodiments of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0184] The image color migration device in the embodiments of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0185] The image color migration device provided in the embodiments of the present application can implement Figure 1 each process implemented by the method embodiments. To avoid repetition, it will not be elaborated here.
[0186] Optionally, as Figure 11 shown, the embodiments of the present application further provide an electronic device 300, including a processor 310, a memory 320, and a program or instruction stored in the memory 320 and executable on the processor 310. When the program or instruction is executed by the processor 310, it implements each process of the above image color migration method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0187] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0188] Figure 12 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
[0189] The electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0190] Those skilled in the art can understand that the electronic device 1000 may further include a power supply (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 1010 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 12 The structure of the electronic device shown does not limit the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0191] Among them, the processor 1010 is used to obtain a first image and a second image; perform alignment processing on the first image and the second image to obtain a third image corresponding to the first image and a fourth image corresponding to the second image; perform color transfer on a preset image according to the pixel values of the pixel points at the same position in the third image and the fourth image.
[0192] In this embodiment, by performing alignment processing on the first image and the second image, a third image corresponding to the first image and a fourth image corresponding to the second image can be obtained. Furthermore, color transfer can be performed on the preset image according to the pixel values of the pixel points at the same position in the third image and the fourth image. Based on the aligned images, the color of the preset image can be transferred in this embodiment, thereby optimizing the color effect of the image.
[0193] Optionally, the preset image includes the first image or the second image.
[0194] Optionally, the processor 1010 is used to receive a first input before obtaining the first image and the second image, where the first input is used to request panoramic stitching of the first image and the second image; in response to the first input, execute the step of obtaining the first image and the second image; after performing color transfer on the preset image, obtain a fifth image obtained by performing color transfer on the first image, and perform image stitching on the second image and the fifth image.
[0195] Optionally, the processor 1010 is configured to, after performing color transfer on a preset image, obtain a sixth image obtained by performing color transfer on the second image, and splice the first image and the sixth image.
[0196] Optionally, the first image includes an image captured by a first camera, and the second image includes an image captured by a second camera; the magnification factors of the first camera and the second camera are different.
[0197] Optionally, the processor 1010 is configured to align the first image and the second image with one of the first image and the second image as a reference image; wherein, when the magnification factor of the first camera is less than that of the second camera, the second image is used as the reference image, and when the magnification factor of the first camera is greater than that of the second camera, the first image is used as the reference image; the third image is obtained according to the part of the first image aligned with the second image, and the fourth image is obtained according to the part of the second image aligned with the first image.
[0198] Optionally, the preset image includes the second image. The processor 1010 is configured to, when using the second camera to capture an image, obtain a first image by acquiring a preview image captured by the first camera, and obtain a second image by acquiring a preview image captured by the second camera.
[0199] Optionally, the first image is any frame image in a preset video; the second image includes an image obtained according to the first image; the preset image is any other frame image in the preset video.
[0200] Optionally, the processor 1010 is configured to obtain the pixel values of the pixel points at the corresponding same positions in the third image and the fourth image; use the pixel values of the pixel points at the corresponding same positions as a set of sample points to construct a sample point set; for each first pixel point in the preset image, obtain a second pixel value corresponding to the first pixel point according to the sample point set and the first pixel value of the first pixel point in the preset image; obtain a seventh image according to the obtained second pixel values corresponding to each first pixel point, and the seventh image is an image obtained by performing color transfer on the preset image.
[0201] Optionally, the processor 1010 is configured to obtain a color conversion matrix corresponding to the first pixel point according to the set of sample points and the first pixel value of the first pixel point in the preset image; and obtain a second pixel value corresponding to the first pixel point according to the first pixel value and the color conversion matrix.
[0202] Optionally, for each first grid point in the preset three-dimensional grid, the processor 1010 is configured to obtain a color conversion matrix corresponding to the first grid point according to the set of sample points and the pixel value of the first grid point, where the preset three-dimensional grid is obtained by dividing the RGB space; for each first pixel point in the preset image, determine a target grid point corresponding to the first pixel value according to the first pixel value of the first pixel point in the preset image; and obtain a second pixel value corresponding to the first pixel point according to the first pixel value and the color conversion matrix corresponding to the target grid point.
[0203] It should be understood that in the embodiments of the present application, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The graphics processing unit 10041 processes the image data of static pictures or videos obtained by an image capturing device (such as a camera) in the video capturing mode or the image capturing mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. The other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here. The memory 1009 may be used to store software programs and various data, including but not limited to application programs and operating systems. The processor 1010 may integrate an application processor and a modulation and demodulation processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modulation and demodulation processor mainly processes wireless communication. It can be understood that the above modulation and demodulation processor may not be integrated into the processor 1010.
[0204] The embodiments of the present application further provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above embodiments of the image color migration method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0205] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs, etc.
[0206] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above embodiment of the image color migration method and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0207] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0208] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including that element. In addition, it should be pointed out that the methods and devices in the embodiments of the present application are not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the methods described may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0209] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods in the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions to enable a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.
[0210] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. An image color transfer method, characterized in that, it includes: Obtain a first image and a second image; the first image includes an image captured by a first camera, the second image includes an image captured by a second camera, and the magnification factors of the first camera and the second camera are different; Align the first image and the second image to obtain a third image corresponding to the first image and a fourth image corresponding to the second image; Perform color transfer on a preset image according to the pixel values of the pixel points at the same corresponding positions in the third image and the fourth image; Among them, the performing color transfer on the preset image according to the pixel values of the pixel points at the same corresponding positions in the third image and the fourth image includes: Obtain the pixel values of the pixel points at the same corresponding positions in the third image and the fourth image; Use the pixel values of the pixel points at the same corresponding positions as a set of sample points to construct a sample point set; For each first pixel point in the preset image, obtain a second pixel value corresponding to the first pixel point according to the sample point set and the first pixel value of the first pixel point in the preset image; Obtain a seventh image according to the obtained second pixel values corresponding to each first pixel point, and the seventh image is an image obtained by performing color transfer on the preset image; Among them, the obtaining, for each first pixel point in the preset image, a second pixel value corresponding to the first pixel point according to the sample point set and the first pixel value of the first pixel point in the preset image includes: In the case where the latency requirement is low latency, for each first grid point in a preset three-dimensional grid, obtain a color conversion matrix corresponding to the first grid point according to the sample point set and the pixel value of the first grid point, where the preset three-dimensional grid is obtained by dividing the RGB space, each first grid point in the preset three-dimensional grid corresponds to multiple pixel points in the preset image, and the number of first grid points in the preset three-dimensional grid is less than the number of pixel points in the preset image; For each first pixel point in the preset image, determine a target grid point corresponding to the first pixel value according to the first pixel value of the first pixel point in the preset image; Obtain a second pixel value corresponding to the first pixel point according to the first pixel value and the color conversion matrix corresponding to the target grid point.
2. The method according to claim 1, characterized in that, the preset image includes the first image or the second image.
3. The method according to claim 2, characterized in that, before the obtaining the first image and the second image, the method further includes: Receive a first input, where the first input is used to request panoramic stitching of the first image and the second image; In response to the first input, execute the step of obtaining the first image and the second image; after the performing color transfer on the preset image, the method further includes: Obtain a fifth image obtained by performing color transfer on the first image, and perform image stitching on the second image and the fifth image; Or, Obtain a sixth image obtained by performing color transfer on the second image, and perform image stitching on the first image and the sixth image.
4. The method according to claim 1 or 2, characterized in that the aligning process of the first image and the second image includes: Taking one of the first image and the second image as a reference image, and performing alignment processing on the first image and the second image; wherein, when the magnification of the first camera is less than the magnification of the second camera, the second image is used as the reference image, and when the magnification of the first camera is greater than the magnification of the second camera, the first image is used as the reference image.
5. The method according to claim 1, characterized in that the preset image includes the second image; the obtaining of the first image and the second image includes: When using the second camera for shooting, obtain the first image by obtaining the preview image captured by the first camera, and obtain the second image by obtaining the preview image captured by the second camera.
6. The method according to claim 1, characterized in that the first image is any frame image in a preset video; the second image includes an image obtained according to the first image; the preset image is any other frame image in the preset video.
7. The method according to claim 1, characterized in that the obtaining of the second pixel value corresponding to the first pixel point according to the sample point set and the first pixel value of the first pixel point in the preset image further includes: In the case of a high latency requirement, obtain the color conversion matrix corresponding to the first pixel point according to the sample point set and the first pixel value of the first pixel point in the preset image; Obtain the second pixel value corresponding to the first pixel point according to the first pixel value and the color conversion matrix.
8. An image color transfer device, characterized in that it includes: A first acquisition module for acquiring a first image and a second image; the first image includes an image captured by a first camera, the second image includes an image captured by a second camera, and the magnifications of the first camera and the second camera are different; An alignment module for performing alignment processing on the first image and the second image to obtain a third image corresponding to the first image and a fourth image corresponding to the second image; And, A first processing module for performing color transfer on a preset image according to the pixel values of the pixel points at the same position corresponding to the third image and the fourth image; The first processing module is used to obtain the pixel values of the pixel points at the same position corresponding to the third image and the fourth image; Using the pixel values of the pixel points corresponding to the same position as a set of sample points, a sample point set is constructed; for each first pixel point in the preset image, according to the sample point set and the first pixel value of the first pixel point in the preset image, a second pixel value corresponding to the first pixel point is obtained; According to the obtained second pixel values respectively corresponding to each of the first pixel points, a seventh image is obtained, and the seventh image is an image obtained by performing color migration on the preset image; Wherein, the first processing module is specifically configured to, when the delay requirement is low delay, for each first grid point in the preset three-dimensional grid, according to the sample point set and the pixel value of the first grid point, obtain a color conversion matrix corresponding to the first grid point, wherein the preset three-dimensional grid is obtained by dividing the RGB space, each first grid point in the preset three-dimensional grid corresponds to a plurality of pixel points in the preset image, and the number of first grid points in the preset three-dimensional grid is less than the number of pixel points in the preset image; for each first pixel point in the preset image, according to the first pixel value of the first pixel point in the preset image, determine a target grid point corresponding to the first pixel value; according to the first pixel value and the color conversion matrix corresponding to the target grid point, obtain a second pixel value corresponding to the first pixel point.
9. An electronic device, Characterized in that, It includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor, and when the program or instruction is executed by the processor, the steps of the image color migration method according to any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Image splicing method based on feature point clustering four-fork division and local transformation matrixes
CN107578376A
Color transfer method and computing device
CN108921810A