Light homogenization method and apparatus for sequential images, and readable medium
By constructing a light illumination model and generating a light map, the problem of uniform processing of sequence images under unknown lighting and imaging conditions is solved, and the image uniform processing is automatically performed without relying on a priori conditions, improving image quality and work efficiency.
Patent Information
- Application Number
- PCT/CN2024/104008
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-02
- Filing Date
- 2024-07-05
- Publication Date
- 2025-02-06
AI Technical Summary
In the prior art, in the case of unknown lighting, imaging conditions or missing background images, it is difficult to effectively perform uniform light processing of sequence images, resulting in uneven brightness of the panoramic image, affecting image quality and subsequent analysis.
A sequential image uniform method is proposed. By obtaining the brightness component image sequence of the input image sequence, a light illumination model is constructed, a light map is generated, and a cost function is constructed based on the light map. The optimal light illumination model is solved by maximizing the cost function. , and finally brightness correction is performed on the brightness component image sequence to generate a uniform light image.
This method can automatically calculate the most suitable lighting model without relying on prior light illumination and imaging conditions, perform image uniform processing, reduce assembly and calibration requirements of imaging equipment, and improve image quality and work efficiency.
Smart Images

Figure CN2024104008_06022025_PF_FP_ABST
Abstract
Description
Sequence image light uniforming method, device and readable medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application number 2023109636539, filed with the China Patent Office on August 2, 2023, entitled “Sequential image uniforming method, device and readable medium,” the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of image processing, and in particular to a method, device and readable medium for uniforming sequential images. Background Art
[0004] At present, automatic microscopes have been widely used in digital pathology, industrial inspection and other fields. Due to the limitation of the field of view size, in order to obtain the overall image of the sample to be observed, it is necessary to scan (i.e. move the stage according to a preset step size and path) to shoot different parts of the sample to obtain a series of field of view images, and then stitch the series of field of view images together to obtain a panoramic image for subsequent observation and analysis. The quality of the panoramic image depends on the clarity of the field of view image, the brightness uniformity and the accuracy of the stitching algorithm. Among them, the uneven brightness is mainly due to the uneven illumination of the system within the field of view, which is generally manifested as the brightness of the field of view image slowly decreasing from a certain point to its surroundings, and the lower the magnification used for imaging, the more obvious this phenomenon is. This unevenness not only seriously affects the visual effect of the panoramic image, but also brings difficulties to subsequent image analysis such as segmentation, feature extraction, target detection, etc., so it is of great significance to perform uniform light processing on the field of view image.
[0005] An effective way to solve the above problem is to perform background balancing on the field of view image. That is, before scanning the sample to be observed, a blank image is taken as the background image under the same lighting and imaging conditions (as when scanning the sample), and then the background image is used to perform background balancing on the scanned field of view image. As an example, Figure 1 shows the process of light uniformity processing of the field of view image under the 20X objective lens of a biological microscope. Figure 1(a) is the blank background image taken, Figure 1(b) is the original foreground image taken, and Figure 1(c) is the foreground image after background balancing based on the background image. Figure 1(a) shows obvious uneven image brightness caused by unsatisfactory lighting conditions; correspondingly, there are also obvious black shadows in the four corners of the foreground image in Figure 1(b). After background balancing, the brightness of Figure 1(c) is balanced, and the black shadows in the four corners disappear.
[0006] Obviously, background image-based light uniformity requires a background image with the same lighting and imaging conditions as those used during scanning. These conditions include:
[0007] 1) Same light source lighting parameters, such as brightness, direction, etc.;
[0008] 2) The same imaging objective lens, such as magnification, numerical aperture, etc.;
[0009] 3) Same camera imaging parameters, such as exposure time, gain, etc.
[0010] If any of the above conditions changes, a new background image needs to be acquired to perform correct background balancing, which makes it unsuitable for situations where there is no background image or the lighting conditions and imaging conditions are changeable.
[0011] To this end, many scholars have proposed uniform illumination methods that do not rely on background images. These methods are mainly divided into two categories: transform domain-based methods and spatial domain-based methods. Transform domain-based methods use the transformed coefficients as the object and adopt different methods to process them. Currently, they are mainly used in fields such as face recognition and fingerprint image enhancement under uneven illumination. However, it is difficult for such algorithms to accurately reconstruct high-frequency and low-frequency components, so phenomena such as loss of detail information often occur. Spatial domain-based methods directly process the brightness value of each pixel according to the brightness distribution characteristics of each pixel in the image, avoiding the transformation and inverse transformation operations required in the transform domain processing process, and have therefore received widespread attention. Currently, commonly used spatial domain processing methods include histogram equalization, gamma correction, unsharp masking, blurring, Retinex algorithm, and correction methods based on space variant luminance map (SVLM). The main advantages and disadvantages are as follows:
[0012] (1) The histogram equalization algorithm has the advantages of simple algorithm and fast operation speed. It has a good enhancement effect on images with overall dark or bright brightness. However, for images with uneven lighting, the histogram equalization algorithm will cause over-enhancement.
[0013] (2) The gamma correction method can enhance the contrast of the image, but for images with uneven lighting, the gamma correction method has the problem of oversaturation / undersaturation.
[0014] (3) The unsharp mask method can enhance the details and edges of the image, but there is a problem of noise amplification.
[0015] (4) The fuzzy-based method uses fuzzy theory to judge the brightness of the image to distinguish low-brightness areas from high-brightness areas and process them separately. However, the calculation of this method is complex, and it is difficult to optimize the key parameters that affect the performance of the algorithm.
[0016] (5) The Retinex algorithm and its improved algorithms decompose an image into illumination and reflection components, and use the adjusted reflection component as the enhancement result. This type of algorithm has a good enhancement effect on images with generally uneven illumination and can effectively enhance the details in dark areas. However, this type of algorithm has high computational complexity and is plagued by problems such as the "halo" effect and the amplification of dark noise.
[0017] (6) The correction method based on the spatially varying illumination map can effectively improve the brightness of the image in the dark area and reduce the brightness of the image in the bright area, which has a good brightness correction effect. However, this algorithm has two shortcomings: a. The edge of the extracted illumination component is blurred due to the poor edge preservation ability of the Gaussian filter function used; b. The mean value of the illumination component is artificially set to 128 during illumination correction, resulting in over-enhancement / under-enhancement of local areas with too high or too low illumination.
[0018] Summary of the Invention
[0019] In response to the technical problem mentioned in the prior art that it is difficult to even out the light of a sequence of images taken under unknown lighting conditions, imaging conditions, or when a background image is missing, the purpose of the embodiments of this application includes, for example, proposing a method, device, and readable medium for evenly evening a sequence of images to improve the problems existing in the prior art mentioned in the background technology section above, so as to generate a panoramic image with consistent brightness.
[0020] In a first aspect, an embodiment of the present application provides a method for uniformly dodging sequential images, comprising the following steps:
[0021] Obtaining a brightness component image sequence of an input image sequence, constructing a light luminance model, and generating a light map according to the light luminance model;
[0022] Construct a cost function based on the brightness component image sequence and the illumination map;
[0023] By maximizing the cost function, the optimal solution is obtained, the optimal light illumination model is determined according to the optimal solution, and the optimal illumination map is generated according to the optimal light illumination model;
[0024] Brightness correction is performed on the brightness component image sequence according to the optimal illumination map to obtain a corrected brightness image sequence, and a uniform light image is generated according to the corrected brightness image sequence.
[0025] Optionally, a light luminance model is constructed, specifically including:
[0026] The light illuminance model is expressed by the following formula: L p (x,y)=L min +(L max -L min)K(t);
[0027] Where K(t) is a kernel function with a peak at t = 0 and a single peak in the range of 0 ≤ x ≤ 2x0, 0 ≤ y ≤ 2y0, t = 0 corresponds to x = x0, y = y0; (x0, y0) represents the illumination center, σ x and σ y They represent the diffusion length of the light source along the X direction and the Y direction respectively; c represents the correlation coefficient of the light source in the X direction and the Y direction, and the value range is 0≤c<1; L max and L min Represents the highest brightness and the lowest brightness respectively;
[0028] The parameter set of the light illumination model is: p=(x0,y0,σ x ,σ y ,c,L max ,L min ).
[0029] Optionally, a light map is generated according to a light intensity model, specifically including:
[0030] The value at the integer point position (i, j) in the light illumination model is taken as the brightness value L of the pixel at position (i, j) P (i,j);
[0031] The set of brightness values of all position pixels constitutes a light map: M p ={L P (i,j)}, i=0,1,…,W, j=0,1,…,H;
[0032] Where W and H represent the width and height of the light map respectively.
[0033] Alternatively, the cost function is expressed as: F(I1,I2,…,I n |M p )=ω1F1(I1,I2,…,I n |M p )+ω2F2(I1,I2,…,I n |M p );
[0034] Among them, F1(I1,I2,…,I n |M p ) is the overlap cost function, F2(I1,I2,…,I n |M p ) is the brightness discrete cost function, ω1 and ω2 are the weight coefficients of the two, ω1+ω2=1;
[0035] The calculation formula of the overlap cost function is as follows: F1(I1,I2,…,I n |M p )=∑ lk C(Ω l ,Ω k ) / ∑ lk 1;
[0036] Where l = 0, 1, ..., n, k ≠ l, k = 0, 1, ..., n, image I l and image I k Horizontally or vertically adjacent; (Ω l ,Ω k )=S(B(I l |M p ),B(I k |M p )|O lk ),B(I l |M p ) and B(I k |M p ) are all based on M p is the background balance operator of the background image, C(X,Y) is the consistency calculation function, O lk Represents image I l Relative to image I k The offset is calculated as follows: lk =Г(I l ,I k );
[0037] Where, Г represents the feature matching operator;
[0038] The calculation formula of the brightness discrete cost function is as follows: F2(I1,I2,…,I n |M p )=V(I1,I2,…,I n )-V(B(I1|M p ),B(I2|M p ),…,B(I n |M p )); V(I1,I2,…,I n )=∑ l v(I l );
[0039] Among them, v(I l ) represents image I l The brightness dispersion coefficient is equal to the brightness standard deviation of the image divided by the brightness mean.
[0040] Optionally, brightness correction is performed on the brightness component image sequence according to the optimal illumination map, specifically including:
[0041] The following formula is used to perform brightness correction on the brightness component image sequence: lb =B(I l |M best );
[0042] Among them, M best is the optimal lighting map.
[0043] Optionally, it also includes:
[0044] In response to determining that overlapping regions exist between adjacent images in the sequence of luminance component images;
[0045] If the image I l and image I k Horizontally adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=x*I l (x,y|(x,y)∈Ω l )+(wx)I k (x,y|(x,y)∈Ω k );
[0046] Order: I l (x,y)=I k (x,y)=T(x,y);
[0047] If the image I l and image I k Vertically adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=y*I l (x,y|(x,y)∈Ω l )+(hy)I k (x,y|(x,y)∈Ω k );
[0048] Order: I l (x,y)=I k (x,y)=T(x,y);
[0049] Wherein, x=0, 1,…, w, y=0, 1,…, h, w and h are the width and height of the overlapping area.
[0050] Optionally, obtaining a luminance component image sequence of an input image sequence specifically includes:
[0051] Obtain an input image sequence, perform HSL conversion on the RGB triplet of the image sequence to obtain an HSL triplet, and determine the brightness component image sequence based on the HSL triplet;
[0052] Generate a uniform light image based on the corrected brightness image sequence, specifically including:
[0053] The brightness value at the same position in the corrected brightness image sequence is updated to the HSL triplet to obtain an updated HSL triplet. The updated HSL triplet is converted to RGB to obtain an updated RGB triplet. The uniform light image is generated according to the updated RGB triplet.
[0054] In a second aspect, an embodiment of the present application provides a sequential image light homogenization device, comprising:
[0055] The model building module is configured to obtain a brightness component image sequence of an input image sequence, build a light luminance model, and generate a light map according to the light luminance model;
[0056] a cost function construction module configured to construct a cost function based on a brightness component image sequence and an illumination map;
[0057] A solution module is configured to obtain an optimal solution by maximizing a cost function, determine an optimal light illumination model according to the optimal solution, and generate an optimal illumination map according to the optimal light illumination model;
[0058] The correction module is configured to perform brightness correction on the brightness component image sequence according to the optimal illumination map to obtain a corrected brightness image sequence, and generate a uniform light image according to the corrected brightness image sequence.
[0059] In a third aspect, an embodiment of the present application provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0060] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0061] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0062] (1) The sequential image homogenization method proposed in the present application generates an illumination map using a light intensity model, constructs a cost function based on the illumination map, and solves for the optimal illumination map to perform brightness correction on a sequence of luminance component images. This method can reduce the assembly precision requirements of imaging devices such as digital slide scanners and industrial measuring microscopes, such as the concentricity requirements of the light source, optical axis, and image sensor, and improve generation efficiency.
[0063] (2) The method for uniforming the brightness of sequential images proposed in the embodiment of the present application not only improves the image quality but also reduces the calibration work of imaging equipment such as digital slide scanners and industrial measuring microscopes. For example, there is no need to take a corresponding background image for each magnification / illumination mode / exposure separately, thereby improving work efficiency.
[0064] (3) The image homogenization method proposed in the present embodiment does not rely on any prior (lighting, imaging) conditions. Instead, the homogenization is performed by inferring the most suitable illumination model from the captured image sequence itself. This method is suitable for any application requiring homogenization of image sequences. This reduces the brightness uniformity requirements of optical components in imaging equipment such as digital slide scanners and industrial measuring microscopes, and can also reduce costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0066] FIG1( a ) is a blank background image captured in the prior art;
[0067] Figure 1(b) is the original foreground image captured in the prior art;
[0068] FIG1( c ) is a foreground image after background balancing based on a background image in the prior art;
[0069] FIG2 is a diagram of an exemplary device architecture in which an embodiment of the present application may be applied;
[0070] FIG3 is a flow chart of a method for uniformly dodging sequential images according to an embodiment of the present application;
[0071] FIG4 is a flowchart of a sequential image dodging method according to an embodiment of the present application;
[0072] FIG5 is a schematic diagram of image matching of a sequential image dodging method according to an embodiment of the present application;
[0073] [Corrected 26.07.2024 according to Rule 91] FIG6(a) is an illumination map generated by the sequential image dodging method according to an embodiment of the present application under exemplary conditions;
[0186] [Corrected 26.07.2024 according to Rule 91] FIG6(b) is an illumination map generated by the sequential image dodging method according to an embodiment of the present application under exemplary condition 2;
[0187] [Corrected 26.07.2024 according to Rule 91] FIG6(c) is an illumination map generated by the sequential image dodging method of an embodiment of the present application under exemplary condition three;
[0074] FIG7( a ) is an image sequence captured by Example 1 of the sequential image dodging method according to an embodiment of the present application;
[0075] FIG7( b ) is a panoramic image captured by Example 1 of the sequential image dodging method according to an embodiment of the present application;
[0076] FIG8( a ) is an optimal illumination map generated by Example 1 of the sequential image dodging method according to an embodiment of the present application;
[0077] FIG8( b ) is a dodging image generated by Example 1 of the sequential image dodging method according to an embodiment of the present application;
[0078] FIG9( a ) is an image sequence captured by Example 2 of the sequential image dodging method according to an embodiment of the present application;
[0079] FIG9( b ) is a panoramic image captured by Example 2 of the sequential image dodging method according to an embodiment of the present application;
[0080] FIG10( a ) is an optimal illumination map generated by Example 2 of the sequential image dodging method according to an embodiment of the present application;
[0081] FIG10( b ) is a dodging image generated by Example 2 of the sequential image dodging method according to an embodiment of the present application;
[0082] FIG11 is a schematic diagram of a sequential image light homogenization device according to an embodiment of the present application;
[0083] FIG12 is a schematic diagram of the structure of a computer device suitable for implementing an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0084] To make the objectives, technical solutions, and advantages of this application more clear, this application will be further described in detail below with reference to the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0085] FIG. 2 shows an exemplary device architecture 100 to which a sequential image light homogenization method or a sequential image light homogenization device according to an embodiment of the present application can be applied.
[0086] As shown in Figure 2, the device architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0087] Users can use terminal devices 101, 102, 103 to interact with server 105 via network 104 to receive or send messages, etc. Various applications, such as data processing applications and file processing applications, can be installed on terminal devices 101, 102, 103.
[0088] Terminal devices 101, 102, and 103 can be hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. Their implementation can be multiple software or software modules (for example, software or software modules used to provide distributed services), or a single software or software module. No specific limitations are given here.
[0089] The server 105 may be a server that provides various services, such as a background data processing server that processes files or data uploaded by the terminal devices 101, 102, and 103. The background data processing server may process the acquired files or data and generate processing results.
[0090] It should be noted that the sequence image light uniforming method provided in the embodiment of the present application can be executed by the server 105 or by the terminal devices 101, 102, and 103. Accordingly, the sequence image light uniforming device can be set in the server 105 or in the terminal devices 101, 102, and 103.
[0091] It should be understood that the number of terminal devices, networks, and servers in FIG2 is merely illustrative. Any number of terminal devices, networks, and servers may be provided as needed. If the processed data does not need to be acquired remotely, the above-described apparatus architecture may not include a network, but only servers or terminal devices.
[0092] FIG3 shows a method for uniforming sequential images provided by an embodiment of the present application, comprising the following steps:
[0093] S1, obtain a brightness component image sequence of an input image sequence, construct a light luminance model, and generate a light map according to the light luminance model.
[0094] In a specific embodiment, obtaining a brightness component image sequence of an input image sequence specifically includes:
[0095] An input image sequence is obtained, the RGB triplet of the image sequence is HSL converted to obtain an HSL triplet, and a brightness component image sequence is determined based on the HSL triplet.
[0096] For a more detailed overview of the overall process, see Figure 4. According to visual theory, image color can be represented using a more intuitive model: the Hue, Saturation, Lightness (HSL) color model. The luminance component, L, intuitively describes the brightness of pixels in the image. Therefore, the problem of uniform illumination of a sequence of images is equivalent to the problem of uniform illumination of the luminance component of the sequence. The input sequence of red, green, and blue (RGB) primary colors can be interchanged with HSL using the following formula.
[0097] Among them, the RGB triplet is converted to the HSL triplet by the following formula:
[0098] Assume the input RGB image sequence is After the above steps, the brightness component image sequence corresponding to the image sequence is obtained, which is recorded as I1, I2, ..., I n .
[0099] If there is an overlapping area between adjacent (upper and lower or left and right) images in an image sequence, image matching is required. In essence, image matching is a process of inferring the exact overlapping area from the initial overlapping area. The specific operation is as follows: for any pair of horizontally or vertically adjacent images, a feature matching algorithm is used to find corresponding points in and near the initial overlapping area, and then the offset O(O) between the two images is determined. x ,O y) and the corresponding accurate overlapping area. As shown in Figure 5, on the left are two horizontally adjacent images. Feature matching is performed within the quasi-overlapping area (shown by the dotted line) to find corresponding point pairs. Based on these corresponding point pairs, the accurate overlapping area between the two images can be calculated, as shown in the overlapping area of the two images on the right.
[0100] The feature matching described above consists of two parts: feature points and feature vectors. Currently, numerous methods are available, including Harris corner points, FAST (Features From Accelerated Segment Test) feature points, and SUSAN (Small Univalue Segment Assimilating Nucleus) feature points. Feature vectors can be selected from methods such as LBP (Local Binary Pattern), HOG (Histogram of Gradient), and BRIEF (Binary Robust Independent Elementary Features). The details are not detailed here.
[0101] Let I l and I k For two adjacent images, use O lk Represents image I l Relative to image I k , Г represents the feature matching operator, S represents the image cropping operator, and the following formula can be used to represent this step: lk =Г(I l ,I k ); (Ω l ,Ω k )=S(I l , I k |O lk );
[0102] Among them, Ω l and Ω k Respectively represent the offset O lk The calculated overlapping area corresponds to image I l and I k The sub-image in .
[0103] After this step, the accurate overlapping area between any two adjacent images is obtained.
[0104] In a specific embodiment, the process of constructing the light luminance model specifically includes the following steps:
[0105] The light illuminance model is expressed by the following formula: L p (x,y)=Lmin +(L max -L min )K(t);
[0106] Where K(t) is a kernel function with a peak at t = 0 and a single peak in the range of 0 ≤ x ≤ 2x0, 0 ≤ y ≤ 2y0, t = 0 corresponds to x = x0, y = y0; (x0, y0) represents the illumination center, σ x and σ y They represent the diffusion length of the light source along the X direction and the Y direction respectively; c represents the correlation coefficient of the light source in the X direction and the Y direction, and the value range is 0≤c<1; L max and L min Represents the highest brightness and the lowest brightness respectively;
[0107] The parameter set of the light illumination model is: p=(x0,y0,σ x ,σ y ,c,L max ,L min ).
[0108] In a specific embodiment, the process of generating a light map according to the light luminance model specifically includes the following steps:
[0109] The value at the integer point position (i, j) in the light illumination model is taken as the brightness value L of the pixel at position (i, j) P (i,j);
[0110] The set of brightness values of all position pixels constitutes a light map: M p ={L P (i,j)}, i=0,1,…,W, j=0,1,…,H;
[0111] Where W and H represent the width and height of the light map respectively.
[0112] [Corrected 26.07.2024 according to Rule 91] Specifically, in order to obtain a background image corresponding to the image sequence (i.e., captured under the same lighting and imaging conditions), the image sequence can be balanced by using a light intensity model to achieve uniform lighting. As can be seen from the above formula, the specific form of the light intensity model depends on the kernel function K(t). There are many functions to choose from, one of which is K(t) = e -t , the resulting illumination map is shown in Figure 6. In Figure 6(a), Figure 6(b) and Figure 6(c), W = 2448, H = 2048, x0 = 1224, y0 = 1024, σ x =2448,σ y =2048,L max =255,Lmin =0, c = 0.0. In Figure 6(b): W = 2448, H = 2048, x0 = 612, y0 = 682, σ x =2448,σ y =2048,L max =255,L min =0, c = 0.0. In Figure 6(c): W = 2448, H = 2048, x0 = 1224, y0 = 1024, σ x =1632,σ y =1632,L max =255,L min =0, c=0.5.
[0113] S2, constructs a cost function based on the brightness component image sequence and the illumination map.
[0114] In a specific embodiment, the constructed cost function is expressed as: F(I1, I2, ..., I n |M p )=ω1F1(I1,I2,…,I n |M p )+ω2F2(I1,I2,…,I n |M p );
[0115] Among them, F1(i1,i2,…,I n |M p ) is the overlap cost function, F2(I1,i2,…,I n |M p ) is the brightness discrete cost function, ω1 and ω2 are the weight coefficients of the two, ω1+ω2=1;
[0116] The calculation formula of the overlap cost function is as follows: F1(I1,I2,…,I n |M p )=∑ lk C(Ω l ,Ω k ) / ∑ lk 1 ;
[0117] Where l = 0, 1, ..., n, k ≠ l, k = 0, 1, ..., n, image I l and image I k Horizontally or vertically adjacent; (Ω l ,Ω k )=S(B(I l |M p ),B(I k |M p )|O lk),B(I l |M p ) and B(I k |M p ) are all based on M p is the background balance operator of the background image, C(X,Y) is the consistency calculation function, O lk Represents image I l Relative to image I k The offset is calculated as follows: lk =Г(I l ,I k );
[0118] Where, Г represents the feature matching operator;
[0119] The calculation formula of the brightness discrete cost function is as follows: F2(I1,I2,…,I n |M p )=V(I1,I1,…,I n )-V(B(I1|M p ),B(I2|M p ),…,B(I n |M p )); V(I1,I2,…,I n )=∑ l v(I l );
[0120] Among them, v(I l ) represents image I l The brightness dispersion coefficient is equal to the brightness standard deviation of the image divided by the brightness mean.
[0121] Specifically, let I1, I2, ..., I n is the image sequence of brightness components to be homogenized, then the homogenization problem of this sequence of images can be transformed into the following optimization problem: n |M p )→max,p∈P;
[0122] Furthermore, F(I1,I2,…,I n |M p ) is the cost function, which consists of two parts: F1(I1,I2,…,I n |M p ) and F2(I1,I2,…,I n |M p ). Among them, F1(I1,I2,…,I n |M p ) is M pThe average brightness consistency of all overlapping areas after the background balance of the sequence images is performed for the background image. The theoretical basis is that after two adjacent images are background balanced with a "correct" background image, the brightness distribution of the overlapping areas tends to be consistent or even the same. In one embodiment, C(X,Y) can be taken as the Pearson correlation coefficient. When there is no overlapping area between adjacent images in the sequence image, ω1=0. F2(I1,I2,…,I n |M p ) is M p After background balancing the sequence of images for the background image, the brightness dispersion of all images relative to the original image changes. The theoretical basis is that after the sequence of images is balanced with the "correct" background image, the brightness distribution of the generated panorama is uniform.
[0123] S3, by maximizing the cost function, solving to obtain the optimal solution, determining the optimal light illumination model according to the optimal solution, and generating the optimal illumination map according to the optimal light illumination model.
[0124] Specifically, by solving the optimization problem, the solution to the optimization problem is a set of parameters p. The light intensity model determined by the set of parameters is called the optimal light intensity model. The background image generated by the optimal light intensity model is called the optimal light map M. best The optimal illumination map can be used to perform brightness correction on the brightness component image sequence.
[0125] S4, performing brightness correction on the brightness component image sequence according to the optimal illumination map to obtain a corrected brightness image sequence, and generating a uniform light image according to the corrected brightness image sequence.
[0126] In a specific embodiment, the process of performing brightness correction on the brightness component image sequence according to the optimal illumination map specifically includes the following process:
[0127] The following formula is used to perform brightness correction on the brightness component image sequence: lb =B(I l |M best );
[0128] Among them, M best is the optimal lighting map.
[0129] In a specific embodiment, the sequential image dodging method further includes the following steps:
[0130] In response to determining that overlapping regions exist between adjacent images in the sequence of luminance component images;
[0131] If the image I l and image I k Horizontally adjacent, Ω land Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=x*I l (x,y|(x,y)∈Ω l )+(wx)I k (x,y|(x,y)∈Ω k );
[0132] Order: I l (x,y)=I k (x,y)=T(x,y);
[0133] If the image I l and image I k Vertically adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=y*I l (x,y|(x,y)∈Ω l )+(hy)I k (x,y|(x,y)∈Ω k );
[0134] Order: I l (x,y)=I k (x,y)=T(x,y);
[0135] Wherein, x=0, 1,…, w, y=0, 1,…, h, w and h are the width and height of the overlapping area.
[0136] Specifically, if there is an overlapping area between adjacent (upper and lower or left and right) images in the sequence of images, the overlapping area needs to be evened. The light illumination model has 7 parameters p = (x0, y0, σ x ,σ y ,c,L max ,L min ), which means that the complexity of the optimization problem is high. To this end, the range of parameter variation can be narrowed, for example, fixed Lmin = 0, Lmax = 255, c = 0, etc. By reducing the complexity, a suboptimal solution is obtained, and the brightness of the overlapping area is adjusted to compensate for the shortcomings of the suboptimal solution. The corrected brightness image sequence is I 1b ,I 2b ,…,I nb .
[0137] In a specific embodiment, the process of generating a uniform light image according to the corrected brightness image sequence specifically includes the following process:
[0138] The brightness value at the same position in the corrected brightness image sequence is updated to the HSL triplet to obtain an updated HSL triplet. The updated HSL triplet is converted to RGB to obtain an updated RGB triplet. A uniform light image is generated according to the updated RGB triplet.
[0139] Specifically, for RGB images For each pixel position (x,y) in l=0,1,…,n, x=0,1,…,W,y=0,1,…,H, obtain its RGB triplet (r,g,b) and convert it to the corresponding HSL triplet (h,s,l). Then, from the corrected brightness image I lb Take out the brightness value at the same position, that is, I lb (x, y), update the original HSL triplet (h, s, l) to get the updated HSL triplet (h, s, I lb (x,y)), which is then back-calculated using the following formula to obtain the updated RGB triplet (r new ,g new ,b new ), as the final output at the position (x, y), and finally constitute the uniform light image. p=v×(1-s) q=v×(1-f×s) t=v×(1-(1-f)×s)
[0140] For each color vector (r,g,b):
[0141] Referring to Figures 7(a) and 7(b), Example 1 provides a 3-row, 3-column image sequence and a panoramic image taken under a 20X objective lens of an industrial microscope to observe the first area of a circuit board. The optimal illumination image and uniform illumination image obtained by the above steps are shown in Figures 8(a) and 8(b). W = 2448, H = 2048, x0 = 1224, y0 = 1024, σ x =1028,σ y =1028,L max =255,L min =0, c=0.0.
[0142] Referring to Figures 9(a) and 9(b), Example 2 provides a 3-row, 4-column image sequence and a panoramic image of the second area of a circuit board observed by an industrial microscope. The optimal illumination image and uniform illumination image obtained by the above steps are shown in Figures 10(a) and 10(b). W = 3072, H = 2048, x0 = 1536, y0 = 1024, σ x =1928.4,σ y =1928.4, L max =255,L min =0, c=0.0.
[0143] The above steps S1-S4 do not represent the order of the steps, but are only step symbols.
[0144] Further referring to FIG11 , as an implementation of the methods shown in the above figures, an embodiment of the present application provides a sequential image light homogenization device, which corresponds to the method embodiment shown in FIG2 , and can be specifically applied to various electronic devices.
[0145] The present invention provides a sequential image light homogenization device, comprising:
[0146] The model building module 1 is configured to obtain a brightness component image sequence of an input image sequence, build a light luminance model, and generate a light map according to the light luminance model;
[0147] a cost function construction module 2, configured to construct a cost function based on the brightness component image sequence and the illumination map;
[0148] A solution module 3 is configured to obtain an optimal solution by maximizing the cost function, determine an optimal light illumination model according to the optimal solution, and generate an optimal illumination map according to the optimal light illumination model;
[0149] The correction module 4 is configured to perform brightness correction on the brightness component image sequence according to the optimal illumination map to obtain a corrected brightness image sequence, and generate a uniform light image according to the corrected brightness image sequence.
[0150] In a possible implementation, the model building module 1 is specifically configured to build the light luminance model in the following manner:
[0151] The light illuminance model is expressed by the following formula: L p (x,y)=L min +(L max -L min )K(t);
[0152] Where K(t) is a kernel function with a peak at t = 0 and a single peak in the range of 0 ≤ x ≤ 2x0, 0 ≤ y ≤ 2y0, t = 0 corresponds to x = x0, y = y0; (x0, y0) represents the illumination center, σ x and σ y They represent the diffusion length of the light source along the X direction and the Y direction respectively; c represents the correlation coefficient of the light source in the X direction and the Y direction, and the value range is 0≤c<1; L max and L min Represents the highest brightness and the lowest brightness respectively;
[0153] The parameter set of the light illumination model is: p=(x0,y0,σ x ,σ y ,c,L max ,L min ).
[0154] In a possible implementation, the model building module 1 is specifically configured to generate a lighting map in the following manner:
[0155] The value at the integer point position (i, j) in the light illumination model is used as the brightness value L of the pixel at position (i, j) P (i,j);
[0156] The set of brightness values of all position pixels constitutes the illumination map: M p ={L P (i,j)}, i=0,1,…,W, j=0,1,…,H;
[0157] Where W and H represent the width and height of the light map respectively.
[0158] In one possible implementation, the cost function is expressed as: F(I1,I2,…,I n |M p )=ω1F1(I1,I2,…,I n |M p )+ω2F2(I1,I2,…,I n |M p );
[0159] Among them, F1(I1,I2,…,I n |M p ) is the overlap cost function, F2(I1,I2,…,I n |M p ) is the brightness discrete cost function, ω1 and ω2 are the weight coefficients of the two, ω1+ω2=1;
[0160] The calculation formula of the overlap cost function is as follows: F1(I1,I2,…,In |M p )=∑ lk C(Ω l ,Ω k ) / ∑ lk 1;
[0161] Where l = 0, 1, ..., n, k ≠ l, k = 0, 1, ..., n, image I l and image I k Horizontally or vertically adjacent; (Ω l ,Ω k )=S(B(I l |M p ),B(I k |M p )|O lk ),B(I l |M p ) and B(I k |M p ) are all based on M p is the background balance operator of the background image, C(X,Y) is the consistency calculation function, O lk Represents image I l Relative to image I k The offset is calculated as follows: lk =Г(I l ,I k );
[0162] Where, Г represents the feature matching operator;
[0163] The calculation formula of the brightness discrete cost function is as follows: F2(I1,I2,…,I n |M p )=V(I1,I2,…,I n )-V(B(I1|M p ),B(I2|M p ),…,B(I n |M p )); V(I1,I2,…,I n )=∑ l v(I l );
[0164] Among them, v(I l ) represents image I l The brightness dispersion coefficient is equal to the brightness standard deviation of the image divided by the brightness mean.
[0165] In a possible implementation, the correction module 4 is specifically configured to perform brightness correction in the following manner:
[0166] The following formula is used to perform brightness correction on the brightness component image sequence: lb =B(I l |M best );
[0167] Among them, M best is the optimal lighting map.
[0168] In a possible implementation, a response module is further included, and the response module is configured to:
[0169] In response to determining that overlapping regions exist between adjacent images in the sequence of luminance component images;
[0170] If the image I l and image I k Horizontally adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=x*I l (x,y|(x,y)∈Ω l )+(wx)I k (x,y|(x,y)∈Ω k );
[0171] Order: I l (x,y)=I k (x,y)=T(x,y);
[0172] If the image I l and image I k Vertically adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=y*I l (x,y|(x,y)∈Ω l )+(hy)I k (x,y|(x,y)∈Ω k );
[0173] Order: I l (x,y)=I k (x,y)=T(x,y);
[0174] Where x = 0, 1, ..., w, y = 0, 1, ..., h, w and h are the width and height of the overlapping area. Referring now to FIG12 , a schematic diagram of the structure of a computer device 1200 suitable for implementing an electronic device (e.g., the server or terminal device shown in FIG1 ) according to an embodiment of the present application is shown. The electronic device shown in FIG12 is merely an example and should not limit the functionality or scope of use of the embodiments of the present application.
[0175] As shown in FIG12 , a computer device 1200 includes a central processing unit (CPU) 1201 and a graphics processing unit (GPU) 1202, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1203 or a program loaded from a storage unit 1209 into a random access memory (RAM) 1204. Various programs and data required for the operation of the computer device 1200 are also stored in the RAM 1204. The CPU 1201, GPU 1202, ROM 1203, and RAM 1204 are connected to each other via a bus 1205. An input / output (I / O) interface 1206 is also connected to the bus 1205.
[0176] The following components are connected to the I / O interface 1206: an input section 1207 including a keyboard, a mouse, and the like; an output section 1208 including, for example, a liquid crystal display (LCD), and a speaker; a storage section 1209 including, for example, a hard disk; and a communication section 1210 including, for example, a network interface card such as a LAN card or a modem. The communication section 1210 performs communication processing via a network such as the Internet. A drive 1211 may also be connected to the I / O interface 1206 as needed. A removable medium 1212, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1211 as needed, so that a computer program read therefrom can be installed into the storage section 1209 as needed.
[0177] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1210, and / or installed from a removable medium 1212. When the computer program is executed by the central processing unit (CPU) 1201 and the graphics processing unit (GPU) 1202, the above-mentioned functions defined in the method of the present application are performed.
[0178] It should be noted that the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable medium, or any combination thereof. Computer-readable media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, apparatuses, or components, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or component. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution apparatus, device, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical cable, RF, or any suitable combination thereof.
[0179] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0180] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based device that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0181] The modules involved in the embodiments described in this application may be implemented in software or hardware, and may also be set in a processor.
[0182] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device implements the following functions:
[0183] A luminance component image sequence of an input image sequence is obtained, a light illumination model is constructed, and a light map is generated according to the light illumination model; a cost function is constructed based on the luminance component image sequence and the light map; an optimal solution is obtained by maximizing the cost function, an optimal light illumination model is determined according to the optimal solution, and an optimal light map is generated according to the optimal light illumination model; brightness correction is performed on the luminance component image sequence according to the optimal light map to obtain a corrected luminance image sequence, and a uniform light image is generated according to the corrected luminance image sequence.
[0184] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this application. Industrial Applicability
[0185] In summary, the present application provides a method, device, and readable medium for uniform illumination of sequential images, which can reduce the performance requirements, assembly accuracy requirements, and calibration requirements of imaging equipment, and improve image quality, reduce costs, and improve work efficiency.
Claims
1. A method for homogenizing sequential images, characterized in that: The following steps are involved: Obtaining a brightness component image sequence of an input image sequence, constructing a light illumination model, and generating a light map according to the light illumination model; Constructing a cost function based on the brightness component image sequence and the illumination map; By maximizing the cost function, an optimal solution is obtained, an optimal light illumination model is determined according to the optimal solution, and an optimal illumination map is generated according to the optimal light illumination model; The brightness component image sequence is subjected to brightness correction according to the optimal illumination map to obtain a corrected brightness image sequence, and a uniform light image is generated according to the corrected brightness image sequence.
2. The method for homogenizing sequential images according to claim 1, characterized in that: The constructing of the light illumination model specifically includes: The light illumination model is expressed by the following formula: L p (x,y)=L min +(L max -L min )K(t); Among them, K(t) is a kernel function with a peak at t = 0 and a single peak in the range of 0≤x≤2x0, 0≤y≤2y0, t = 0 corresponds to x = x0, y = y0; (x0, y0) represents the illumination center, σ x and σ y They represent the diffusion length of the light source along the X direction and the Y direction respectively; c represents the correlation coefficient of the light source in the X direction and the Y direction, and the value range is 0≤c<1; L max and L min Represent the highest brightness and the lowest brightness respectively; The parameter set of the light illumination model is: p=(x0,y0,σ x ,σ y ,c,L max ,L min )。 3. The method for homogenizing sequential images according to claim 1 or 2, characterized in that: Generating a light map according to the light illumination model specifically includes: The value at the integer point position (i, j) in the light illumination model is taken as the brightness value L of the pixel at the position (i, j) P (i,j); The light map is constructed by combining the brightness values of all pixels at all locations: M p ={L P (i,j)},i=0,1,…,W,j=0,1,…,H; Where W and H represent the width and height of the light map, respectively.
4. The method for homogenizing sequential images according to any one of claims 1 to 3, characterized in that: The cost function is expressed as: F(I1,I2,…,I n |M p )=ω1F1(I1,I2,…,I n |M p )+ω2F2(I1,I2,…,I n }M p ); Among them, F1(I1,I2,…,I n |M p ) is the overlap cost function, F2(I1,I2,…,I n |M p ) is the brightness discrete cost function, ω1 and ω2 are the weight coefficients of the two, ω1+ω2=1; The calculation formula of the overlap cost function is as follows: F1(I1,I2,…,I n |M p )=∑ lk C(Ω l ,Oh k ) / ∑ lk 1; Where l = 0, 1, ..., n, k ≠ l, k = 0, 1, ..., n, image I l and image I k Horizontally or vertically adjacent; (Ω l ,Ω k )=S(B(I l |M p ),B(I k }M p )|O lk ),B(I l |M p ) and B(I k |M p ) are all based on M p is the background balance operator of the background image, C(X,Y) is the consistency calculation function, O lk Represents image I l Relative to image I k The calculation formula of the offset is as follows: The lk =Г(I l ,I k ); Among them, Г represents the feature matching operator; The calculation formula of the brightness discrete cost function is as follows: F2(I1,I2,…,I n |M p )=V(I1,I2,…,I n )-V(B(I1|M p ),B(I2|M p ),…,B(I n |M p )); V(I1,I2,…,I n )=∑ l v(I l ); Among them, v(I l ) represents image I l The brightness dispersion coefficient is equal to the brightness standard deviation of the image divided by the brightness mean.
5. The method for homogenizing sequential images according to any one of claims 1 to 4, characterized in that: The performing brightness correction on the brightness component image sequence according to the optimal illumination map specifically includes: The brightness correction of the brightness component image sequence is performed using the following formula: I lb =B(I l |M best ); Among them, M best The optimal lighting map.
6. The method for homogenizing sequential images according to any one of claims 1 to 5, characterized in that: Also includes: In response to determining that there is an overlapping area between adjacent images in the luminance component image sequence; If the image I l and image I k Horizontally adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=x*I l (x,y|(x,y)∈Ω l )+(w-x)I k (x,y|(x,y)∈Ω k ); Let: I l I(x,y) = I k I(x,y) = T(x,y); If the image I l and image I k Vertically adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=y*I l (x,y|(x,y)∈Ω l )+(hy)I k (x,y|(x,y)∈Ω k ); Let: I l I(x,y) = I k I(x,y) = T(x,y); Wherein, x=0,1,…,w, y=0,1,…,h, w and h are the width and height of the overlapping area.
7. The method for homogenizing sequential images according to any one of claims 1 to 6, characterized in that: The step of obtaining a brightness component image sequence of an input image sequence specifically includes: Acquire an input image sequence, perform HSL conversion on the RGB triplet of the image sequence to obtain an HSL triplet, and determine the brightness component image sequence according to the HSL triplet; Generating a uniform light image according to the corrected brightness image sequence specifically includes: The brightness value at the same position in the corrected brightness image sequence is updated to the HSL triplet to obtain an updated HSL triplet, the updated HSL triplet is converted to RGB to obtain an updated RGB triplet, and a uniform light image is generated according to the updated RGB triplet.
8. A sequential image light homogenization device, characterized in that: include: A model building module is configured to obtain a brightness component image sequence of an input image sequence, build a light luminance model, and generate a light map according to the light luminance model; A cost function construction module, configured to construct a cost function based on the brightness component image sequence and the illumination map; A solution module is configured to obtain an optimal solution by maximizing the cost function, determine an optimal light illumination model according to the optimal solution, and generate an optimal illumination map according to the optimal light illumination model; The correction module is configured to perform brightness correction on the brightness component image sequence according to the optimal illumination map to obtain a corrected brightness image sequence, and generate a uniform light image according to the corrected brightness image sequence.
9. The sequential image light homogenization device according to claim 8, characterized in that: The model building module is specifically configured to build a light illumination model in the following manner: The light illumination model is expressed by the following formula: L p (x,y)=L min +(L max -L min )K(t); Among them, K(t) is a kernel function with a peak at t = 0 and a single peak in the range of 0≤x≤2x0, 0≤y≤2y0, t = 0 corresponds to x = x0, y = y0; (x0, y0) represents the illumination center, σ x and σ y They represent the diffusion length of the light source along the X direction and the Y direction respectively; c represents the correlation coefficient of the light source in the X direction and the Y direction, and the value range is 0≤c<1; L max and L min Represent the highest brightness and the lowest brightness respectively; The parameter set of the light illumination model is: p=(x0,y0,σ x ,σ y ,c,L max ,L min )。 10. The sequential image light homogenization device according to claim 8 or 9, characterized in that: The model building module is specifically configured to generate a lighting map in the following manner: The value at the integer point position (i, j) in the light illumination model is taken as the brightness value L of the pixel at the position (i, j) P (i,j); The light map is constructed by combining the brightness values of all pixels at all locations: M p ={L P (i,j)},i=0,1,…,W,j=0,1,…,H; Where W and H represent the width and height of the light map, respectively.
11. The sequential image light homogenization device according to any one of claims 8 to 10, characterized in that: The cost function is expressed as: F(I1,I2,…,I n |M p )=ω1F1(I1,I2,…,I n |M p )+ω2F2(I1,I2,…,I n |M p ); Among them, F1(I1,I2,…,I n |M p ) is the overlap cost function, F2(I1,I2,…,I n |M p ) is the brightness discrete cost function, ω1 and ω2 are the weight coefficients of the two, ω1+ω2=1; The calculation formula of the overlap cost function is as follows: F1(I1,I2,…,I n |M p )=∑ lk C(Ω l ,Oh k ) / ∑ lk 1; Where l = 0, 1, ..., n, k ≠ l, k = 0, 1, ..., n, image I l and image I k Horizontally or vertically adjacent; (Ω l ,Ω k )=S(B(I l |M p ),B(I k |M p )|O lk ),B(I l |M p ) and B(I k |M p ) are all based on M p is the background balance operator of the background image, C(X,Y) is the consistency calculation function, O lk Represents image I l Relative to image I k The calculation formula of the offset is as follows: The lk =Г(I l ,I k ); Among them, Г represents the feature matching operator; The calculation formula of the brightness discrete cost function is as follows: F2(I1,I2,…,I n |M p )=V(I1,I2,…,I n )-V(B(I1|M p ),B(I2|M p ),…,B(I n |M p )); V(I1,I2,…,I n )=∑ l v(I l ); Among them, v(I l ) represents image I l The brightness dispersion coefficient is equal to the brightness standard deviation of the image divided by the brightness mean.
12. The sequential image light homogenization device according to any one of claims 8 to 11, characterized in that: The correction module is specifically configured to perform brightness correction in the following manner: The brightness correction of the brightness component image sequence is performed using the following formula: I lb =B(I l |M best ); Among them, M best The optimal lighting map.
13. The sequential image light homogenization device according to any one of claims 8 to 12, characterized in that: Also included is a response module, which is configured to: In response to determining that there is an overlapping area between adjacent images in the luminance component image sequence; If the image I l and image I k Horizontally adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=x*I l (x,y|(x,y)∈Ω l )+(w-x)I k (x,y|(x,y)∈Ω k ); Let: I l I(x,y) = I k I(x,y) = T(x,y); If the image I l and image I k Vertically adjacent, Ω l and Ω k Respectively represent the overlapping area corresponding to image I l and image I k The brightness of the overlapping area is: T(x,y)=y*I l (x,y|(x,y)∈Ω l )+(hy)I k (x,y|(x,y)∈Ω k ); Let: I l I(x,y) = I k I(x,y) = T(x,y); Wherein, x=0,1,…,w, y=0,1,…,h, w and h are the width and height of the overlapping area.
14. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method of enhancing underwater image based on Retinex model
CN107507138A
Underwater illumination non-uniform image enhancement method based on alternating direction multiplier method
CN113313670A
Non-uniform illumination color image correction method based on region division
CN114331873A
Low-light image enhancement method and system, terminal and storage medium
CN115358943A
Sequence image dodging method and device and readable medium
CN117197328A