Smooth processing method of infrared fan-scan image strip frame
Through the adaptive grayscale mapping method, the splitting phenomenon between infrared fan-swept images is processed, which realizes smoothing between frames and maintains contrast, and improves the visual effect of the image.
Patent Information
- Application Number
- CN202411687681.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-25
AI Technical Summary
There is a sense of splitting between infrared fan-swept images. The prior art reduces inhomogeneity through overall grayscale normalization processing, but it will lead to a decrease in contrast and affect target recognition.
Adaptive grayscale mapping method is adopted, by extracting the low threshold and high threshold grayscale of each frame image, calculating the histogram mapping table, and adaptive grayscale mapping and fusion of overlapping areas of adjacent frame images, realizing smoothing processing between frames.
While ensuring image contrast, adaptive smoothing between frames is realized, the visual effect of infrared fan-swept image strips is improved, and the details of the scene are preserved.
Smart Images

Figure CN119693262A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image data processing, and in particular relates to a smoothing method between infrared fan-scanned image frames. Background Art
[0002] In the infrared fan-scan device, the final infrared fan-scan image is a strip image formed by horizontally splicing frame by frame, such as Figure 1 shown.
[0003] Due to the aberration, vignetting effect, and uneven response of the imaging device itself, there is a certain degree of non-uniformity in the pixels at different positions in each frame of the image, which leads to a certain degree of fragmentation in the images before and after the stitching area of adjacent images. Figure 2 shown.
[0004] In order to eliminate this phenomenon, the strip image composed of several frames is generally normalized to reduce the non-uniformity between adjacent frame images. However, this method usually reduces the contrast of the image and the probability of small targets being discovered in the image, which can easily cause misjudgment by observers. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide an infrared sector-scan image inter-frame smoothing method based on adaptive grayscale mapping to solve the image segmentation problem in the overlapping area between adjacent image frames of the infrared sector-scan image strips.
[0006] In order to achieve the above-mentioned purpose, the technical solution adopted by the present invention to solve the technical problem is: a method for smoothing an infrared fan-scanned image strip frame, comprising the following steps: S1, intercept an infrared fan-scan strip from the video stream and extract N grayscale video frames with a pixel size of m×n; S2, extracting the low threshold grayscale and high threshold grayscale of each image frame; S3, extract the minimum value of all low threshold grayscales of N frames of images, record it as the global low threshold grayscale min_pixel, extract the maximum value of all high threshold grayscales of N frames of images, record it as the global high threshold grayscale max_pixel; S4, extract the left image k_left and the right image k_right of the k-th image, 0<k<n; S5, respectively calculating the grayscale cumulative histograms of the left image k_left and the right image k_right; S6, calculating a histogram mapping table of the k-th image; S7, performing grayscale mapping on the left quarter area img_left of the k+1th image according to the histogram mapping table; S8, adaptively fuse the left quarter area img_left with the k+1 images; S9, horizontally splicing each processed image frame.
[0007] Furthermore, in step S2, the pixel value at the 2% position in the grayscale value of each image frame is extracted and recorded as the low threshold grayscale, and the pixel value at the 98% position in the grayscale value of each image frame is extracted and recorded as the high threshold grayscale.
[0008] Furthermore, in step S4, the leftmost 10 columns of pixel images of the k-th image are recorded as k_left, and the rightmost 10 columns of pixel images are recorded as k_right, so that two images of size m×10 are obtained.
[0009] Furthermore, in the step S5, a list histogram containing 255 elements is first created as a grayscale histogram, and the value of each element is 0, that is, the grayscale histogram histogram=[0]*256 is initialized, and each pixel in the left image k_left and the right image k_right is cyclically counted, and the number of occurrences of each gray value gray_value histogram[gray_value] is calculated, and then the grayscale cumulative histogram cumulative_histogram is initialized by the following formula: cumulative_histogram[0]=histogram[0], Then, the following formula is used to perform circular statistics on cumulative_histogram[i]: cumulative_histogram[i]=cumulative_histogram[i-1]+histogram[i], After the loop statistics are completed, the grayscale cumulative histogram of the left image k_left is output: cumsum_left k =cumulative_histogram, Or the grayscale cumulative histogram of the right image k_right: cumsum_right k =cumulative_histogram, Where i is the pixel grayscale value, ranging from 0 to 25.
[0010] Furthermore, in step S6, the histogram mapping table is first initialized, and then g=0 is initialized, where g is the pixel grayscale value, ranging from 0 to 25, and then a loop statistics is entered to traverse the variable i from 0 to 255, and a judgment is performed in each loop statistics: when g is less than 255 and cumsum_left k [i] greater than cumsum_right k+1 [g], execute the operation g=g+1, assign the value of g to mapping[i] in each loop statistics, and output the histogram mapping table after the loop statistics are completed.
[0011] Furthermore, in the step S8, the pixel value i corresponding to the left quarter of the k+1th image is first assigned to mapping[i] by referring to the histogram mapping table, and the converted image img_left is fused with the k+1th image with adaptive weights, and then an outer loop statistics is entered to traverse the variable col from 0 to n / 4-1. In each outer loop statistics, the formula x=col / 128 is executed. In each outer loop statistics, an inner loop statistics is performed to traverse the variable row from 0 to m~1; in each inner loop statistics, the following formula is executed: pa = img[row,col] pb = img_left[row,col] img2[row,col]=x*pa+(1-x)*pb.
[0012] Finally, mg_left is adaptively fused with k+1 images.
[0013] The beneficial effects of the present invention are as follows: the present invention introduces an adaptive weighted grayscale mapping method, and by performing an adaptive grayscale mapping method on a local image, the overlapping area of two adjacent frames of images is adaptively smoothed, while the contrast of other frames of images is not affected, thereby improving the visual effect of infrared fan-scanned image strips. Compared with the existing method, the present method adaptively smoothes the strip frames while ensuring the image contrast, so that the strip image has a higher contrast, retains the details of the scene, and has a better visual effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is an infrared fan-scan strip diagram presented by existing infrared fan-scan equipment; Figure 2 It is a strip diagram of the inter-frame splitting phenomenon presented by the existing infrared fan scanning equipment; Figure 3 It is a schematic diagram of a single infrared fan-scanned video frame of the present invention; Figure 4 It is a strip chart after smoothing by the method of the present invention. DETAILED DESCRIPTION
[0015] The present invention is further described below with reference to the accompanying drawings and embodiments.
[0016] The invention discloses a method for smoothing infrared fan-scan image strips between frames based on adaptive grayscale mapping, which comprises the following steps.
[0017] (1) Extract N infrared fan-scan video frames. Extract N grayscale video frames corresponding to a fan-scan strip from the video stream. The pixel size of each image is m×n. A single infrared fan-scan video frame is as follows: Figure 3 shown.
[0018] (2) Extract the low threshold grayscale and high threshold grayscale of each image frame. Extract the pixel values at the 2% and 98% positions in the grayscale value of each image frame and record them as the low threshold grayscale and high threshold grayscale of each frame.
[0019] (3) Extract the global low threshold grayscale and the global high threshold grayscale. Extract the minimum value of all low threshold grayscales of N frames of images, recorded as the global low threshold grayscale min_pixel, and extract the maximum value of all high threshold grayscales of N frames of images, recorded as the global high threshold grayscale max_pixel.
[0020] (4) Extract the left image k_left and the right image k_right of the kth image. Segment the kth (0<k<n) image, and record the leftmost 10 columns of pixel images as k_left and the rightmost 10 columns of pixel images as k_right. The size of these two images is m×10.
[0021] (5) Calculate the grayscale cumulative histograms of the left image k_left and the right image k_right respectively.
[0022] (51) Create a list histogram containing 255 elements as the grayscale histogram, and the value of each element is 0, that is, initialize the grayscale histogram histogram=[0]*256.
[0023] (52) Perform circular statistics on each pixel in the left image k_left and the right image k_right, and calculate the number of occurrences of each gray value gray_value histogram[gray_value].
[0024] (53) Initialize the grayscale cumulative histogram cumulative_histogram=[0]*256.
[0025] (54) cumulative_histogram[0]=histogram[0].
[0026] (55) Perform cyclic statistics on cumulative_histogram[i]: Execute each cyclic statistics cumulative_histogram[i]=cumulative_histogram[i-1]+histogram[i].
[0027] (56) After the circular statistics are completed, the grayscale cumulative histogram of the left image k_left is output: cumsum_left k =cumulative_histogram, or the grayscale cumulative histogram of the right image k_right: cumsum_right k =cumulative_histogram.
[0028] (6) Calculate the histogram mapping table of the kth image.
[0029] (61) Initialize the histogram mapping table mapping=[0]*256.
[0030] (62) Initialize g=0, i and g are both pixel grayscale values, ranging from 0 to 25.
[0031] (63) Enter a loop counting, traversing the variable i from 0 to 255.
[0032] (64) In each loop, a judgment is performed. The judgment condition is: when g is less than 255 and cumsum_left k [i] greater than cumsum_right k+1 [g], execute the operation: g=g+1.
[0033] (65) In each loop count, the value of g is assigned to mapping[i].
[0034] (66) After the loop statistics are completed, the output mapping is a histogram mapping table.
[0035] (7) Perform grayscale mapping on the left quarter of the k+1th image according to the histogram mapping table.
[0036] (71) According to the histogram mapping table, the corresponding pixel value i in the left quarter of the k+1th image is assigned to mapping[i], and the converted image is recorded as img_left.
[0037] (72) The image img_left is fused with the k+1th image using adaptive weights.
[0038] (73) Enter an outer loop counting, traversing the variable col from 0 to n / 4-1.
[0039] (74) In each outer loop count, execute the formula x = col / 128.
[0040] (75) In each outer loop count, an inner loop count is performed, traversing the variable row from 0 to m~1.
[0041] (76) In each internal loop statistics, the following formula is executed: pa = img[row, col], pb = img_left[row,col], img2[row,col]=x*pa+(1-x)*pb.
[0042] (8) Adaptively fuse img_left with k+1 images.
[0043] (9) Each processed image frame is horizontally spliced, and the result is the infrared fan-scan strip image after smoothing, as shown in Figure 4 shown.
[0044] The above embodiments are only illustrative of the principles and effects of the present invention, as well as some embodiments of its application. For those skilled in the art, several modifications and improvements may be made without departing from the creative concept of the present invention, and all of these belong to the protection scope of the present invention.
Claims
1. A method for smoothing infrared fan-scanned image strip frames, characterized in that: The following steps are included S1, intercept an infrared fan-scan strip from the video stream and extract N grayscale video frames with a pixel size of m×n; S2, extracting the low threshold grayscale and high threshold grayscale of each image frame; S3, extract the minimum value of all low threshold grayscales of N frames of images, record it as the global low threshold grayscale min_pixel, extract the maximum value of all high threshold grayscales of N frames of images, record it as the global high threshold grayscale max_pixel; S4, extract the left image k_left and the right image k_right of the k-th image, 0<k<n; S5, respectively calculating the grayscale cumulative histograms of the left image k_left and the right image k_right; S6, calculating a histogram mapping table of the k-th image; S7, performing grayscale mapping on the left quarter area img_left of the k+1th image according to the histogram mapping table; S8, adaptively fuse the left quarter area img_left with the k+1 images; S9, horizontally splicing each processed image frame.
2. The method for smoothing an infrared fan-scanned image strip frame according to claim 1, characterized in that: In the step S2, the pixel value at the 2% position in the grayscale value of each image frame is extracted and recorded as the low threshold grayscale, and the pixel value at the 98% position in the grayscale value of each image frame is extracted and recorded as the high threshold grayscale.
3. The method for smoothing infrared fan-scanned image strip frames according to claim 2, characterized in that: In the step S4, the leftmost 10 columns of pixel images of the kth image are recorded as k_left, and the rightmost 10 columns of pixel images are recorded as k_right, so that two images of size m×10 are obtained.
4. The method for smoothing infrared fan-scanned image strip frames according to claim 3, characterized in that: In step S5, the grayscale histogram histogram is first initialized, and circular statistics are performed on each pixel in the left image k_left and the right image k_right. Then, the grayscale cumulative histogram is initialized by the formula cumulative_histogram[0]=histogram[0], and then circular statistics are performed on cumulative_histogram[i] by the following row formula: cumulative_histogram[i]=cumulative_histogram[i-1]+histogram[i], After the loop statistics are completed, the grayscale cumulative histogram of the left image k_left is output: cumsum_left k =cumulative_histogram, Or the grayscale cumulative histogram of the right image k_right: cumsum_right k =cumulative_histogram, Where i is the pixel grayscale value, ranging from 0 to 25.
5. The method for smoothing infrared fan-scanned image strip frames according to claim 4, characterized in that: In step S6, the histogram mapping table is initialized first, and then g=0 is initialized, where g is the pixel grayscale value, ranging from 0 to 25, and then a loop statistics is entered to traverse the variable i from 0 to 255. A judgment is performed in each loop statistics: when g is less than 255 and cumsum_left k [i] greater than cumsum_right k+1 [g], execute the operation g=g+1, assign the value of g to mapping[i] in each loop statistics, and output the histogram mapping table after the loop statistics are completed.
6. The method for smoothing infrared fan-scanned image strip frames according to claim 5, characterized in that: In the step S8, the pixel value i corresponding to the left quarter of the k+1th image is first assigned to mapping[i] by referring to the histogram mapping table, and the converted image img_left is fused with the k+1th image with adaptive weights, and then an outer loop statistics is entered to traverse the variable col from 0 to n / 4-1. In each outer loop statistics, the formula x=col / 128 is executed. In each outer loop statistics, an inner loop statistics is performed to traverse the variable row from 0 to m~1; in each inner loop statistics, the following formula is executed: pa = img[row,col], pb = img_left[row,col], img2[row,col]=x*pa+(1-x)*pb, Finally, mg_left is adaptively fused with k+1 images.