Disclosure of Invention
The invention aims to solve the technical problems in the prior art and provides a multi-target color correction method for SAR images, which synchronously optimizes two targets with highest color consistency and minimum information loss of the stretched images.
In order to achieve the above objective, the present invention provides a multi-target color correction method for SAR image, which comprises the following steps,
Preprocessing an original image;
Performing linear stretching transformation based on the image gray value to construct a multi-objective optimization model;
solving linear stretching parameters of all images based on a multi-objective optimization model;
and stretching the original image by using the obtained linear stretching parameters, and embedding.
And the preprocessing of the original image comprises the steps of obtaining the total number of all images, the maximum pixel gray value of each image, the minimum pixel gray value of each image, the gray average value of each image, the standard deviation of each image, the number of pixels of each image, the gray average value of the image pair with the overlapping area, the standard deviation of the image pair with the overlapping area and the number of effective pixels of the image pair with the overlapping area.
And the method for constructing the multi-objective optimization model based on the linear stretching transformation of the image gray values comprises the steps of setting two objective functions of highest color consistency and minimum information loss of the synchronously optimized stretched image by taking the linear stretching parameters as decision variables, setting equation constraint based on the total brightness and contrast of the image before and after correction, and setting inequality constraint based on the fact that the pixel gray values after correction meet quantization bit limit.
And when the objective function with the highest color consistency is set, the index mean value and standard deviation of the overlapped area are used as observation values to construct a color consistency optimization target.
And when an objective function with the minimum information loss is set, the sum of the numbers of pixels with out-of-limit pixel gray values after the original image is stretched is used as an information loss optimization target.
And the total brightness and contrast of the images before and after correction are kept unchanged, and the realization mode is that the setting condition requires that the gray average value sum before and after stretching of all the overlapped areas of the single image is kept unchanged and the standard deviation sum is kept unchanged.
And the pixel gray value after correction meets the limit of quantization bit number to set inequality constraint, and the realization mode is that the setting condition requires that the gray value after image stretching meets the value range before transformation.
And solving the linear stretching parameters of all images based on the multi-objective optimization model, wherein the linear stretching parameters comprise a fusion element heuristic algorithm NSAG-II and an obstacle function interior point method for solving, and the obstacle function interior point method is adopted to calculate the objective function value of the color consistency optimization objective.
On the other hand, the invention also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the multi-target color correction method for SAR images when executing the program.
On the other hand, the invention also provides a computer program product, which comprises a computer program and is characterized in that the computer program is executed by a processor to realize the multi-target color correction method for SAR images.
According to the SAR image color correction method based on the multi-objective optimization mode, the SAR image is subjected to color correction processing, pixel information on the SAR image is effectively utilized, and the corrected SAR image presents more consistent color tones.
The scheme of the invention is simple and convenient to implement, has strong practicability, solves the problems of low practicability and inconvenient practical application existing in the related technology, can improve user experience, and has important market value.
Detailed Description
The technical scheme of the invention is specifically described below with reference to the accompanying drawings and examples.
Referring to fig. 1, an embodiment of the present invention provides a multi-target color correction method for SAR images, which includes the following steps of S1) preprocessing an original image;
in an embodiment, the preprocessing of the original image is implemented as follows,
Acquiring the data including total number n of all images and the maximum pixel gray value of each imageMinimum pixel gray value of each imageThe gray scale mean mu i of each image, the standard deviation sigma i of each image, the number of image elements S i of each image, the gray scale mean mu ij、μji of the image pair with the overlapping area, the standard deviation sigma ij、σji of the image pair with the overlapping area and the number of effective image elements S ij of the image pair with the overlapping area. Wherein i and j are image labels, i noteq j.
S2) performing linear stretching transformation based on the image gray values to construct a multi-objective optimization model;
In an embodiment, the linear stretching transformation is performed based on the gray level value of the image to construct a multi-objective optimization model, which is implemented as follows,
Taking a linear stretching parameter a i、bi as a decision variable, synchronously optimizing two targets of highest color consistency and minimum information loss of the stretched image, keeping the total brightness and contrast of the image unchanged before and after correction as an equality constraint, and taking the pixel gray value after correction as an inequality constraint when the quantized bit limit is met, wherein an optimization model is expressed as follows:
A={Yi∈N*|aiYi+bi>2m-1,aiYi+bi<0}
s.t.min(y′)≥min(Y1);
max(y′)≤max(Y1);
Wherein n is the total number of images, m is the number of quantization bits of the images, mu ij、μji is the gray average value of the overlapping area of i and j, sigma ij、σji is the standard deviation of the overlapping area of i and j, S ij is the number of pixels of the overlapping area of i and j, a i、bi is the linear stretching coefficient to be solved, Y' is the gray value of the image after linear stretching, min (Y1) and max (Y1) are the minimum and maximum gray values allowed by the image, S i is the number of pixels of the image i, mu i is the gray average value of the image i, sigma i is the standard deviation of the image i, and Y i is the gray value set of the original image of the ith scene.
The specific construction and explanation of the optimization model are as follows:
The color consistency optimization target, namely the objective function 1, is constructed by taking the index mean value and the standard deviation of the overlapping area as observation values and can be expressed as follows:
Wherein n is the total number of images, mu ij、μji is the gray average value of the i and j overlapping areas, sigma ij、σji is the standard deviation of the i and j overlapping areas, and S ij is the number of pixels of the i and j overlapping areas.
The optimization target, namely the objective function 2, taking the minimum sum of the number of pixels with out-of-limit pixel gray values after the original image is stretched as the information loss amount can be expressed as:
A={Yi∈N*|aiYi+bi>2m-1,aiYi+bi<0}
Wherein a i、bi is a linear stretch coefficient to be solved, Y i is a gray value set of an i-th scene original image, m is an image quantization bit number, N * is a positive integer, num (A) is the number of pixels exceeding an image quantization range, and minimize is a minimized objective function.
In order to take the limit that the gray value of the corrected pixel meets the quantization bit number as the inequality constraint, the embodiment further provides that the inequality constraint of the model indicates that the gray value maximum value after image stretching needs to meet the value range allowed by the image category, and the gray value maximum value can be expressed as follows:
min(y′)≥min(Y1)
max(y′)≤max(Y1)
wherein Y ' is the gray value of the image after linear stretching, min (Y ') and max (Y ') are divided into the minimum gray value and the maximum gray value of the image after linear stretching, min (Y1) and max (Y1) are respectively the minimum gray value and the maximum gray value allowed by the image, the invention is mainly designed for SAR images, and the value range of the SAR images is 0-65535 (16 bits);
In order to maintain unchanged the equality constraint based on the overall brightness and contrast of the images before and after correction, the embodiment further provides the equality constraint condition requirement of the model, and the sum of gray-scale mean values and the sum of standard deviation before and after stretching all the overlapped areas of the single image are kept unchanged.
Wherein n is the total number of images, s i is the number of pixels in the overlapping region of the image i, a i、bi is the decision variable to be solved, and mu i is the gray average value of the overlapping region of the image i;
Where n is the total number of images, s i is the number of pixels in the overlapping region of image i, a i is the decision variable to be solved, and σ i is the standard deviation of the overlapping region of image i.
S3) solving the multi-objective optimization model established in the step S2) to obtain linear stretching parameters of all images;
in the embodiment, in the face of the situation that a plurality of constraint conditions, a continuous objective function and a discrete objective function exist in the model, a fusion algorithm which fully combines the global searching capability of the meta-heuristic algorithm NSAG-II and the capability of accurately solving the quadratic programming model by the obstacle function interior point method is preferably provided, the implementation process comprises the following steps,
The first step, generating an initial population, namely a decision variable linear stretch coefficient;
In specific implementation, it is preferable to propose to use NSGA-II algorithm to generate initial population, and detailed implementation description of NSGA-II algorithm can be found in prior art document, and the invention is not repeated :W.Zheng and B.Doerr,"Approximation Guarantees for the Non-Dominated Sorting Genetic Algorithm II(NSGA-II),"IEEE Trans.Evol.Computat.,pp.1–1,2024,doi:10.1109/TEVC.2024.3402996.
Second, calculating the fitness value of each individual in the initial population
(1) Calculating an objective function value 1 of each individual in the initial population;
in the specific implementation, the objective function value of the color consistency optimization target is preferably calculated by adopting an obstacle function interior point method, the specific description of the obstacle function interior point method can be seen in the prior art document, and the invention is not repeated in detail in the specification of P.Malisani, "Interior Point Methods in Optimal Control" and doi:10.1051/cocv/2024049.
(2) The objective function value 2 of each individual in the initial population is calculated, and in practice, it is preferable to propose to calculate the objective function value of the information loss optimization objective by using a statistical method (i.e., count accumulation).
Thirdly, performing rapid non-dominant sorting on two objective function values (the objective function values of the color consistency optimization objective and the information loss optimization objective), and generating a new child population by using selection, intersection and mutation operations;
Fourth, the parent population and the offspring population are combined;
Fifthly, carrying out rapid non-dominant sorting and crowding distance calculation on the combined population, and selecting excellent individuals to form a new parent population;
A sixth step of generating a new offspring population by utilizing operations such as selection, crossing, mutation and the like, and combining the new parent population with the new offspring population to form an updated population;
And seventhly, repeating the fifth to sixth steps. Stopping iteration when the iteration number exceeds the maximum limit;
And eighth step, outputting final Pareto front solutions, terminating the algorithm, wherein each solution on the front surface represents a set of stretching parameters of all images.
S4) stretching the original image by using the obtained linear stretching parameters, and embedding.
In specific implementation, if the longitude and latitude of adjacent SAR images overlap, a certain overlapping area generally exists. In this embodiment, the stretching process is performed on the original image with the overlapping area by using the obtained linear stretching parameters, and the implementation manner is that the gray value of the original image is linearly stretched by using the obtained decision variable a i、bi by using the following formula, so as to obtain the color correction image.
y′=aiYi+bi
For the convenience of explanation of the technical effects of the present invention, table 1 provides a comparison of the results of applying the method of the present invention and the prior art, fig. 2 is an original SAR image mosaic effect graph of the embodiment of the present invention, fig. 3 is an effect graph of the multi-target color correction processing method for SAR image of the embodiment of the present invention, and fig. 4 is an effect graph after processing by the comparison algorithm method of the embodiment of the present invention. It can be seen that the results of the present invention perform better in many ways.
TABLE 1
The implementation of the comparison method can be seen in the literature :Cresson R,Saint-Geours N.Natural Color Satellite Image Mosaicking Using Quadratic Programming in Decorrelated Color Space[J].IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing,2017,8(8):4151-4162.DOI:10.1109/JSTARS.2015.2449233.
In specific implementation, the above flow can be automatically operated by adopting a computer software technology.
In addition, the application also relates to electronic equipment which comprises at least one processor and a memory which is in communication connection with the at least one processor, wherein the memory stores instructions which can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the multi-target color correction method facing SAR images.
The application also relates to a non-transitory computer readable storage medium storing computer instructions for causing the computer to execute the above multi-target SAR image-oriented color correction method.
The application also relates to a computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the above-mentioned SAR image-oriented multi-target color correction method.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention, and not for limiting the same, and although the present invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present invention.