Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides an infrared small and weak target image sequence simulation method based on a mean value model.
In order to achieve the purpose, the method comprises the following specific steps:
(1) Acquiring an image background:
(1a) Acquiring a real infrared image background sequence by using a thermal infrared imager to obtain an original infrared image background sequence;
(1b) Assigning the frame number i of the original infrared image background sequence to be 1;
(2) Simulating the background of the infrared small dim target image:
(2a) Reading in an ith original infrared image background in the original infrared image background sequence, wherein i is more than 0 and less than or equal to R, and R represents the total frame number of the original infrared image background sequence;
(2b) Setting an initial row and an initial column for cutting the background of the ith frame of original infrared image;
(2c) Cutting an ith frame of original infrared image background to obtain a simulated infrared small target image background with the size of MxN, wherein M represents the line number of the simulated infrared small target image background, N represents the column number of the simulated infrared small target image background, M is more than or equal to 0 and less than or equal to A, N is more than or equal to 0 and less than or equal to B, A represents the line number of each frame of image in the original infrared image background sequence, and B represents the column number of each frame of image in the original infrared image background sequence;
(3) Carrying out mirror image expansion on the background edge of the simulated infrared small and weak target image;
(4) Creating an infrared small target model:
(4a) Setting the signal-to-noise ratio D of the infrared weak target, wherein D is an integer value within the range of more than 0 and less than or equal to 20;
(4b) Calculating the gray value of the infrared weak and small target pixel according to the following formula:
s=D×σ+μ
wherein s represents the gray value of the pixel of the infrared small dim target, D represents the set signal-to-noise ratio of the infrared small dim target, sigma represents the standard deviation of all pixels in a local neighborhood taking the centroid of the infrared small dim target as the center, and mu represents the mean value of all pixels in a local neighborhood range taking the centroid of the infrared small dim target as the center;
(4c) Setting the size of the infrared dim target as m multiplied by m pixels, wherein m is an integer value within the range of more than 0 and less than or equal to 10;
(5) Setting an infrared small target track:
(5a) Setting the moving speed of the infrared weak and small target as delta x pixels/frame, wherein delta x is valued in the range of 0< delta x < 10;
(5b) Taking a pixel point at the top left corner vertex of the background of the ith frame of simulated infrared dim target image as an origin, taking the horizontal rightward direction as an x axis and taking the vertical downward direction as a y axis, and establishing a background track coordinate system of the ith frame of simulated infrared dim target image;
(5c) Judging whether the background frame number of the simulated infrared dim target image is 1, if so, executing the step (5 d); otherwise, executing step (5 e);
(5d) Setting the abscissa value of the infrared dim target in the 1 st frame simulation infrared dim target image background track coordinate system as x 1 ,0<x 1 N is less than or equal to N, wherein N represents the column number of the background of the simulated infrared small target image, and a linear model of the background track of the 1 st frame of the simulated infrared small target image is established according to the following formula:
y 1 =ax 1 +b
wherein, y 1 The vertical coordinate value of the infrared dim target in the 1 st frame simulation infrared dim target image background track coordinate system is represented, and y is more than 0 1 M is less than or equal to M, M represents the line number of the background of the simulated infrared dim target image, x 1 The abscissa value of the infrared dim target in the 1 st frame simulation infrared dim target image background track coordinate system is represented, and x is more than 0 1 N is less than or equal to N, N represents the column number of the background of the simulated infrared dim target image, a represents the slope of the linear model of the background track of the simulated infrared dim target image, b represents the intercept of the linear model of the background track of the simulated infrared dim target image, and the value ranges of a and b are as follows: 0< ax 1 + b is less than or equal to M, and M represents the line number of the background of the simulated infrared weak and small target image;
(5e) According to the following formula, establishing a straight line model of the background track of the simulation infrared dim target image except the 1 st frame:
wherein x is i The abscissa value of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is represented, and x is more than 0 i N is less than or equal to N, wherein N represents the column number, x, of the background of the simulated infrared dim target image i-1 The abscissa value of the infrared dim target in the i-1 frame simulation infrared dim target image background track coordinate system is represented, and x is more than 0 i-1 N is less than or equal to N, N represents the column number of the background of the simulated infrared dim target image, deltax represents the movement speed of the infrared dim target, and Deltax is 0<Δx&Value of y within 10 i The longitudinal coordinate value of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is expressed, and y is more than 0 i M is less than or equal to M, M represents the line number of the background of the simulated infrared dim target image, a represents the slope of the linear model of the infrared dim target track, b represents the intercept of the linear model of the infrared dim target track, and the value ranges of a and b are as follows: 0< ax i +b≤M;
(6) Synthesizing a simulated infrared weak and small target image:
(6a) And setting the total frame number of the simulated infrared dim target image sequence according to the following formula:
0<L≤min((N-x 1 )/Δx,R)
wherein, L represents the total frame number of the simulated infrared dim target image sequence, min (·) represents the minimum operation, N represents the column number of the background of the simulated infrared dim target image, and x 1 The abscissa value of the infrared dim target in the 1 st frame of the simulated infrared dim target image sequence is represented, the delta x represents the movement speed of the infrared dim target, and the delta x is 0<Δx&Taking values within 10 ranges, wherein R represents the total frame number of the original infrared image background sequence;
(6b) Assigning the gray value s of the infrared weak and small target pixel in the step (4 b) to the pixel in the m multiplied by m pixel block, wherein the m multiplied by m pixel block is (x) i ,y i ) The pixel blocks are pixel blocks of the infrared weak small target centroid, m is an integer value within the range of more than 0 and less than or equal to 10, and a simulated infrared weak small target image is obtained, x i The abscissa value of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is represented, and x is more than 0 i N is less than or equal to N, N represents the column number of the background of the simulated infrared dim target image, y i The longitudinal coordinate value of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is expressed, and y is more than 0 i If the number of lines is less than M, M represents the number of lines of the background of the simulated infrared dim target image;
(7) Performing accumulation 1 operation on the background frame number i of the simulated infrared small and weak target image;
(8) Judging whether the background frame number of the simulated infrared dim target image after 1 accumulation is equal to the total frame number L +1 of the simulated infrared dim target image sequence, if so, executing the step (9); otherwise, executing the step (2);
(9) And outputting a simulated infrared small target image sequence.
Compared with the prior art, the invention has the following advantages:
firstly, because the invention uses the high-performance thermal infrared imager to collect the real infrared image background sequence as the original infrared image background sequence, the invention overcomes the defects that in the prior art, when an infrared scene image is generated by simulation, the scene is required to be classified and the texture type is specified, a scene three-dimensional model is established, a mapping file is generated, an atmospheric parameter model, an imaging model and atmospheric parameter conditions are loaded, the simulation output of the infrared scene image is completed, the steps are complex, the calculated amount is large, the generated infrared weak and small target image sequence lacks the texture detail characteristics, and the defect of larger distortion exists compared with the real infrared weak and small target image, so that the invention has the advantages of simple steps, small calculated amount, high fidelity of the simulated infrared weak and small target image, and rich texture detail characteristics.
Secondly, because the modeling simulation method is used, the defects that the size of the infrared dim target, the signal-to-noise ratio of the infrared dim target, the movement speed of the infrared dim target and the flight path of the infrared dim target cannot be controlled in the prior art are overcome, so that the method has the advantages that the size of the infrared dim target, the signal-to-noise ratio of the infrared dim target, the movement speed of the infrared dim target and the flight path of the infrared dim target can be controlled.
Detailed Description
The present invention is described in further detail below with reference to the attached drawing figures.
Referring to fig. 1, the specific steps of the present invention are as follows.
Step 1, collecting an infrared image background.
And step 1, acquiring a real infrared image background sequence by using a thermal infrared imager to obtain an original infrared image background sequence.
In the implementation of the invention, the real infrared image background sequence is an infrared sky background image sequence. Fig. 2 shows a 50 th frame of infrared sky background image in the infrared sky background image sequence, where the sky background shown in fig. 2 has rich texture features.
And step 2, assigning the frame number i of the original infrared image background sequence as 1.
And 2, simulating the infrared dim target image background.
Reading in an ith original infrared image background in the original infrared image background sequence, wherein i is more than 0 and less than or equal to R, and R represents the total frame number of the original infrared image background sequence.
In the implementation of the invention, the total frame number R of the original infrared image background sequence is 1000.
And 2, setting a starting row and a starting column for cutting the background of the ith frame of original infrared image, wherein the starting row for cutting the background of the ith frame of original infrared image is more than 0 and less than the row number of the background of the original infrared image, and the starting column for cutting the background of the ith frame of original infrared image is more than 0 and less than the column number of the background of the original infrared image.
In the implementation of the present invention, an initial row 150 for the background cropping of the i-th frame of original infrared image is set, and an initial column 150 for the background cropping of the i-th frame of original infrared image is set.
And 3, cutting the original infrared image background of the ith frame to obtain an artificial infrared weak and small target image background with the size of MxN, wherein M represents the line number of the artificial infrared weak and small target image background, N represents the column number of the artificial infrared weak and small target image background, M is more than or equal to 0 and less than or equal to A, N is more than or equal to 0 and less than or equal to B, A represents the line number of each frame image in the original infrared image background sequence, and B represents the column number of each frame image in the original infrared image background sequence.
In the implementation of the invention, the original infrared image background with the size of 480 multiplied by 625 of the ith frame is cut to obtain the simulated infrared weak and small target image background with the size of 256 multiplied by 256.
And 3, carrying out mirror image expansion on the background edge of the simulated infrared small dim target image.
Step 1, initializing a mirror image expansion image matrix to be (M +2 t) x (N +2 t) to obtain an expansion image matrix, wherein t represents the width of the background expansion of the simulation infrared small and weak target image, M represents the number of rows of the simulation infrared small and weak target image background, N represents the number of columns of the simulation infrared small and weak target image background, and 0 to t & ltmin (M/4, N/4) and min (·) represents minimum operation.
In the practice of the present invention, the mirror expanded image matrix is initialized to 276 x 276, resulting in an expanded image matrix of 276 x 276 in size.
Assigning the simulated infrared small target image background to the t +1 st row to t + M row of the extended image matrix, within the range from the t +1 st row to the t + N row, assigning data of the extended image matrix from 2t to t +1 th row to the 1 st row of the extended image matrix, assigning data of the extended image matrix from M +1 st to t + M +1 th row to the 2t + M row of the extended image matrix, assigning data of the extended image matrix from 2t to t +1 th row to the 1 st column of the extended image matrix, assigning data of the extended image matrix from N +1 st to t + N column to the 2t + N +1 th row of the extended image matrix, so as to obtain the expanded simulated infrared small target image background, wherein M represents the number of rows of the simulated infrared small target image background, N represents the number of columns of the simulated infrared small target image background, t represents the expanded width of the simulated infrared small target image background, 0 t/min (M/4 min), and N/4 operation is the minimum value (M/N/4.).
In the implementation of the invention, the simulated infrared weak small target image background is assigned to the 11 th row to the 266 th row of the extended image matrix, the 11 th column to the 266 th column, the 20 th row to the 11 th row of the extended image matrix are assigned to the 1 st row to the 10 th row of the extended image matrix respectively, the 257 th row to the 266 th row of the extended image matrix are assigned to the 276 th row to the 267 th row of the extended image matrix respectively, the 20 th column to the 11 th column data of the extended image matrix are assigned to the 1 st column to the 10 th column of the extended image matrix respectively, the 257 th column to the 266 th column data of the extended image matrix are assigned to the 276 th column to the 267 th column of the extended image matrix respectively, and the expanded simulated infrared weak target image background with the size of 276 x 276 is obtained.
And 4, creating an infrared small target model.
Step 1, setting the signal-to-noise ratio D of the infrared weak target, wherein D is an integer value within the range that D is more than 0 and less than or equal to 20.
In the implementation of the invention, the signal-to-noise ratio of the infrared weak target is set to be 6.
Step 2, calculating the gray value of the infrared weak and small target pixel according to the following formula:
s=D×σ+μ
wherein s represents the gray value of the pixel of the infrared small dim target, D represents the set signal-to-noise ratio of the infrared small dim target, sigma represents the standard deviation of all pixels in a local neighborhood taking the centroid of the infrared small dim target as the center, and mu represents the mean value of all pixels in a local neighborhood taking the centroid of the infrared small dim target as the center.
In the implementation of the present invention, the size of the local neighborhood centered on the centroid of the infrared weak small target is 9 × 9, which includes 81 pixels, σ represents the standard deviation of all pixels in the 9 × 9 range centered on the centroid of the infrared weak small target, and μ represents the mean of all pixels in the 9 × 9 range centered on the centroid of the infrared weak small target.
And 3, setting the size of the infrared small target as m multiplied by m pixels, wherein m is an integer value within the range of more than 0 and less than or equal to 10.
In the implementation of the invention, the size of the infrared weak and small target is set to be 3 × 3 pixels.
And 5, setting an infrared small target track.
Step 1, setting the movement speed of the infrared weak and small target as delta x pixels/frame, wherein delta x takes values within the range of 0< delta x < 10.
In the implementation of the invention, the difference value of the horizontal coordinates of the infrared small and weak target between two adjacent frames in the infrared small and weak target image sequence sets the movement speed of the infrared small and weak target to 1 pixel/frame.
And 2, taking the pixel point at the top left corner vertex of the background of the ith frame of simulated infrared dim target image as an origin, taking the horizontal rightward direction as an x axis, taking the vertical downward direction as a y axis, and establishing a background track coordinate system of the ith frame of simulated infrared dim target image.
Step 3, judging whether the background frame number of the simulation infrared small and weak target image is 1, if so, executing the step 4 in the step 5; otherwise, executing step 5 in step 5.
Step 4, setting the abscissa value of the infrared dim target in the 1 st frame simulation infrared dim target image background track coordinate system as x 1 ,0<x 1 N is less than or equal to N, wherein N represents the column number of the background of the simulated infrared small target image, and a linear model of the background track of the 1 st frame of the simulated infrared small target image is established according to the following formula:
y 1 =ax 1 +b
wherein, y 1 The vertical coordinate value of the infrared dim target in the 1 st frame simulation infrared dim target image background track coordinate system is represented, and y is more than 0 1 M is less than or equal to M, M represents the line number of the background of the simulated infrared dim target image, x 1 The abscissa value of the infrared dim target in the 1 st frame simulation infrared dim target image background track coordinate system is represented, and x is more than 0 1 N is less than or equal to N, N represents the column number of the simulation infrared small dim target image background, a represents the slope of the linear model of the simulation infrared small dim target image background track, b represents the intercept of the linear model of the simulation infrared small dim target image background track, and the value ranges of a and b are as follows: 0< ax 1 And + b is less than or equal to M, wherein M represents the number of lines of the background of the simulated infrared dim target image, in the implementation of the invention, the abscissa value of the infrared dim target in the 1 st frame of simulated infrared dim target image background track coordinate system is set as 30, the slope of the linear model for simulating the infrared dim target image background track is 1, the intercept of the linear model for simulating the infrared dim target image background track is 10, and the linear model for simulating the infrared dim target image background track is y 1 =x 1 +10, the coordinates of the infrared dim target in the 1 st frame simulation infrared dim target image background track coordinate system are (30, 40), and step 6 is executed after the 4 th step in step 5 is finished.
And 5, establishing a linear model of the background track of the simulated infrared small dim target image except the 1 st frame according to the following formula:
wherein x is i The abscissa value of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is represented, and x is more than 0 i N is less than or equal to N, wherein N represents the column number, x, of the background of the simulated infrared dim target image i-1 The abscissa value of the infrared dim target in the i-1 frame simulation infrared dim target image background track coordinate system is represented, and x is more than 0 i-1 N is less than or equal to N, N represents the column number of the background of the simulated infrared small target image, deltax represents the moving speed of the infrared small target, and Deltax is 0<Δx&Value of y within 10 i The longitudinal coordinate value of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is expressed, and y is more than 0 i M is less than or equal to M, M represents the line number of the background of the simulated infrared dim target image, a represents the slope of the linear model of the infrared dim target track, b represents the intercept of the linear model of the infrared dim target track, and the value ranges of a and b are as follows: 0< ax i And + b is less than or equal to M, in the implementation of the invention, the slope of the linear model simulating the background track of the infrared dim small target image is 1, the intercept of the linear model simulating the background track of the infrared dim small target image is 10, and the linear models simulating the background track of the infrared dim small target image except for the 1 st frame are as follows:
the coordinate of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is (x) i ,y i ) Fig. 3 is a schematic view of a flight path of a simulated infrared small dim target according to the present invention.
And 6, synthesizing a simulated infrared small target image.
Step 1, setting the total frame number of the simulated infrared weak and small target image sequence according to the following formula:
0<L≤min((N-x 1 )/Δx,R)
wherein L represents the total image sequence of the simulated infrared weak and small targetFrame number, min (-) denotes minimum operation, N denotes column number of background of simulated infrared dim target image, x 1 The abscissa value of the infrared dim target in the 1 st frame of the simulated infrared dim target image sequence is represented, the delta x represents the movement speed of the infrared dim target, and the delta x is 0<Δx&And (4) taking a value within the range of 10, wherein R represents the total frame number of the original infrared image background sequence.
In the implementation of the invention, the total frame number L of the simulated infrared dim target image sequence is set to be 226.
Step 2, assigning the gray value s of the infrared weak and small target pixel in the step 4b to the pixel in the m multiplied by m pixel block, wherein the m multiplied by m pixel block is (x) i ,y i ) The pixel blocks are pixel blocks of the heart of the infrared weak small target, m is an integer value within the range of more than 0 and less than or equal to 10, and a simulated infrared weak small target image, x i The abscissa value of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is represented, and x is more than 0 i N is less than or equal to N, N represents the column number of the background of the simulated infrared small target image, y i The vertical coordinate value of the infrared dim target in the ith frame simulation infrared dim target image background track coordinate system is expressed, y is more than 0 i And < M, wherein M represents the line number of the background of the simulated infrared weak and small target image.
In the implementation of the invention, the gray value s of the infrared weak and small target pixel in the step (4 b) is assigned to the pixel in the 3 × 3 pixel block, and the 3 × 3 pixel block is (x) i ,y i ) The pixel blocks are pixel blocks of the infrared weak small target type heart. The centroid coordinates of the infrared weak small target in the 50 th frame of simulated infrared weak small target image are (79, 89).
Fig. 4 is a schematic diagram of a neighborhood of 9 × 9 size centered around (79, 89) in the 50 th frame of infrared small object image, where the gray values of 9 pixels in a size range of 3 × 3 centered around the centroid of the infrared small object are all s. As can be seen from fig. 4, the infrared small target is a mean value model.
Fig. 5 is a schematic diagram of a 50 th frame of simulated infrared small and weak target image, and it can be seen from fig. 5 that the simulated infrared small and weak target image is generated by simulating and embedding the infrared small and weak target on the basis of fig. 3.
And 7, accumulating 1 operation on the background frame number i of the simulation infrared small and weak target image.
Step 8, judging whether the background frame number of the simulated infrared weak and small target image after 1 accumulation is equal to the total frame number L +1 of the simulated infrared weak and small target image sequence, if so, executing step 9; otherwise, step 2 is executed.
And 9, outputting a simulated infrared small target image sequence.
The total frame number of the simulated infrared small target image sequence is 226, and the size of each frame of the simulated infrared small target image is 256 multiplied by 256.
The effect of the present invention will be further described with reference to simulation experiments.
1. Simulation conditions are as follows:
the running system of the simulation experiment is an Intel (R) Core (TM) i3-4130@3.20GHz and 32-bit Windows operating system, and MATLAB R2012a software is adopted as simulation software.
2. The experimental contents are as follows:
in order to verify the effectiveness of the infrared dim target image sequence simulation method based on the mean value model, an original infrared image background with the total frame number of 226 frames of an original infrared image background sequence is selected for carrying out a simulation experiment.
As shown in fig. 3, the size of the original infrared image background is 480 × 625 pixels, a simulated infrared weak small target image background of 256 × 256 pixels is intercepted from the 150 th row and 150 th column of the original infrared image background to the lower right of the original infrared image background, and the size of the infrared weak small target is set to 3 × 3 pixels; the horizontal movement speed of the infrared small and weak target is set to be 1 pixel/frame, and the signal-to-noise ratio of the infrared small and weak target is set to be 6; the motion horizontal starting point of the infrared dim target is set to be 30, and the track of the infrared dim target is a straight line model. Fig. 5 shows a simulated infrared weak and small target image.
Comparing fig. 3 and fig. 5, it can be seen that the invention effectively realizes the generation simulation of the infrared dim target image, and provides a large number of testable infrared dim target image sequences for the subsequent research of the detection and tracking algorithm of the infrared dim target.
In conclusion, the infrared weak and small target image sequence generated by the method provided by the invention has the advantages of being closer to a real infrared scene, controllable in infrared weak and small target parameters and the like. Therefore, the method has wide engineering application value.