Image processing method, storage medium and intelligent terminal

By removing extreme pixels and calculating optimization target values, the brightness and color of multi-image splicing images are adjusted to solve the problem of brightness and color differences in multi-image splicing and fusion in complex environments, and improve the stability and quality of the splicing effect.

CN114663277BActive Publication Date: 2024-10-29BYD CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202011545843.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-23
Publication Date
2024-10-29
Estimated Expiration
2040-12-23

AI Technical Summary

Technical Problem

In complex environments, when multiple images are spliced ​​and fused, existing technology is difficult to effectively adjust due to brightness and color differences caused by factors such as shadows and reflections, resulting in unsatisfactory splicing effects.

Method used

By acquiring multiple channel spliced ​​images at the same time, removing extreme pixels, calculating the average intensity of the three channels, modifying the image according to the optimization target value and predetermined adjustment rules, ensuring that the value range and average of the image in the YUV color space meet the predetermined requirements. , reduce the impact of extreme pixels.

Benefits of technology

It effectively reduces the impact of complex environments on image splicing and fusion, avoids excessive correction, and improves the quality and stability of multi-image splicing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114663277B_ABST
    Figure CN114663277B_ABST
Patent Text Reader

Abstract

The present invention discloses an image processing method, a storage medium and an intelligent terminal. The image processing method comprises: obtaining a spliced ​​image of n channels at the same time; removing extreme pixel points in each spliced ​​image according to a predetermined rule; respectively obtaining the three-channel intensity mean of the remaining pixel points of each spliced ​​image in the YUV color space; obtaining the optimized target value of the spliced ​​image of n channels at a predetermined time according to the three-channel intensity mean of the spliced ​​image of n channels and a predetermined constraint condition; modifying the spliced ​​image of n channels at the predetermined time using the optimized target value and a predetermined adjustment rule. The present invention aims to improve the influence of complex environment on the splicing and fusion of multiple images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image processing method, a storage medium and an intelligent terminal. Background Art

[0002] With the development of technology, image processing technology has been widely used in many fields. In many application scenarios, regional images that are only used to present a single perspective can no longer meet the requirements. It is necessary to stitch and fuse images from multiple perspectives to obtain panoramic images, which are used to present virtual spaces. Typical applications include virtual reality (VR), assisted driving systems, or autonomous driving systems. In related technologies, the image brightness is generally represented by the average brightness of all pixels in the images obtained by multiple cameras. The image brightness of each camera is substituted into a mathematical formula to calculate the adjusted target brightness, and then the brightness of the original image is directly adjusted to the brightness of the target image. In complex real-world environments, affected by factors such as shadows and reflections, the brightness and color of each original image may be quite different. It is usually difficult to achieve the desired effect by adjusting the target image with the average value, so there is room for improvement. Summary of the invention

[0003] In view of this, the present application discloses an image processing method, a storage medium and an intelligent terminal, aiming to improve the influence of complex environment on multi-image stitching and fusion.

[0004] The solution is as follows:

[0005] An image processing method, comprising:

[0006] Get the stitched image of n channels at the same time;

[0007] Remove extreme pixel points in each spliced ​​image according to a predetermined rule;

[0008] Obtain the mean values ​​of the three-channel intensities of the remaining pixels of each stitched image in the YUV color space;

[0009] Obtaining an optimized target value of the spliced ​​image of the n channels at a predetermined time according to the three-channel intensity mean value of the spliced ​​image of the n channels and a predetermined constraint condition; and

[0010] Modifying the spliced ​​image of the n channels at the predetermined time using the optimization target value and the predetermined adjustment rule;

[0011] The n is ≥ 2 and is an integer.

[0012] In one embodiment, in the step of acquiring the stitched images of n channels at the same time, the stitched images of n channels acquired are RGB images; and the step of removing extreme pixel points in each stitched image according to a predetermined rule comprises:

[0013] Obtain the grayscale value of each pixel of the RGB image;

[0014] The pixel point with the largest grayscale value and the pixel point with the smallest grayscale value in each spliced ​​image are removed according to a predetermined ratio.

[0015] In one embodiment, in the step of acquiring the stitched images of n channels at the same time, the stitched images of n channels acquired are RGB images; and the step of removing extreme pixel points in each stitched image according to a predetermined rule comprises:

[0016] Obtain the G / B value of each pixel of the RGB image;

[0017] When the G / B value of a pixel is greater than a predetermined value, the pixel is removed from the corresponding stitched image.

[0018] In one embodiment, when G / B of a pixel point>f, the pixel point is removed from the corresponding stitched image, and f is any value between 1.1 and 1.5.

[0019] In one embodiment, before the step of respectively obtaining the three-channel intensity mean values ​​of the remaining pixels of each stitched image in the YUV color space, the method further includes:

[0020] Obtain the number of remaining pixels after removing the pixels; and

[0021] When the number of remaining pixels is less than a predetermined ratio of the total number of pixels of the original image, subsequent steps are allowed to be executed.

[0022] In one embodiment, the step of obtaining the optimized target value of the spliced ​​image of the n channels at a predetermined time according to the three-channel intensity mean of the spliced ​​image of the n channels and the predetermined constraint condition comprises:

[0023] Collect the three-channel intensity averages of the continuous k-frame stitched images from time t-k+1 to time t;

[0024] Obtaining an average intensity mean of the three-channel intensity means of the k-frame stitched image; and

[0025] Obtaining the optimized target values ​​of k stitched images from time t to time t+k-1 according to the average intensity mean and the predetermined constraint condition;

[0026] The k is ≥ 2 and is an integer.

[0027] In one embodiment, the average YUV three-channel average intensity corresponding to the stitched image of the n channels is Wherein Ch∈{Y, U, V}, i=1, 2, ..., n; the step of obtaining the optimized target value of the spliced ​​image of the n channels at a predetermined time according to the three-channel intensity mean of the spliced ​​image of the n channels and the predetermined constraint condition comprises:

[0028] The objective function of the optimization problem is constructed as:

[0029]

[0030] Among them, F Ch (X Ch ) is the optimization objective function for channel Ch, is the variable to be optimized, is the average intensity value of the Ch channel to be optimized for the image of the i-th channel; is the final optimization result of the image of the ith channel in the Ch channel at time tk, is the final optimization result of the i-th camera image in the Ch channel at time t-2k, λ1, λ2, λ3, λ4 are the preset weight coefficients;

[0031] Based on the above objective function, the optimization problem is determined as follows:

[0032]

[0033]

[0034] in is the average intensity mean of the i-th camera image input at time tk in channel Ch; α is the preset coefficient used to control the adjustment step size;

[0035] Solve the above optimization problem and obtain the target average intensity of all n channels of images in channel Ch at time t and

[0036] Substitute the intensity values ​​of the three YUV channels in turn to obtain the optimized target values ​​of the corresponding channel intensities after all image processing.

[0037] In one embodiment, the α≤0.05.

[0038] In one embodiment, after obtaining the optimization target values ​​of the corresponding channel intensities after all image processing and before modifying the spliced ​​image of the n channels at the predetermined time using the optimization target values ​​and the predetermined adjustment rules, the method further includes the following steps:

[0039] Calculate the gray value mean, gray value variance and the total number of remaining pixels after removing extreme value pixels of each image in the k images acquired from the i-th channel in the n channels from time t to time t+k-1 respectively;

[0040] Determine whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements; and

[0041] When the gray value mean, gray value variance and the total number of remaining pixels after removing extreme values ​​all meet predetermined requirements, the optimization target value is allowed to be used.

[0042] In one embodiment,

[0043] After determining whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements, the method further includes:

[0044] When the gray value mean, gray value variance and the total number of remaining pixels after removing the extreme value cannot simultaneously meet the predetermined requirements, the target average intensity mean is assigned a value. And judge the following after assignment Whether the constraints are met

[0045] When the constraints are met, the average intensity of the target after assignment is used Optimize the corresponding images;

[0046] And when the constraint condition is not met, the average intensity of the target after assignment is Take the maximum or minimum value within the constraint range and use it as the optimization target value to optimize the corresponding image.

[0047] In one embodiment, the determining whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements respectively includes:

[0048] Among the k images, the total number of images whose average grayscale value of pixels in a single image is less than a preset grayscale value threshold is less than a predetermined number;

[0049] Among the k images, the total number of images in which the variance of the pixel grayscale value of a single image is greater than a preset grayscale value variance threshold is less than a predetermined number; and

[0050] Among the k images, the total number of images in which the ratio of the number of remaining pixels in a single image after removing extreme pixel points to the number of original pixel points in the image is less than a predetermined ratio threshold is less than a predetermined number.

[0051] In one embodiment, the original intensity of any pixel point p in the image to be optimized in the Ch channel is expressed as The optimized strength is expressed as Ch∈{Y, U, V}, the step of modifying the spliced ​​image of the n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule is implemented according to the following method:

[0052]

[0053] In one embodiment, the method of modifying the stitched image of n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule further includes a constraint condition for the UV channel:

[0054]

[0055] Wherein, the δ≤5.

[0056] In one embodiment, after the stitched image of the n channels at the predetermined time is modified using the optimization target value and the predetermined adjustment rule, the value range of all pixels in the modified image in the YUV color space satisfies: Y~[16, 235], U~[16, 240], V~[16, 240].

[0057] In one embodiment, after modifying the spliced ​​image of the n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule, the method further includes:

[0058] The modified stitched images of the n channels at the predetermined time are stitched and merged.

[0059] The present application also discloses a storage medium storing program instructions, wherein the program instructions are suitable for being loaded by a processor and executing any of the aforementioned image processing methods.

[0060] The present application also discloses an intelligent terminal, which includes the processor and the aforementioned storage medium.

[0061] In a specific implementation, the smart terminal further includes n cameras for collecting the stitched images of the n channels.

[0062] In the aforementioned image processing method, storage medium, and intelligent terminal disclosed solutions, before obtaining the optimization target value of the stitched image and optimizing the stitched image according to the optimization target value, the extreme pixel points in each stitched image are removed according to predetermined rules, thereby reducing the influence of extreme pixel points caused by color, shadow, and reflection caused by complex environment on the brightness and color mean of the image, avoiding excessive correction, and thus improving the influence of complex environment on the stitching and fusion of multiple images. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The above-mentioned and other objects and advantages of the present invention will be described in detail below with reference to the accompanying drawings:

[0064] Figure 1 FIG. 4 is a schematic diagram of the logical structure of a smart terminal in one embodiment.

[0065] Figure 2 FIG. 4 is a flow chart of an image processing method in a preferred embodiment.

[0066] Figure 3 for Figure 2 The flowchart diagram shown is a flowchart diagram of step S20 in one embodiment.

[0067] Figure 4 for Figure 2 The flowchart diagram shown is a flowchart diagram of step S40 in one embodiment.

[0068] Figure 5 for Figure 4 The shown diagram is a schematic diagram of an additional process flow of the image processing method in another preferred embodiment, wherein the additional process flow is suitable for being executed after step S470 and before step S50.

[0069] Reference numerals:

[0070] 10. Smart Terminal

[0071] 110 Storage Media

[0072] 120 processors DETAILED DESCRIPTION

[0073] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.

[0074] Ginseng Figure 1 As shown, a smart terminal 10 is disclosed. The smart terminal 10 includes a storage medium 110 and a processor 120. The storage medium 110 stores program instructions, which can implement the image processing method of the present application after being loaded and executed by the processor 120. The smart terminal 10 can be any terminal with image data processing capability.

[0075] In a specific implementation, the smart terminal 10 may also include multiple cameras (not shown in the figure) for collecting images to be processed. It should be noted that the smart terminal 10 of the present application may only have image processing capabilities and implement the image processing method of the present application, or may also have image acquisition functions, integrating image acquisition and image processing.

[0076] The image processing method of the present application is described in detail below in conjunction with specific implementations.

[0077] See also Figures 2 to 5 As shown, in one embodiment, the image processing method may include the following steps.

[0078] S10, obtaining stitched images of n channels at the same time. Wherein, n≥2 and is an integer. The n stitched images obtained at the same time can be stitched to form a panoramic image or can be used to display a virtual space. In a specific implementation, the stitched images of the n channels can be obtained by shooting with n cameras or n cameras.

[0079] S20, removing extreme pixel points in each spliced ​​image according to a predetermined rule.

[0080] The extreme pixel points in the image may be a portion of the pixels with the maximum or minimum brightness in the image, or a portion of the pixels that have the greatest impact on the brightness perceived by the human eye. The "portion" here can be understood as a proportion pre-set according to actual needs in a specific implementation. Accordingly, a portion of the extreme pixel points can be removed according to a pre-set rule.

[0081] S30, respectively obtaining the three-channel intensity averages of the remaining pixels of each stitched image in the YUV color space.

[0082] S40, obtaining an optimization target value of the spliced ​​image of the n channels at a predetermined time according to the three-channel intensity mean value of the spliced ​​image of the n channels and a predetermined constraint condition.

[0083] S50, modifying the spliced ​​image of the n channels at the predetermined time using the optimization target value and the predetermined adjustment rule.

[0084] In the aforementioned image processing method, storage medium, and intelligent terminal disclosed solutions, before obtaining the optimization target value of the stitched image and optimizing the stitched image according to the optimization target value, the extreme pixel points in each stitched image are removed according to predetermined rules, thereby reducing the influence of extreme pixel points caused by color, shadow, and reflection caused by complex environment on the brightness and color mean of the image, avoiding excessive correction, and thus improving the influence of complex environment on the stitching and fusion of multiple images.

[0085] In a specific implementation, in acquiring the stitched image of n channels at the same time, the acquired stitched image of n channels is an RGB image.

[0086] Accordingly, in a preferred embodiment, step S20 may include the following steps.

[0087] S210, obtaining the gray value of each pixel of the RGB image. The gray value of each pixel can be calculated according to the existing conversion formula: Gray value Gray = R × 0.299 + G × 0.587 + B × 0.114.

[0088] S220 , removing the pixel point with the largest grayscale value and the pixel point with the smallest grayscale value in each stitched image according to a predetermined ratio.

[0089] For example, in a specific implementation, after obtaining the grayscale value of each pixel of the RGB image, the brightest 10% of the pixels can be removed, and the darkest 10% of the pixels can be removed at the same time. The predetermined ratio can be set according to actual needs. Removing a predetermined ratio of the brightest and darkest pixels according to the size of the grayscale value can weaken the influence of shadows and reflections on the brightness mean.

[0090] In one implementation, the step S20 may further include the following steps.

[0091] S230: Obtain the G / B value of each pixel of the RGB image.

[0092] S240: When the G / B value of a pixel is greater than a predetermined value, the pixel is removed from the corresponding stitched image.

[0093] For example, in a specific implementation, when G / B of a pixel point>f, the pixel point is removed from the corresponding stitched image, and f is any value between 1.1 and 1.5.

[0094] Through the above steps S230-S240, the green pixels in the image can be removed. Green pixels have a greater impact on the brightness perceived by the human eye, while pixels of other colors have a relatively small impact and are ignored. Through this processing, the impact of color on the brightness perceived by the human eye can be effectively weakened. The standard for judging whether a certain pixel is green is to satisfy G / B>f, where the threshold f can be selected according to the specific situation of the camera, generally between 1.1 and 1.5.

[0095] In a specific implementation, the step S20 may include steps S210-S240 at the same time, or may selectively include one of S210-S220 and S230-S240, depending on actual needs.

[0096] In one embodiment, before executing the subsequent steps of step S20, that is, before executing step S30, step S20 may further include the following steps.

[0097] S250: Obtain the number of remaining pixels after removing the pixels.

[0098] S260: When the number of remaining pixels is less than a predetermined proportion of the total number of pixels in the original image, subsequent steps are allowed to be executed.

[0099] In other words, after completing the processing of steps S210-S220, S230-S240, or when the number of remaining pixels is less than a predetermined proportion of the total number of pixels in the original image, subsequent steps are allowed to be executed. For example, when the result of the judgment is: after removing the extreme value pixels, the number of remaining pixels is less than 30% of the total number of pixels in the original image, subsequent steps are allowed to be executed. Through the above steps, at least part of the original features of the image can be retained while removing the extreme value pixels. For example, when an image is too bright, too dark, or has too many green pixels (such as an image of a green grass), when the number of remaining pixels is less than a predetermined proportion of the total number of pixels in the original image, subsequent steps are allowed to be executed to prevent the true intensity mean of the image from being unable to be restored due to the removal of too many pixels that do not meet the requirements, thereby achieving the purpose of removing extreme pixels in an image without completely removing an image under extreme conditions, and at least saving a certain proportion of pixels for calculating the intensity mean of the image.

[0100] After the verification in step S260, step S30 of respectively obtaining the three-channel intensity averages of the remaining pixels of each stitched image in the YUV color space may be performed.

[0101] In order to improve calculation efficiency, we first calculate the mean of the three channels in the RGB color space, and then convert it to the YUV color space through the formula.

[0102] The method for calculating the mean of each RGB channel is as follows:

[0103]

[0104] where Ch∈(R,G,B},I Ch represents the mean intensity of the remaining pixels in channel Ch, m is the total number of remaining pixels, N is the set of remaining pixels, P Ch Indicates the intensity value of a pixel point p in the Ch channel.

[0105] After obtaining the mean intensity of each of the three channels in the RGB color space, the mean intensity of the three channels in the YUV color space can be obtained by the following formula:

[0106] I Y =0.257×I R +0.504×I G +0.098×I B +16

[0107] I U =-0.148×I R _0.291×I G +0.439×I B +128

[0108] I V =0.439×I R -0.368×I G _0.071×I B +128

[0109] In a preferred embodiment, in order to improve the stability of the image processing results and reduce the jitter of the processed image, in the specific implementation, not every frame is processed, but the data of k consecutive frames are collected and the average is calculated as the input of the subsequent method.

[0110] Accordingly, the step S40 of obtaining the optimized target value of the spliced ​​image of n channels at a predetermined time according to the three-channel intensity mean value of the spliced ​​image of n channels and the predetermined constraint condition may include the following steps.

[0111] S410, collecting the three-channel intensity averages of k consecutive spliced ​​images from time t-k+1 to time t, where k is ≥ 2 and is an integer.

[0112] S420, obtaining an average intensity mean of the three-channel intensity means of the k-frame stitched image.

[0113] S430: Obtain optimization target values ​​of k stitched images from time t to time t+k-1 according to the average intensity mean and the predetermined constraint condition.

[0114] For example, for one of the channels, the mean intensity of the three YUV channels of the continuous k frames of images of a channel can be obtained according to the steps described in steps S10-S30. Then the average intensity mean of the three YUV channels of the k-frame stitched image from time t-k+1 to time t is:

[0115]

[0116] The obtained average intensity mean of the three YUV channels is used to optimize the k stitched images from time t to time t+k-1.

[0117] From the above, it can be seen that the optimization result is actually updated once every k frames, and during this period, there is no need to calculate the optimization target value for each frame image separately, thereby improving the stability of the image processing result and reducing the jitter of the processed image.

[0118] In one embodiment, the average YUV three-channel average intensity corresponding to the stitched image of the n channels is Wherein Ch∈{Y, U, V}, i=1, 2, ..., n; the step of obtaining the optimized target value of the spliced ​​image of the n channels at a predetermined time according to the three-channel intensity mean of the spliced ​​image of the n channels and the predetermined constraint conditions also includes the following steps.

[0119] S440, construct the objective function of the optimization problem as:

[0120]

[0121] Among them, F Ch (X Ch ) is the optimization objective function for channel Ch, is the variable to be optimized, is the average intensity value of the Ch channel to be optimized for the image of the i-th channel; is the final optimization result of the image of the ith channel in the Ch channel at time tk, is the final optimization result of the i-th camera image in the Ch channel at time t-2k, and λ1, λ2, λ3, and λ4 are the preset weight coefficients.

[0122] S450: Based on the above objective function, determine the optimization problem:

[0123]

[0124]

[0125] in is the average intensity mean of the i-th camera image input at time tk in the Ch channel; α is the preset coefficient used to control the adjustment step size.

[0126] S460, solve the above optimization problem, and obtain the target average intensity mean of all n channels of images in channel Ch at time t

[0127] S470 , sequentially input the intensity values ​​of the three YUV channels to obtain the optimized target values ​​of the intensity of the corresponding channels after all images are processed.

[0128] To ensure that the panoramic image does not shake significantly, the value of α is generally less than or equal to 0.05.

[0129] In the above steps S440-S470, the four weight values ​​λ1, λ2, λ3, and λ4 correspond to the image average effect, image restoration degree, image frame change amplitude, and image continuous change gradient respectively. By adjusting the weights of the objective function, the image brightness and color smoothing effect can be flexibly adjusted to better meet actual needs and perception.

[0130] In one embodiment, after the step S470 of obtaining the optimization target value of the corresponding channel intensity after all image processing and before the step S50 of modifying the spliced ​​image of the n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule, the step further includes:

[0131] S4710, respectively calculate the gray value mean, gray value variance and the total number of remaining pixels after removing extreme value pixels of each image in the k images acquired from the i-th channel in the n channels from time t to time t+k-1.

[0132] S4720. Determine whether the grayscale value mean, grayscale value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements.

[0133] S4730. When the gray value mean, gray value variance and the total number of remaining pixels after removing extreme values ​​all meet predetermined requirements, the optimization target value is allowed to be used.

[0134] In one embodiment, after determining whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements, the following steps are also included.

[0135] S4740, after determining whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements, further comprising:

[0136] When the gray value mean, gray value variance and the total number of remaining pixels after removing the extreme value cannot simultaneously meet the predetermined requirements, the target average intensity mean is assigned a value. And judge the following after assignment Whether the constraints are met

[0137] S4750, when the constraint condition is met, use the average value of the target average intensity after assignment Optimize the corresponding images;

[0138] And when the constraints are not met, the average intensity of the target after assignment is Take the maximum or minimum value within the constraint range and use it as the optimization target value to optimize the corresponding image.

[0139] In one embodiment, in the step S4720 of determining whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements, the predetermined requirements may include:

[0140] Among the k images, the total number of images whose average grayscale value of pixels in a single image is less than a preset grayscale value threshold is less than a predetermined number;

[0141] Among the k images, the total number of images in which the variance of the pixel grayscale value of a single image is greater than a preset grayscale value variance threshold is less than a predetermined number; and

[0142] Among the k images, the total number of images in which the ratio of the number of remaining pixels in a single image after removing extreme pixel points to the number of original pixel points in the image is less than a predetermined ratio threshold is less than a predetermined number.

[0143] In one embodiment, the original intensity of any pixel point p in the image to be optimized in the Ch channel is expressed as The optimized strength is expressed as The step S50 of modifying the spliced ​​image of the n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule can be implemented according to the following method:

[0144]

[0145] In one embodiment, the method of modifying the stitched image of n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule further includes a constraint condition for the UV channel:

[0146]

[0147] Wherein, the δ≤5.

[0148] In one embodiment, after the stitched image of the n channels at the predetermined time is modified using the optimization target value and the predetermined adjustment rule, the value range of all pixels in the modified image in the YUV color space satisfies: Y~[16, 235], U~[16, 240], V~[16, 240].

[0149] In one embodiment, after modifying the spliced ​​image of the n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule, the following steps are also included.

[0150] S60: stitching and fusing the modified stitched images of the n channels at the predetermined time.

[0151] The following is an example of the actual application of the present invention in the panoramic imaging function of a certain vehicle model to specifically illustrate the method of the present invention. The surround-view camera system of the vehicle model is composed of four cameras, and the images of the four cameras are spliced ​​according to a certain method to obtain a panoramic image. Due to the different installation positions of the four cameras and the different amounts of light entering, there are obvious brightness and color differences between the four images obtained at the same time, resulting in obvious light and dark changes in the panoramic image, so the method of the present invention is used for optimization processing.

[0152] The four cameras are represented as C1, C2, C3, and C4 in the order of front, right, back, and left. At time t, the four cameras respectively acquire a set of RGB images, and then process the four images according to the method described in steps S10-S30 to calculate the three-channel intensity average of the four images in the YUV space. Suppose the YUV three-channel intensity averages of the four original images finally calculated are

[0153] The intensity average of three consecutive frames is selected as the final input of the nonlinear optimization problem. So at this time, the four images at time t+1 and the four images at time t+2 are read, and the methods described in steps S10-S30 are still used to process these images, and their YUV three-channel intensity averages are calculated and recorded as and but:

[0154]

[0155] It is the final input of the nonlinear optimization problem to be processed at time t+2.

[0156] Assume that the final optimization result of the three-channel intensity mean of the four images at time t-1 is The final result at time t-4 is With the required historical data, plus the existing data at time t+2, we can construct a nonlinear optimization problem. Now we only take the Y channel as an example, and the UV channel is similar. Now construct the objective function corresponding to the Y channel at time t+2 as follows:

[0157]

[0158] The nonlinear optimization problem corresponding to the Y channel is as follows:

[0159]

[0160]

[0161] The solution to this problem can be achieved using nonlinear optimizers such as ipopt, or by manual calculation. Suppose the final solution is Similarly, the solution for the UV channel is and

[0162] After obtaining the result of the nonlinear optimization problem, the post-processing stage is entered. Here, taking the optimization result updated once every 3 frames of images as an example, it is necessary to synchronously calculate and save the grayscale mean, grayscale variance and final number of remaining pixels corresponding to each frame in the process of obtaining 3 frames of images from time t to time t+2. At time t+2, refer to the grayscale mean, grayscale variance and remaining pixel number of 3 frames of images from time t to time t+2, and determine the optimization target value that meets the constraint conditions according to the steps S4710-S4750.

[0163] After obtaining the final optimization result, adjust each pixel of the image taken by each camera at time t+2, t+3, and t+4 in turn.

[0164] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.

[0165] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. An image processing method, characterized in that: include: Obtaining a stitched image of n channels at the same time; the stitched image of n channels is an image to be stitched taken by n cameras; Remove extreme pixel points in each spliced ​​image according to a predetermined rule; Obtain the mean values ​​of the three-channel intensities of the remaining pixels of each stitched image in the YUV color space; Obtaining an optimized target value of the spliced ​​image of the n channels at a predetermined time according to the three-channel intensity mean value of the spliced ​​image of the n channels, a preset objective function and a predetermined constraint condition; and Modifying the spliced ​​image of the n channels at the predetermined time using the optimization target value and the predetermined adjustment rule; Said n≥2 and is an integer; The three-channel intensity mean of the stitched image of the n channels includes the three-channel intensity mean of the continuous k-frame stitched images from time t-k+1 to time t, the optimization target value of the stitched image of the n channels at the predetermined time includes the optimization target value of the k stitched images from time t to time t+k-1, k≥2 and is an integer, and the optimization target value satisfies the following predetermined constraints: ; Said is the final optimization result of the image of the ith channel in the Ch channel at time tk. is the average intensity mean of the i-th camera image input at time tk in channel Ch, is the preset coefficient used to control the adjustment step size, is the average intensity value of the Ch channel to be optimized for the image of the i-th channel, It is the average intensity of the three YUV channels corresponding to the stitched image of n channels, where the Ch channel includes the Y channel, the U channel and the V channel.

2. The image processing method according to claim 1, characterized in that: In the step of obtaining the stitched images of n channels at the same time, the stitched images of n channels are RGB images; and the step of removing extreme pixel points in each stitched image according to a predetermined rule comprises: Obtain the grayscale value of each pixel of the RGB image; The pixel point with the largest grayscale value and the pixel point with the smallest grayscale value in each spliced ​​image are removed according to a predetermined ratio.

3. The image processing method according to claim 1, characterized in that: In the step of obtaining the stitched images of n channels at the same time, the stitched images of n channels are RGB images; and the step of removing extreme pixel points in each stitched image according to a predetermined rule comprises: Obtain the G / B value of each pixel of the RGB image; When the G / B value of a pixel is greater than a predetermined value, the pixel is removed from the corresponding stitched image.

4. The image processing method according to claim 3, characterized in that: When G / B of a pixel point>f, the pixel point is removed from the corresponding stitched image, and f is any value between 1.1 and 1.

5.

5. The image processing method according to claim 2, characterized in that: Before the step of respectively obtaining the three-channel intensity mean values ​​of the remaining pixel points of each stitched image in the YUV color space, the method further includes: Obtain the number of remaining pixels after removing the pixels; and When the number of remaining pixels is less than a predetermined ratio of the total number of pixels of the original image, subsequent steps are allowed to be executed.

6. The image processing method according to claim 1, characterized in that: The step of obtaining the optimized target value of the spliced ​​image of the n channels at a predetermined time according to the three-channel intensity mean of the spliced ​​image of the n channels, a preset objective function and a predetermined constraint condition comprises: Collect the three-channel intensity averages of the continuous k-frame stitched images from time t-k+1 to time t; Obtaining an average intensity mean of the three-channel intensity means of the k-frame stitched image; and Obtaining the optimized target values ​​of k stitched images from time t to time t+k-1 according to the average intensity mean, the preset objective function and the predetermined constraint condition; The k is ≥ 2 and is an integer.

7. The image processing method according to claim 6, characterized in that: The average intensity of the three YUV channels corresponding to the stitched image of the n channels is ,in , i=1,2,…,n; the step of obtaining the optimization target value of k stitched images from time t to time t+k-1 according to the average intensity mean, the preset objective function and the predetermined constraint condition comprises: The preset objective function for constructing the optimization problem is: Based on the above objective function and predetermined constraints, the optimization problem is determined: Solve the above optimization problem and obtain the target average intensity of all n channels of images in channel Ch at time t ;and Substitute the intensity values ​​of the three YUV channels in turn to obtain the optimized target values ​​of the corresponding channel intensities after all image processing.

8. The image processing method according to claim 7, characterized in that: Said ≤0.

05.

9. The image processing method according to claim 7, wherein: After obtaining the optimization target values ​​of the corresponding channel intensities after all image processing and before modifying the spliced ​​image of the n channels at the predetermined time using the optimization target values ​​and the predetermined adjustment rules, the method further includes the following steps: Calculate the gray value mean, gray value variance and the total number of remaining pixels after removing extreme value pixels of each image in the k images acquired from the i-th channel in the n channels from time t to time t+k-1 respectively; Determine whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements; and When the gray value mean, gray value variance and the total number of remaining pixels after removing extreme values ​​all meet predetermined requirements, the optimization target value is allowed to be used.

10. The image processing method according to claim 9, characterized in that: After determining whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements, the method further includes: When the gray value mean, gray value variance and the total number of remaining pixels after removing the extreme value cannot simultaneously meet the predetermined requirements, the target average intensity mean is assigned a value. , and judge the following after assignment Whether the constraints are met ; When the constraints are met, the average intensity of the target after assignment is used Optimize the corresponding images; And when the constraints are not met, the average intensity of the target after assignment is Take the maximum or minimum value within the constraint range and use it as the optimization target value to optimize the corresponding image.

11. The image processing method according to claim 9, characterized in that: The determining whether the gray value mean, gray value variance, and the total number of remaining pixels after removing extreme values ​​meet predetermined requirements respectively includes: Among the k images, the total number of images whose average grayscale value of pixels in a single image is less than a preset grayscale value threshold is less than a predetermined number; Among the k images, the total number of images in which the variance of the pixel grayscale value of a single image is greater than a preset grayscale value variance threshold is less than a predetermined number; and Among the k images, the total number of images in which the ratio of the number of remaining pixels in a single image after removing extreme pixel points to the number of original pixel points in the image is less than a predetermined ratio threshold is less than a predetermined number.

12. The image processing method according to claim 7, characterized in that: The original intensity of any pixel p in the image to be optimized in the Ch channel is expressed as , the optimized strength is expressed as , The step of modifying the spliced ​​image of the n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule is implemented according to the following method: 。 13. The image processing method according to claim 12, characterized in that: The method for modifying the stitched image of n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule also includes a constraint condition for the UV channel: , Among them, the .

14. The image processing method according to claim 1, characterized in that: After the spliced ​​image of the n channels at the predetermined time is modified using the optimization target value and the predetermined adjustment rule, the value range of all pixels in the modified image in the YUV color space satisfies: Y~[16,235], U~[16,240], V~[16,240].

15. The image processing method according to claim 1, characterized in that: After modifying the spliced ​​image of the n channels at the predetermined time by using the optimization target value and the predetermined adjustment rule, the method further includes: The modified stitched images of the n channels at the predetermined time are stitched and merged.

16. A storage medium storing program instructions, characterized in that: The program instructions are suitable for being loaded by a processor and executing the image processing method according to any one of claims 1 to 15.

17. An intelligent terminal, characterized in that: The intelligent terminal includes a processor and the storage medium according to claim 16.

18. The intelligent terminal according to claim 17, characterized in that: The intelligent terminal further includes n cameras for collecting the spliced ​​images of the n channels.

Citation Information

Patent Citations

  • Method of adjusting image acquisition brightness, device of adjusting image acquisition brightness and storage medium

    CN108234889A

  • Method for adjusting consistency of brightness and color of look-around image in vehicle-mounted look-around camera system

    CN110443771A

  • Panoramic image splicing method in airport environment

    CN111127318A

  • Fundus color image-based image optimization method and related device

    WO2020147245A1