Method, device, equipment and readable storage medium for eliminating color difference of stitched images

By determining the transition area and calculating the pixel gain and color ratio in image stitching, the problem that traditional stitching algorithms are difficult to eliminate brightness differences is solved, and efficient color difference elimination and natural transition effects are achieved.

CN112233154BActive Publication Date: 2024-08-30ARASHI VISION INC
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202011202954.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-02
Publication Date
2024-08-30
Estimated Expiration
2040-11-02

AI Technical Summary

Technical Problem

Traditional image stitching algorithms are difficult to completely eliminate the chromatic aberration of spliced ​​images when dealing with large differences in brightness, resulting in flickering or artifacts in the spliced ​​image.

Method used

By obtaining a spliced ​​image based on the splicing of at least two original images, determine the transition area containing overlapping areas and non-overlapping areas, and calculate the pixel gain and color ratio based on this area, perform color aberration elimination processing, and build a triangular mesh to smooth the transition. The pixel value of the area.

Benefits of technology

It effectively eliminates the chromatic aberration of the spliced ​​image, improves the quality of the spliced ​​image, avoids splicing seams and flickering phenomena, and achieves a more natural transition effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112233154B
    Figure CN112233154B
Patent Text Reader

Abstract

The present application relates to a method, device, equipment and readable storage medium for eliminating color difference of a stitched image. The method comprises: obtaining a stitched image obtained by stitching at least two original images; determining a transition area in the stitched image; the transition area includes an overlapping area and at least a part of a non-overlapping area in the stitched image; based on the determined transition area, performing color difference elimination processing on the stitched image to obtain a stitched image after color difference elimination. The method can eliminate the color difference of the stitched image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device, equipment and readable storage medium for eliminating chromatic aberration of spliced ​​images. Background Art

[0002] Image stitching refers to stitching a series of pictures with overlapping areas into a stitched image with a wide viewing angle, close to the original image, with low distortion and no obvious seams, to meet people's needs for browsing panoramic images. At present, there are many image stitching algorithms that can extract the overlapping parts of the same scene pictures and quickly stitch them into a panoramic picture. For example, the multi-scale image stitching algorithm using wavelets and the image stitching algorithm using the gradient domain.

[0003] However, traditional image stitching algorithms only fuse the overlapping areas of the resulting stitched images. When the brightness differences of the original images to be stitched are large, the stitched images obtained by the traditional image stitching algorithms either cannot completely eliminate the brightness differences, or the resulting stitched images have artificial traces, such as flickering in the video. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, equipment and readable storage medium for eliminating chromatic aberration of stitched images in response to the above technical problems.

[0005] A method for eliminating chromatic aberration of a spliced ​​image, the method comprising:

[0006] Acquire a stitched image obtained by stitching at least two original images;

[0007] Determine a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of a non-overlapping area in the stitched image;

[0008] Based on the determined transition area, the stitched image is subjected to chromatic aberration elimination processing to obtain a stitched image after chromatic aberration elimination.

[0009] In one embodiment, performing color difference elimination processing on the stitched image based on the determined transition area to obtain the stitched image after color difference elimination includes:

[0010] Calculate the pixel gain corresponding to each pixel point in the transition area;

[0011] Calculating the color adjustment ratio corresponding to each pixel point in the transition area according to the pixel gain;

[0012] The color difference elimination process is performed on the stitched image based on the color adjustment ratio to obtain a stitched image after the color difference is eliminated.

[0013] In one embodiment, calculating the pixel gain corresponding to each pixel point in the transition area includes:

[0014] constructing a triangular mesh covering the transition area;

[0015] Calculating pixel gains of pixel points corresponding to vertices of each triangular mesh;

[0016] The pixel gain of each pixel point in each triangular mesh is calculated according to the pixel gain of the pixel point corresponding to the vertex of each triangular mesh, so as to obtain the pixel gain corresponding to each pixel point in the transition area.

[0017] In one embodiment, constructing a triangular mesh covering the transition area includes:

[0018] Selecting at least one pixel point from the overlapping area in the transition area as a first control point;

[0019] Selecting at least one pixel point on the boundary of the non-overlapping area in the transition area as a second control point;

[0020] At least one target pixel point is selected in a transition area between the first control point and the second control point, and a triangular mesh covering the transition area is constructed based on the first control point, the second control point and the target pixel point.

[0021] In one embodiment, the calculating pixel gains of the pixels corresponding to the vertices of each triangular mesh includes:

[0022] Obtaining weights and pixel values ​​of pixel points corresponding to vertices of each of the triangular meshes belonging to the overlapping area;

[0023] The pixel gain of the pixel points corresponding to the vertices of each triangular mesh is calculated according to the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh; the pixel value includes the pixel value of the at least two original images corresponding to the overlapping area.

[0024] In one embodiment, obtaining the weights of the pixel points corresponding to the vertices of each of the triangular meshes belonging to the overlapping area includes:

[0025] Obtaining pixel values ​​of the original images corresponding to each pixel point in the overlapping area;

[0026] Calculating the mutual correlation coefficients between the original images according to the pixel values ​​of the original images;

[0027] Calculate the weight of each pixel in the overlapping area according to the mutual correlation coefficient;

[0028] The weights of the pixel points corresponding to the vertices of each triangular mesh are selected from the weights of each pixel point in the overlapping area.

[0029] In one embodiment, calculating the weight of each pixel in the overlapping area according to the mutual correlation coefficient includes:

[0030] Selecting target pixel points whose mutual correlation coefficient is greater than a mutual correlation coefficient threshold from the overlapping area;

[0031] Calculating the pixel difference between the original images corresponding to each of the target pixels;

[0032] Performing histogram statistics on the pixel differences to obtain a histogram statistics result;

[0033] Obtaining the pixel value corresponding to each pixel point in the overlapping area;

[0034] The weight corresponding to each pixel point in each overlapping area is determined according to the histogram statistical result and the pixel value corresponding to each pixel point in the overlapping area.

[0035] In one embodiment, the stitched image is a stitched image of original resolution, and before determining the transition area in the stitched image, the method further includes:

[0036] Performing resolution reduction processing on the stitched image of the original resolution to obtain a stitched image after the resolution reduction;

[0037] The determining of the transition area in the stitched image comprises:

[0038] Determining a transition region in the mosaicked image after the resolution reduction;

[0039] The step of performing color difference elimination processing on the stitched image based on the color adjustment ratio to obtain a stitched image after color difference elimination includes:

[0040] generating a toning ratio image based on the toning ratio;

[0041] Performing resolution up-processing on the toning ratio image to obtain an up-resolution toning ratio image having the same size as the stitched image of the original resolution;

[0042] The color difference elimination process is performed on the stitched image with the original resolution based on the up-resolution toning ratio image to obtain a stitched image with the color difference eliminated.

[0043] A device for eliminating chromatic aberration of spliced ​​images, the device comprising:

[0044] A stitched image acquisition module, used to acquire a stitched image obtained by stitching at least two original images;

[0045] A transition region determination module, used to determine a transition region in the stitched image; the transition region includes an overlapping region and at least a portion of a non-overlapping region in the stitched image;

[0046] The color difference elimination module is used to perform color difference elimination processing on the stitched image based on the determined transition area to obtain a stitched image after the color difference is eliminated.

[0047] In one embodiment, the color difference elimination module includes a pixel gain calculation module, a color adjustment ratio calculation module and a color difference elimination processing module, wherein:

[0048] The pixel gain calculation module is used to calculate the pixel gain corresponding to each pixel point in the transition area;

[0049] The color adjustment ratio calculation module is used to calculate the color adjustment ratio corresponding to each pixel point in the transition area according to the pixel gain;

[0050] The color difference elimination processing module is used to perform color difference elimination processing on the spliced ​​image based on the color adjustment ratio to obtain a spliced ​​image after the color difference is eliminated.

[0051] In one embodiment, the pixel gain calculation module is further used to:

[0052] constructing a triangular mesh covering the transition area;

[0053] Calculating pixel gains of pixel points corresponding to vertices of each triangular mesh;

[0054] The pixel gain of each pixel point in each triangular mesh is calculated according to the pixel gain of the pixel point corresponding to the vertex of each triangular mesh, so as to obtain the pixel gain corresponding to each pixel point in the transition area.

[0055] In one embodiment, the pixel gain calculation module is further used to:

[0056] Selecting at least one pixel point from the overlapping area in the transition area as a first control point;

[0057] Selecting at least one pixel point on the boundary of the non-overlapping area in the transition area as a second control point;

[0058] At least one target pixel point is selected in a transition area between the first control point and the second control point, and a triangular mesh covering the transition area is constructed based on the first control point, the second control point and the target pixel point.

[0059] In one embodiment, the pixel gain calculation module is further used to:

[0060] Obtaining weights and pixel values ​​of pixel points corresponding to vertices of each of the triangular meshes belonging to the overlapping area;

[0061] The pixel gain of the pixel points corresponding to the vertices of each triangular mesh is calculated according to the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh; the pixel value includes the pixel value of the at least two original images corresponding to the overlapping area.

[0062] In one embodiment, the pixel gain calculation module is further used to:

[0063] Obtaining pixel values ​​of the original images corresponding to each pixel point in the overlapping area;

[0064] Calculating the mutual correlation coefficients between the original images according to the pixel values ​​of the original images;

[0065] Calculate the weight of each pixel in the overlapping area according to the mutual correlation coefficient;

[0066] The weights of the pixel points corresponding to the vertices of each triangular mesh are selected from the weights of each pixel point in the overlapping area.

[0067] In one embodiment, the pixel gain calculation module is further used to:

[0068] Selecting target pixel points whose mutual correlation coefficient is greater than a mutual correlation coefficient threshold from the overlapping area;

[0069] Calculating the pixel difference between the original images corresponding to each of the target pixels;

[0070] Performing histogram statistics on the pixel differences to obtain a histogram statistics result;

[0071] Obtaining the pixel value corresponding to each pixel point in the overlapping area;

[0072] The weight corresponding to each pixel point in each overlapping area is determined according to the histogram statistical result and the pixel value corresponding to each pixel point in the overlapping area.

[0073] In one embodiment, the stitched image is a stitched image of original resolution, and before determining the transition area in the stitched image, the apparatus further includes:

[0074] A resolution adjustment module, used for reducing the resolution of the stitched image of the original resolution to obtain a stitched image after the resolution is reduced;

[0075] The transition area determination module is further used for:

[0076] Determining a transition region in the mosaicked image after the resolution reduction;

[0077] The color difference elimination processing module is also used for:

[0078] generating a toning ratio image based on the toning ratio;

[0079] Performing resolution up-processing on the toning ratio image to obtain an up-resolution toning ratio image having the same size as the stitched image of the original resolution;

[0080] The color difference elimination process is performed on the stitched image with the original resolution based on the up-resolution toning ratio image to obtain a stitched image with the color difference eliminated.

[0081] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0082] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.

[0083] The above-mentioned method, device, equipment and readable storage medium for eliminating chromatic aberration of stitched images are implemented by obtaining a stitched image obtained by stitching at least two original images; determining a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of non-overlapping areas in the stitched image; wherein at least a portion of non-overlapping areas in the transition area can be distributed on one side of the overlapping area or on both sides of the overlapping area; based on the determined transition area, the stitched image is subjected to chromatic aberration elimination processing, thereby obtaining a stitched image after chromatic aberration elimination, thereby improving the efficiency of chromatic aberration elimination of the stitched image. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 A diagram showing an application environment of a method for eliminating chromatic aberration in image splicing in one embodiment;

[0085] Figure 2 A schematic flow chart of a method for eliminating chromatic aberration in image stitching according to an embodiment;

[0086] Figure 3 A schematic diagram of splicing images in an embodiment;

[0087] Figure 4 A schematic diagram of constructing a triangular mesh in one embodiment;

[0088] Figure 5 is a flow chart of a method for eliminating chromatic aberration in image stitching in another embodiment;

[0089] Figure 6 A schematic diagram showing a comparison before and after color difference elimination of image stitching in one embodiment;

[0090] Figure 7 A schematic diagram showing the comparison before and after the color difference elimination of image stitching in another embodiment;

[0091] Figure 8 is a structural block diagram of a chromatic aberration elimination device for image splicing in one embodiment;

[0092] Fig. 9 is an internal structure diagram of a computer device in one embodiment;

[0093] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0094] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0095] The color difference elimination method of the spliced ​​image provided by the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. It can be understood that the method can be applied to the terminal or the server, and can also be applied to the system including the terminal and the server, and is implemented through the interaction between the terminal and the server. Taking the application of the method to the terminal as an example, the terminal 102 obtains a spliced ​​image obtained by splicing at least two original images; determines the transition area in the spliced ​​image; the transition area includes the overlapping area and at least a part of the non-overlapping area in the spliced ​​image; based on the determined transition area, the spliced ​​image is subjected to color difference elimination processing to obtain a spliced ​​image after the color difference is eliminated. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster consisting of multiple servers.

[0096] In one embodiment, Figure 2 As shown, a method for eliminating chromatic aberration of a spliced ​​image is provided, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0097] S202, obtaining a stitched image obtained by stitching at least two original images.

[0098] The original image is an image used for image stitching, and there are overlapping areas between the original images. The original image can be a source image obtained at different times, different viewing angles, or different image acquisition devices, or a preprocessed image obtained after preprocessing the source image obtained at different times, different viewing angles, or different image acquisition devices. The stitched image is a stitched image obtained by stitching and fusing at least two original images through an image stitching algorithm (including but not limited to an image registration algorithm and an image fusion algorithm).

[0099] Image registration is to match images with overlapping areas through some similarity measurement. It is a key step in image stitching. Traditional image registration algorithms include SIFT feature extraction and feature point matching algorithm, A-KAZE feature extraction and bidirectional KNN registration algorithm. Image fusion mainly eliminates the stitching seams generated in the image registration process, or the transition discontinuity caused by uneven illumination caused by environmental changes, so as to achieve information complementarity in overlapping areas, remove redundant information, and ultimately improve the quality of the panoramic image. Image fusion algorithms include pixel-level, feature-level, decision-level and other hierarchical image fusion algorithms. Among them, pixel-level image fusion algorithms include average method, weighted average method, median filter method and multi-resolution fusion.

[0100] In one embodiment, after acquiring at least two original images, the terminal uses an image registration algorithm and an image fusion algorithm to stitch and fuse the acquired original images to obtain a stitched image. The terminal may acquire source images through a built-in image acquisition device or an external image acquisition device associated with the terminal, and determine the original image for image stitching based on the source image. The built-in image acquisition device may be a camera, and the external image acquisition device associated with the terminal may be an ordinary camera or a panoramic camera.

[0101] In one embodiment, after the terminal acquires source images through a built-in image acquisition device or an external image acquisition device associated with the terminal, a preprocessing operation is performed on at least two acquired original images to obtain a preprocessed image, and the preprocessed image is determined as an original image for image stitching, and a stitched image obtained by stitching at least two original images is acquired. The preprocessing operation may be an operation such as image denoising, image geometry correction, and image color correction.

[0102] S204, determining a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of a non-overlapping area in the stitched image.

[0103] The overlapping area includes a stitching seam generated after the images are stitched together.

[0104] In one embodiment, after acquiring the stitched image, the terminal determines the overlapping area in the stitched image, and determines the transition area based on the determined overlapping area, wherein the determined transition area includes the overlapping area and at least a portion of the non-overlapping area. The width of the transition area may be a preset ratio of the width of the stitched image, for example, the width of the transition area is 1 / 3 of the width of the stitched image.

[0105] In one embodiment, after acquiring a stitched image with a stitching seam, the terminal determines a transition area in the stitched image. Specifically, after acquiring a stitched image with a stitching seam, the terminal determines the overlap area and the position of the stitching seam in the stitching image, and takes the stitching seam as the center line, selects an area of ​​preset width on both sides of the stitching seam as the transition area of ​​the stitching image, and the transition area includes an overlap area and at least a portion of a non-overlap area. The preset width can be determined according to the size of the stitched image. For example, if the width of the stitched image is W, the preset width d can be d=aW, 0<a<1.

[0106] Figure 3 The figure shows a stitched image obtained by stitching a first original image 302a and a second original image 302b in an embodiment. The conventional image stitching algorithm cannot effectively eliminate the brightness difference between the original images, so that a stitching seam 304 is generated in the stitched image. With the stitching seam 304 as the center line, areas with a preset width on both sides of the stitching seam are selected as transition areas of the stitched image.

[0107] S206: Based on the determined transition area, perform color difference elimination processing on the stitched image to obtain a stitched image after the color difference is eliminated.

[0108] In one embodiment, after determining the transition area, the terminal may use alpha fusion, multi-band fusion, Poisson fusion and other methods to perform pixel fusion on the determined transition area to eliminate color difference of the stitched image and obtain a stitched image after color difference elimination.

[0109] In one embodiment, S206 specifically includes the following steps:

[0110] Step 1: Calculate the pixel gain corresponding to each pixel point in the transition area.

[0111] Specifically, the terminal can use a triangular mesh method to calculate the pixel gain corresponding to each pixel point in the transition area, wherein the triangular mesh method refers to constructing a triangular mesh covering the transition area, and calculating the pixel gain corresponding to the pixel points corresponding to the vertices of the triangular mesh to achieve the calculation of the pixel gain corresponding to each pixel point in the transition area.

[0112] In one embodiment, after determining the transition area, the terminal selects some pixels in the transition area and constructs a triangular mesh using the selected pixels as vertices of the triangular mesh. The process of constructing the triangular mesh can adopt a Delaunary triangulation algorithm. The specific algorithm for implementing the Delaunary triangulation can be any one of a divide-and-conquer algorithm, a point-by-point insertion method, or a triangulation network generation method.

[0113] In one embodiment, the terminal constructs a triangular mesh covering the transition area, including: selecting at least one pixel point from the overlapping area in the transition area as a first control point; selecting at least one pixel point on the boundary of the non-overlapping area in the transition area as a second control point; selecting at least one target pixel point in the transition area between the first control point and the second control point, and constructing a triangular mesh covering the transition area based on the first control point, the second control point and the target pixel point.

[0114] For example, Figure 4 A schematic diagram of constructing a triangular mesh is shown in FIG. Figure 4 As shown, first determine a number of vertices for constructing a triangular mesh, and then construct a triangular mesh based on the determined vertices. In the embodiment of the present application, the pixel points selected in the transition area are used to construct a triangular mesh based on the selected pixel points. The process of selecting pixel points is to select pixel points on the left and right boundaries of the transition area as control points, and then select some pixel points between the control points on the left boundary and the control points on the right boundary; or, select at least one pixel point from the overlapping area in the transition area as the first control point; select at least one pixel point from the boundary of the non-overlapping area in the transition area as the second control point; select at least one target pixel point in the transition area between the first control point and the second control point, and construct a triangular mesh covering the transition area based on the first control point, the second control point and the target pixel point.

[0115] In one embodiment, after constructing a triangular mesh covering the entire transition area, the terminal calculates the pixel gain of the pixel points corresponding to the vertices of any triangle in the constructed triangular mesh, and calculates the pixel gain of each pixel point inside and on the edge of each triangle based on the pixel gain of the pixel points corresponding to the vertices of the triangle, to obtain the pixel gain corresponding to each pixel point in the transition area.

[0116] Step 2: Calculate the color adjustment ratio corresponding to each pixel in the transition area according to the pixel gain.

[0117] The color adjustment ratio is a ratio determined for each pixel point in the transition area based on its corresponding pixel gain.

[0118] In one embodiment, after calculating the pixel gain corresponding to each pixel point in the transition area, the terminal uses a color adjustment ratio calculation formula to calculate the color adjustment ratio corresponding to each pixel point in the transition area according to the calculated pixel gain. The color adjustment ratio calculation formula is as follows:

[0119]

[0120] Among them, R (x,y) is the color ratio corresponding to the pixel with coordinates (x, y) in the stitched image, X (x,y) is the pixel gain corresponding to the pixel point with coordinates (x, y) in the stitched image, I (x,y) is the pixel value corresponding to the pixel point with coordinates (x, y) in the stitched image, and bias is the bias.

[0121] Step 3: performing color difference elimination processing on the stitched image based on the color adjustment ratio to obtain a stitched image after color difference elimination.

[0122] In one embodiment, after calculating the color adjustment ratio corresponding to each pixel in the transition area, the terminal performs color difference elimination processing on the transition area in the stitched image according to the color adjustment ratio corresponding to each pixel to obtain the transition area after color adjustment, and uses the transition area after color adjustment to replace the transition area before color adjustment to obtain the stitched image after color difference elimination.

[0123] In one embodiment, after calculating the color ratio corresponding to each pixel in the transition area, the terminal obtains the color ratio corresponding to each pixel in the non-transition area in the stitched image (the color ratio of the non-transition area is 1), thereby obtaining the color ratio corresponding to each pixel in the stitched image, and performs color difference elimination processing on the stitched image according to the color ratio corresponding to each pixel in the stitched image to obtain a stitched image after the color difference is eliminated.

[0124] Specifically, the formula used in the color difference elimination process is:

[0125] Dst (x,y) =∑α{R (x,y) ·(I (x,y) +bias)-bias}

[0126] Among them, Dst (x,y) is the pixel value corresponding to the pixel point with coordinates (x, y) in the stitched image after color adjustment, and α is the fusion weight corresponding to the pixel point with coordinates (x, y) in the stitched image when the stitched image is obtained by the traditional image stitching algorithm.

[0127] In the above embodiment, the terminal obtains a stitched image obtained by stitching at least two original images; determines a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of a non-overlapping area in the stitched image; calculates a pixel gain corresponding to each pixel in the transition area; calculates a color adjustment ratio corresponding to each pixel in the transition area according to the pixel gain; and performs color difference elimination processing on the stitched image based on the color adjustment ratio, thereby obtaining a stitched image after color difference elimination, thereby improving the efficiency of color difference elimination of the stitched image.

[0128] In one embodiment, the terminal calculates the pixel gain corresponding to each pixel point in the transition area, including: constructing a triangular mesh covering the transition area, calculating the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, calculating the pixel gain of each pixel point in each triangular mesh according to the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, and obtaining the pixel gain corresponding to each pixel point in the transition area.

[0129] In one embodiment, the terminal calculates the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, including: obtaining the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh belonging to the overlapping area in the transition area, and calculating the pixel gain of the pixel points corresponding to the vertices of each triangular mesh according to the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh, the pixel values ​​including the pixel values ​​of at least two original images corresponding to the overlapping area.

[0130] Take a stitched image formed by stitching two original images as an example. The two original images are the first original image and the second original image. After obtaining the weights and pixel values ​​of the pixels corresponding to the vertices of each triangular mesh belonging to the overlapping area in the transition area, the terminal calculates the pixel gains of the pixels corresponding to the vertices of the triangular meshes through the pixel gain calculation formula. Specifically, the pixel gain calculation formula is as follows:

[0131]

[0132] Wherein, for any vertex of a triangular mesh, I1 is the pixel value of the first original image corresponding to the pixel point corresponding to the vertex of the overlapping area in the transition area, I2 is the pixel value of the second original image corresponding to the pixel point corresponding to the vertex of the overlapping area in the transition area, Weight is the weight of the pixel point corresponding to the vertex of the overlapping area in the transition area, X1 is the pixel gain of the first original image corresponding to the pixel point corresponding to the vertex of the overlapping area in the transition area, X2 is the pixel gain of the second original image corresponding to the pixel point corresponding to the vertex of the overlapping area in the transition area, and X v , X v'are the pixel gains corresponding to two adjacent vertices of the triangular mesh in the transition area of ​​the same image, which are used to smooth the pixel gain; λ is the adjustment coefficient, which is used to balance the smooth pixel gain and eliminate the brightness and color differences caused by the stitching of different images.

[0133] Specifically, the pixel gain calculation formula can be solved by the conjugate gradient algorithm (CG). The conjugate gradient algorithm has attracted much attention in optimization problems and has two uses. One is to solve the linear equation Ax=b; the other is to solve the optimization problem. Compared with the steepest descent method, the conjugate gradient algorithm has no additional matrix storage and converges faster than the steepest descent method. The solution process can refer to the following process, for example:

[0134]

[0135] 2(A T A+Γ T Γ)X-2A T f=0

[0136] (A T A+Γ T Γ)X=A T f

[0137] Among them, A T A+Γ T Γ is very sparse and is symmetric and positive semidefinite.

[0138] In the above embodiment, the terminal constructs a triangular mesh covering the transition area, calculates the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, and calculates the pixel gain of each pixel point in each triangular mesh according to the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, and obtains the pixel gain corresponding to each pixel point in the transition area, thereby ensuring that the adjusted pixel values ​​of the pixel points in the transition area are smoothly transitioned, and then obtaining a stitched image after the color difference is eliminated, thereby avoiding the stitched image distortion caused by the large color difference between the overlapping area and other areas of the stitched image.

[0139] In one embodiment, the process by which the terminal obtains the weights of the pixel points corresponding to the vertices of each triangular mesh belonging to the overlapping area includes: obtaining the pixel values ​​of each original image corresponding to each pixel point in the overlapping area; calculating the mutual correlation coefficient between the original images based on the pixel values ​​of each original image; calculating the weights of each pixel point in the overlapping area based on the mutual correlation coefficient; and selecting the weights of the pixel points corresponding to the vertices of each triangular mesh from the weights of each pixel point in the overlapping area.

[0140] Among them, the cross-correlation coefficient (NCC) represents the degree of matching between the original images. The NCC (normalized cross-correlation) algorithm is a matching method based on image grayscale information.

[0141] The calculation of the mutual correlation coefficient is described by taking a spliced ​​image formed by splicing two original images as an example. The two original images are the first original image and the second original image. After obtaining the pixel value of the first original image and the pixel value of the second original image corresponding to each pixel point in the overlapping area, the terminal uses the NCC algorithm based on the pixel value of the first original image and the pixel value of the second original image to calculate the mutual correlation coefficient between the first original image and the second original image corresponding to each pixel point in the overlapping area. The calculation formula of the mutual correlation coefficient is as follows:

[0142]

[0143] Among them, Ncc is the correlation coefficient between the first original image and the second original image corresponding to the pixel points in the overlapping area in the transition area, I1 is the pixel value of the first original image corresponding to the pixel points in the overlapping area in the transition area, and I2 is the pixel value of the second original image corresponding to the pixel points in the overlapping area in the transition area.

[0144] In the above embodiment, the terminal obtains the pixel values ​​of the original images corresponding to the pixel points in the overlapping area, calculates the mutual correlation coefficients between the original images according to the pixel values ​​of the original images, and calculates the weights of the pixel points in the overlapping area according to the mutual correlation coefficients, thereby obtaining the weights of the pixel points corresponding to the vertices of each triangular mesh, and then obtaining the pixel gain corresponding to the pixel points in the transition area, thereby eliminating the color difference of the stitched image and avoiding the distortion of the stitched image due to the large color difference between the overlapping area and other areas of the stitched image.

[0145] In one embodiment, the terminal calculates the weight of each pixel in the overlapping area according to the mutual correlation coefficient, including: selecting target pixel points whose mutual correlation coefficient is greater than the mutual correlation coefficient threshold from the overlapping area; calculating the pixel difference between the original images corresponding to each target pixel point; performing histogram statistics on the pixel difference to obtain the histogram statistics result; obtaining the pixel value corresponding to each pixel point in the overlapping area; and determining the weight corresponding to each pixel point in each overlapping area according to the histogram statistics result and the pixel value corresponding to each pixel point in the overlapping area. The selected target pixel point is a pixel point with a high degree of matching between the corresponding original images when the overlapping area is stitched.

[0146] Specifically, after calculating the mutual correlation coefficient Ncc between the first original image and the second original image corresponding to the pixel points in the overlapping area, the terminal selects target pixel points whose mutual correlation coefficient Ncc is greater than the mutual correlation coefficient threshold m from the overlapping area, and calculates the pixel difference between the original images corresponding to each target pixel point, and determines the weight corresponding to each target pixel point according to the pixel difference corresponding to the target pixel point. The difference calculation formula of the target pixel point is as follows:

[0147] diff=I1-I2

[0148] Among them, diff is the pixel difference between the first original image and the second original image corresponding to the target pixel point, I1 is the pixel value of the first original image corresponding to the target pixel point in the overlapping area in the transition area, and I2 is the pixel value of the second original image corresponding to the target pixel point in the overlapping area in the transition area.

[0149] Specifically, after calculating the pixel difference corresponding to the target pixel point, the terminal performs histogram statistics on the pixel difference to obtain a histogram statistical result, and obtains a preset proportion (e.g., 80%) of pixel difference statistical data from the histogram statistical result, determines the maximum pixel difference and the minimum pixel difference corresponding to the preset proportion of pixel difference statistical data, and then adjusts the maximum pixel difference and the minimum pixel difference according to the preset expansion ratio to obtain the expanded maximum pixel difference and the expanded minimum pixel difference, and calculates the weight corresponding to each target pixel point based on the maximum pixel difference, the minimum pixel difference, the expanded maximum pixel difference, the expanded minimum pixel difference, and the pixel values ​​corresponding to each target pixel point. For example, the maximum pixel difference and the minimum pixel difference are p and q, respectively, and the preset expansion ratio is 10%, then the corresponding expanded maximum pixel difference is (1+10%)p, and the expanded minimum pixel difference is (1-10%)q. The weight calculation formula is as follows:

[0150]

[0151] Among them, Weight is the weight corresponding to the target pixel in the overlapping area, I is the pixel value of the target pixel in the overlapping area, minThresh is the minimum pixel difference, maxThresh is the maximum pixel difference, threshBot is the expanded minimum pixel difference, and threshTop is the expanded maximum pixel difference.

[0152] In the above embodiment, the terminal selects target pixels whose mutual correlation coefficients are greater than the mutual correlation coefficient threshold from the overlapping area, and calculates the weights corresponding to the target pixels, thereby ensuring a high degree of matching between the pixels of the original image corresponding to the selected target pixels, thereby enabling the pixel gain of each pixel in the transition area calculated based on the weight of the target pixel to achieve a better chromatic aberration elimination effect, thereby avoiding distortion of the stitched image due to large chromatic aberration between the overlapping area and other areas of the stitched image.

[0153] In one embodiment, the stitched image acquired by the terminal is a stitched image of original resolution. Before determining the transition area in the stitched image, the terminal may also perform resolution reduction processing on the stitched image of original resolution to obtain a stitched image after the resolution reduction, and determine the transition area in the stitched image after the resolution reduction, and then execute steps 1 and 2 in S206, and generate a toning ratio image based on the toning ratio calculated in step 2, perform resolution increase processing on the toning ratio image to obtain an increased resolution toning ratio image of the same size as the stitched image of original resolution, and perform color difference elimination processing on the stitched image of original resolution based on the increased resolution toning ratio image to obtain a stitched image after the color difference elimination. The resolution reduction processing process is specifically: reducing the resolution of the stitched image of original resolution to a preset size.

[0154] In one embodiment, before the terminal uses a traditional image stitching algorithm to stitch the original images to obtain a stitched image, it can perform resolution reduction processing on each original image, and stitch the original images after the resolution reduction processing to obtain a stitched image after the resolution reduction, and determine the transition area in the stitched image after the resolution reduction, and then execute step 1 and step 2 in S206, and generate a toning ratio image based on the toning ratio calculated in step 2, perform resolution increase processing on the toning ratio image to obtain an increased resolution toning ratio image of the same size as the stitched image of the original resolution, and perform color difference elimination processing on the stitched image of the original resolution based on the increased resolution toning ratio image to obtain a stitched image after the color difference elimination. For example, taking two 6K panoramic images that need to be stitched as an example, the resolution is reduced to 200*100, and then the two panoramic images with a resolution of 200*100 are stitched.

[0155] In the above embodiment, the terminal downgrades the stitched image of the original resolution to obtain a stitched image with downgraded resolution, and then calculates the pixel gain of the downgraded image using a triangular mesh method. The use of downgrading the resolution and / or using a triangular mesh method to calculate the pixel gain can improve the efficiency of color difference elimination processing on the stitched image.

[0156] In one embodiment, Figure 5As shown, a method for eliminating chromatic aberration of a spliced ​​image is also provided, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0157] S502: Acquire a stitched image obtained by stitching at least two original images.

[0158] S504, determining a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of a non-overlapping area in the stitched image.

[0159] S506, constructing a triangular mesh covering the transition area.

[0160] S508, obtaining pixel values ​​of the original images corresponding to the pixel points in the overlapping area.

[0161] S510: Select target pixel points whose cross-correlation coefficients are greater than a cross-correlation coefficient threshold from the overlapping area.

[0162] S512, calculating the pixel difference between the original images corresponding to each target pixel.

[0163] S514, performing histogram statistics on the pixel differences to obtain a histogram statistics result.

[0164] S516, obtaining the pixel value corresponding to each pixel point in the overlapping area.

[0165] S518, determining the weight corresponding to each pixel point in each overlapping area according to the histogram statistical result and the pixel value corresponding to each pixel point in the overlapping area.

[0166] S520, calculating the weight of each pixel in the overlapping area according to the mutual correlation coefficient.

[0167] S522, selecting the weights of the pixel points corresponding to the vertices of each triangular mesh from the weights of each pixel point in the overlapping area.

[0168] S524, obtaining pixel values ​​of pixels corresponding to vertices of each triangular mesh belonging to the overlapping area.

[0169] S526, calculating the pixel gain of the pixel points corresponding to the vertices of each triangular mesh according to the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh.

[0170] S528, calculating the pixel gain of each pixel point in each triangular mesh according to the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, and obtaining the pixel gain corresponding to each pixel point in the transition area.

[0171] S530: Calculate the color adjustment ratio corresponding to each pixel point in the transition area according to the pixel gain.

[0172] S532, performing color difference elimination processing on the stitched image based on the color adjustment ratio to obtain a stitched image after the color difference is eliminated.

[0173] For example, Figure 6 Shows the Figure 3 The stitched image including the stitching seam shown in FIG. 1 is processed by the above-mentioned stitched image chromatic aberration elimination method to obtain a stitched image after chromatic aberration elimination. Figure 6 It can be seen that the stitched image obtained by the above-mentioned stitched image chromatic aberration elimination method has no stitching seams, and the transition between the overlapping area and the non-overlapping area is more natural; Figure 7 In a practical example, a first fisheye image 702a and a second fisheye image 702b are taken with back-to-back dual fisheye lenses, a traditional image stitching algorithm is used to obtain a fisheye stitched image 704 including two stitching seams, and the above-mentioned stitched image chromatic aberration elimination method is used to process the fisheye stitched image 704 to obtain a fisheye stitched image 706 after chromatic aberration elimination.

[0174] It should be understood that although Figure 2 and 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 and 5 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0175] In one embodiment, Figure 8 As shown, a color difference elimination device for stitched images is provided, comprising: a stitched image acquisition module 802, a transition area determination module 804, and a color difference elimination module 806, wherein:

[0176] The stitched image acquisition module 802 is used to acquire a stitched image obtained by stitching at least two original images;

[0177] A transition region determination module 804 is used to determine a transition region in the stitched image; the transition region includes an overlapping region and at least a portion of a non-overlapping region in the stitched image;

[0178] The color difference elimination module 806 is used to perform color difference elimination processing on the stitched image based on the determined transition area to obtain a stitched image after the color difference is eliminated.

[0179] In one embodiment, the color difference elimination module 806 includes: a pixel gain calculation module, a color adjustment ratio calculation module and a color difference elimination processing module, wherein:

[0180] A pixel gain calculation module, used to calculate the pixel gain corresponding to each pixel point in the transition area;

[0181] A color adjustment ratio calculation module, used to calculate the color adjustment ratio corresponding to each pixel point in the transition area according to the pixel gain;

[0182] The color difference elimination processing module is used to perform color difference elimination processing on the stitched image based on the color adjustment ratio to obtain the stitched image after the color difference is eliminated.

[0183] In the above embodiment, the terminal obtains a stitched image obtained by stitching at least two original images; determines a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of a non-overlapping area in the stitched image; calculates a pixel gain corresponding to each pixel in the transition area; calculates a color adjustment ratio corresponding to each pixel in the transition area according to the pixel gain; and performs color difference elimination processing on the stitched image based on the color adjustment ratio, thereby obtaining a stitched image after color difference elimination, thereby improving the efficiency of color difference elimination of the stitched image.

[0184] In one embodiment, the pixel gain calculation module is further used to:

[0185] Construct a triangular mesh covering the transition area;

[0186] Calculate the pixel gain of the pixel points corresponding to the vertices of each triangular mesh;

[0187] The pixel gain of each pixel point in each triangular mesh is calculated according to the pixel gain of the pixel point corresponding to the vertex of each triangular mesh, and the pixel gain corresponding to each pixel point in the transition area is obtained.

[0188] In one embodiment, the pixel gain calculation module is further used to:

[0189] Select at least one pixel point from the overlapping area in the transition area as a first control point;

[0190] Select at least one pixel point on the boundary of the non-overlapping area in the transition area as a second control point;

[0191] At least one target pixel point is selected in a transition area between the first control point and the second control point, and a triangular mesh covering the transition area is constructed based on the first control point, the second control point and the target pixel point.

[0192] In one embodiment, the pixel gain calculation module is further used to:

[0193] Obtain the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh belonging to the overlapping area;

[0194] The pixel gains of the pixels corresponding to the vertices of each triangular mesh are calculated according to the weights and pixel values ​​of the pixels corresponding to the vertices of each triangular mesh; the pixel values ​​include the pixel values ​​of at least two original images corresponding to the overlapping areas.

[0195] In the above embodiment, the terminal constructs a triangular mesh covering the transition area, calculates the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, and calculates the pixel gain of each pixel point in each triangular mesh according to the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, and obtains the pixel gain corresponding to each pixel point in the transition area, thereby ensuring that the adjusted pixel values ​​of the pixel points in the transition area are smoothly transitioned, and then obtaining a stitched image after the color difference is eliminated, thereby avoiding the stitched image distortion caused by the large color difference between the overlapping area and other areas of the stitched image.

[0196] In one embodiment, the pixel gain calculation module is further used to:

[0197] Obtain the pixel value of each original image corresponding to each pixel point in the overlapping area;

[0198] Calculating the mutual correlation coefficients between the original images according to the pixel values ​​of the original images;

[0199] Calculate the weight of each pixel in the overlapping area according to the mutual correlation coefficient;

[0200] The weights of the pixel points corresponding to the vertices of each triangular mesh are selected from the weights of each pixel point in the overlapping area.

[0201] In the above embodiment, the terminal obtains the pixel values ​​of the original images corresponding to the pixel points in the overlapping area, calculates the mutual correlation coefficients between the original images according to the pixel values ​​of the original images, and calculates the weights of the pixel points in the overlapping area according to the mutual correlation coefficients, thereby obtaining the weights of the pixel points corresponding to the vertices of each triangular mesh, and then obtaining the pixel gain corresponding to the pixel points in the transition area, thereby eliminating the color difference of the stitched image and avoiding the distortion of the stitched image due to the large color difference between the overlapping area and other areas of the stitched image.

[0202] In one embodiment, the pixel gain calculation module is further used to:

[0203] Select target pixel points whose mutual correlation coefficient is greater than a mutual correlation coefficient threshold value from the overlapping area;

[0204] Calculate the pixel difference between the original images corresponding to each target pixel;

[0205] Perform histogram statistics on pixel differences to obtain histogram statistics results;

[0206] Get the pixel value corresponding to each pixel point in the overlapping area;

[0207] The weight corresponding to each pixel point in each overlapping area is determined according to the histogram statistical result and the pixel value corresponding to each pixel point in the overlapping area.

[0208] In the above embodiment, the terminal selects target pixels whose mutual correlation coefficients are greater than the mutual correlation coefficient threshold from the overlapping area, and calculates the weights corresponding to the target pixels, thereby ensuring a high degree of matching between the pixels of the original image corresponding to the selected target pixels, thereby enabling the pixel gain of each pixel in the transition area calculated based on the weight of the target pixel to achieve a better chromatic aberration elimination effect, thereby avoiding distortion of the stitched image due to large chromatic aberration between the overlapping area and other areas of the stitched image.

[0209] In one embodiment, the stitched image is a stitched image of original resolution, and before determining the transition area in the stitched image, the device further includes: a resolution adjustment module, wherein:

[0210] A resolution adjustment module is used to reduce the resolution of the spliced ​​image with the original resolution to obtain a spliced ​​image with reduced resolution;

[0211] The transition region determination module 804 is further configured to:

[0212] Determine the transition area in the down-scaled stitched image;

[0213] The color difference elimination processing module is also used for:

[0214] generating a toning ratio image based on the toning ratio;

[0215] Performing resolution up-processing on the toning ratio image to obtain an up-resolution toning ratio image having the same size as the stitched image of the original resolution;

[0216] The color difference elimination processing is performed on the stitched image with the original resolution based on the up-resolution toning ratio image to obtain the stitched image after the color difference elimination.

[0217] In the above embodiment, the terminal obtains a stitched image with a downgraded resolution by down-resolution processing on the stitched image of the original resolution, and after calculating the pixel gain and the color adjustment ratio of the down-resolution image, the time for calculating the pixel gain and the color adjustment ratio can be reduced, thereby improving the efficiency of color difference elimination processing on the stitched image.

[0218] The specific definition of the color difference elimination device for stitched images can be found in the definition of the color difference elimination method for stitched images above, which will not be repeated here. Each module in the above-mentioned color difference elimination device for stitched images can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0219] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store spliced ​​image data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for eliminating color difference of a spliced ​​image is implemented.

[0220] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for eliminating chromatic aberration of a spliced ​​image is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.

[0221] Those skilled in the art will understand that Fig. 9The structure shown in or 10 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0222] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the following steps: obtaining a stitched image obtained by stitching at least two original images; determining a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of a non-overlapping area in the stitched image; and performing chromatic aberration elimination processing on the stitched image based on the determined transition area to obtain a stitched image after chromatic aberration elimination.

[0223] In one embodiment, when the computer program is executed by the processor to perform a step of performing a color difference elimination process on the stitched image based on the determined transition area to obtain the stitched image after the color difference is eliminated, the processor specifically performs the following steps: calculating the pixel gain corresponding to each pixel point in the transition area; calculating the color adjustment ratio corresponding to each pixel point in the transition area according to the pixel gain; performing a color difference elimination process on the stitched image based on the color adjustment ratio to obtain the stitched image after the color difference is eliminated.

[0224] In one embodiment, when the computer program is executed by a processor to calculate the pixel gain corresponding to each pixel point in the transition area, the processor specifically performs the following steps: constructing a triangular mesh covering the transition area; calculating the pixel gain of the pixel points corresponding to the vertices of each triangular mesh; calculating the pixel gain of each pixel point in each triangular mesh based on the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, to obtain the pixel gain corresponding to each pixel point in the transition area.

[0225] In one embodiment, when the computer program is executed by the processor to construct a triangular mesh covering the transition area, the processor specifically executes the following steps: selecting at least one pixel point from the overlapping area in the transition area as a first control point; selecting at least one pixel point from the boundary of the non-overlapping area in the transition area as a second control point; selecting at least one target pixel point in the transition area between the first control point and the second control point, and constructing a triangular mesh covering the transition area based on the first control point, the second control point and the target pixel point.

[0226] In one embodiment, when the computer program is executed by a processor to calculate the pixel gains of the pixel points corresponding to the vertices of each triangular mesh, the processor specifically executes the following steps: obtaining the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh belonging to the overlapping area; calculating the pixel gains of the pixel points corresponding to the vertices of each triangular mesh based on the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh; the pixel values ​​include the pixel values ​​of at least two original images corresponding to the overlapping area.

[0227] In one embodiment, when the computer program is executed by the processor to obtain the weights of the pixel points corresponding to the vertices of each triangular mesh belonging to the overlapping area, the processor specifically executes the following steps: obtaining the pixel values ​​of each original image corresponding to each pixel point in the overlapping area; calculating the mutual correlation coefficient between the original images based on the pixel values ​​of each original image; calculating the weights of each pixel point in the overlapping area based on the mutual correlation coefficient; and selecting the weights of the pixel points corresponding to the vertices of each triangular mesh from the weights of each pixel point in the overlapping area.

[0228] In one embodiment, when the computer program is executed by a processor to perform the step of calculating the weight of each pixel point in the overlapping area according to the mutual correlation coefficient, the processor specifically performs the following steps: selecting target pixel points whose mutual correlation coefficients are greater than the mutual correlation coefficient threshold from the overlapping area; calculating the pixel difference between the original images corresponding to each target pixel point; performing histogram statistics on the pixel difference to obtain a histogram statistical result; obtaining the pixel value corresponding to each pixel point in the overlapping area; and determining the weight corresponding to each pixel point in each overlapping area according to the histogram statistical result and the pixel value corresponding to each pixel point in the overlapping area.

[0229] In one embodiment, before the step of stitching the image to be a stitched image of original resolution and determining the transition area in the stitched image is executed by the processor, the computer program causes the processor to further execute the following steps: performing resolution reduction processing on the stitched image of original resolution to obtain a stitched image after the resolution reduction; when the step of determining the transition area in the stitched image is executed by the processor, the computer program causes the processor to specifically execute the following steps: determining the transition area in the stitched image after the resolution reduction; when the computer program causes the processor to perform color difference elimination processing on the stitched image based on the color ratio to obtain a stitched image after the color difference elimination, the computer program causes the processor to specifically execute the following steps: generating a color ratio image based on the color ratio; performing resolution increase processing on the color ratio image to obtain a color ratio image with an increased resolution and the same size as the stitched image of original resolution; performing color difference elimination processing on the stitched image of original resolution based on the increased resolution color ratio image to obtain a stitched image after the color difference elimination.

[0230] In one embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the processor executes the following steps: obtaining a stitched image obtained by stitching at least two original images; determining a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of a non-overlapping area in the stitched image; and based on the determined transition area, performing chromatic aberration elimination processing on the stitched image to obtain a stitched image after chromatic aberration elimination.

[0231] In one embodiment, when the computer program is executed by the processor to perform a step of performing a color difference elimination process on the stitched image based on the determined transition area to obtain the stitched image after the color difference is eliminated, the processor specifically performs the following steps: calculating the pixel gain corresponding to each pixel point in the transition area; calculating the color adjustment ratio corresponding to each pixel point in the transition area according to the pixel gain; performing a color difference elimination process on the stitched image based on the color adjustment ratio to obtain the stitched image after the color difference is eliminated.

[0232] In one embodiment, when the computer program is executed by a processor to calculate the pixel gain corresponding to each pixel point in the transition area, the processor specifically performs the following steps: constructing a triangular mesh covering the transition area; calculating the pixel gain of the pixel points corresponding to the vertices of each triangular mesh; calculating the pixel gain of each pixel point in each triangular mesh based on the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, to obtain the pixel gain corresponding to each pixel point in the transition area.

[0233] In one embodiment, when the computer program is executed by the processor to construct a triangular mesh covering the transition area, the processor specifically executes the following steps: selecting at least one pixel point from the overlapping area in the transition area as a first control point; selecting at least one pixel point from the boundary of the non-overlapping area in the transition area as a second control point; selecting at least one target pixel point in the transition area between the first control point and the second control point, and constructing a triangular mesh covering the transition area based on the first control point, the second control point and the target pixel point.

[0234] In one embodiment, when the computer program is executed by a processor to calculate the pixel gains of the pixel points corresponding to the vertices of each triangular mesh, the processor specifically executes the following steps: obtaining the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh belonging to the overlapping area; calculating the pixel gains of the pixel points corresponding to the vertices of each triangular mesh based on the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh; the pixel values ​​include the pixel values ​​of at least two original images corresponding to the overlapping area.

[0235] In one embodiment, when the computer program is executed by the processor to obtain the weights of the pixel points corresponding to the vertices of each triangular mesh belonging to the overlapping area, the processor specifically executes the following steps: obtaining the pixel values ​​of each original image corresponding to each pixel point in the overlapping area; calculating the mutual correlation coefficient between the original images based on the pixel values ​​of each original image; calculating the weights of each pixel point in the overlapping area based on the mutual correlation coefficient; and selecting the weights of the pixel points corresponding to the vertices of each triangular mesh from the weights of each pixel point in the overlapping area.

[0236] In one embodiment, when the computer program is executed by a processor to perform the step of calculating the weight of each pixel point in the overlapping area according to the mutual correlation coefficient, the processor specifically performs the following steps: selecting target pixel points whose mutual correlation coefficients are greater than the mutual correlation coefficient threshold from the overlapping area; calculating the pixel difference between the original images corresponding to each target pixel point; performing histogram statistics on the pixel difference to obtain a histogram statistical result; obtaining the pixel value corresponding to each pixel point in the overlapping area; and determining the weight corresponding to each pixel point in each overlapping area according to the histogram statistical result and the pixel value corresponding to each pixel point in the overlapping area.

[0237] In one embodiment, before the step of stitching the image to be a stitched image of original resolution and determining the transition area in the stitched image is executed by the processor, the computer program causes the processor to further execute the following steps: performing resolution reduction processing on the stitched image of original resolution to obtain a stitched image after the resolution reduction; when the step of determining the transition area in the stitched image is executed by the processor, the computer program causes the processor to specifically execute the following steps: determining the transition area in the stitched image after the resolution reduction; when the computer program causes the processor to perform color difference elimination processing on the stitched image based on the color ratio to obtain a stitched image after the color difference elimination, the computer program causes the processor to specifically execute the following steps: generating a color ratio image based on the color ratio; performing resolution increase processing on the color ratio image to obtain a color ratio image with an increased resolution and the same size as the stitched image of original resolution; performing color difference elimination processing on the stitched image of original resolution based on the increased resolution color ratio image to obtain a stitched image after the color difference elimination.

[0238] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0239] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0240] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for eliminating chromatic aberration of stitched images, It is characterized in that The method comprises: Acquire a stitched image obtained by stitching at least two original images; Determine a transition area in the stitched image; the transition area includes an overlapping area and at least a portion of a non-overlapping area in the stitched image; Constructing a triangular mesh covering the transition area; calculating the pixel gain of the pixel points corresponding to the vertices of each triangular mesh; calculating the pixel gain of each pixel point in each triangular mesh according to the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, and obtaining the pixel gain corresponding to each pixel point in the transition area; Calculating the color adjustment ratio corresponding to each pixel point in the transition area according to the pixel gain; The color difference elimination process is performed on the stitched image based on the color adjustment ratio to obtain a stitched image after the color difference is eliminated.

2. The method according to claim 1, It is characterized in that The constructing a triangular mesh covering the transition area comprises: Selecting at least one pixel point from the overlapping area in the transition area as a first control point; Selecting at least one pixel point on the boundary of the non-overlapping area in the transition area as a second control point; At least one target pixel point is selected in a transition area between the first control point and the second control point, and a triangular mesh covering the transition area is constructed based on the first control point, the second control point and the target pixel point.

3. The method according to claim 1, It is characterized in that The calculating the pixel gain of the pixel points corresponding to the vertices of each triangular mesh comprises: Obtaining weights and pixel values ​​of pixel points corresponding to vertices of each of the triangular meshes belonging to the overlapping area; The pixel gain of the pixel points corresponding to the vertices of each triangular mesh is calculated according to the weights and pixel values ​​of the pixel points corresponding to the vertices of each triangular mesh; the pixel value includes the pixel value of the at least two original images corresponding to the overlapping area.

4. The method according to claim 3, It is characterized in that The obtaining weights of the pixel points corresponding to the vertices of each of the triangular meshes belonging to the overlapping area includes: Obtaining pixel values ​​of the original images corresponding to each pixel point in the overlapping area; Calculating the mutual correlation coefficients between the original images according to the pixel values ​​of the original images; Calculate the weight of each pixel in the overlapping area according to the mutual correlation coefficient; The weights of the pixel points corresponding to the vertices of each triangular mesh are selected from the weights of each pixel point in the overlapping area.

5. The method according to claim 4, It is characterized in that The calculating the weight of each pixel point in the overlapping area according to the mutual correlation coefficient comprises: Selecting target pixel points whose mutual correlation coefficient is greater than a mutual correlation coefficient threshold from the overlapping area; Calculating the pixel difference between the original images corresponding to each of the target pixels; Performing histogram statistics on the pixel differences to obtain a histogram statistics result; Obtaining the pixel value corresponding to each pixel point in the overlapping area; The weight corresponding to each pixel point in each overlapping area is determined according to the histogram statistical result and the pixel value corresponding to each pixel point in the overlapping area.

6. The method according to claim 1, It is characterized in that The stitched image is a stitched image of original resolution. Before determining the transition area in the stitched image, the method further includes: Performing resolution reduction processing on the stitched image of the original resolution to obtain a stitched image after the resolution reduction; The determining of the transition area in the stitched image comprises: Determining a transition region in the mosaicked image after the resolution reduction; The step of performing color difference elimination processing on the stitched image based on the color adjustment ratio to obtain a stitched image after color difference elimination includes: generating a toning ratio image based on the toning ratio; Performing resolution up-processing on the toning ratio image to obtain an up-resolution toning ratio image having the same size as the stitched image of the original resolution; The color difference elimination process is performed on the stitched image with the original resolution based on the up-resolution toning ratio image to obtain a stitched image with the color difference eliminated.

7. A device for eliminating color difference of spliced ​​images, It is characterized in that The device comprises: A stitched image acquisition module, used to acquire a stitched image obtained by stitching at least two original images; A transition region determination module, used to determine a transition region in the stitched image; the transition region includes an overlapping region and at least a portion of a non-overlapping region in the stitched image; The color difference elimination module includes a pixel gain calculation module, a color adjustment ratio calculation module and a color difference elimination processing module, wherein: The pixel gain calculation module is used to construct a triangular mesh covering the transition area; calculate the pixel gain of the pixel points corresponding to the vertices of each triangular mesh; calculate the pixel gain of each pixel point in each triangular mesh according to the pixel gain of the pixel points corresponding to the vertices of each triangular mesh, and obtain the pixel gain corresponding to each pixel point in the transition area; The color adjustment ratio calculation module is used to calculate the color adjustment ratio corresponding to each pixel point in the transition area according to the pixel gain; The color difference elimination processing module is used to perform color difference elimination processing on the spliced ​​image based on the color adjustment ratio to obtain a spliced ​​image after the color difference is eliminated.

8. The device according to claim 7, It is characterized in that The pixel gain calculation module is further used for: Selecting at least one pixel point from the overlapping area in the transition area as a first control point; Selecting at least one pixel point on the boundary of the non-overlapping area in the transition area as a second control point; At least one target pixel point is selected in a transition area between the first control point and the second control point, and a triangular mesh covering the transition area is constructed based on the first control point, the second control point and the target pixel point.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Manifold-based video splicing method

    CN106210560A

  • Image processing method and terminal

    CN106612397A

  • Splicing line optimization method and device

    CN107240082A

  • Method of acquiring pseudo-CT on basis of ultrasound images

    CN108492340A

  • Image splicing method and device, terminal and computer readable storage medium

    CN109598673A