A scene-based non-uniformity correction method
By combining frame importance scoring and online averaging with differential region analysis and dynamically adjusting correction parameters, the problems of high computational resource consumption and redundant processing in existing technologies are solved, and efficient image sequence non-uniformity correction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 南京海汇装备科技有限公司
- Filing Date
- 2025-06-30
- Publication Date
- 2026-06-09
AI Technical Summary
Existing scene-based nonuniformity correction methods consume large amounts of computational resources, have poor real-time performance, and fail to effectively handle dynamic scene changes when processing image sequences, leading to increased redundant computation and storage overhead.
Key frames and non-key frames are identified by frame importance scoring. Only key frames are processed and online averaging is performed. Combined with difference region analysis and local update algorithm, correction parameters are dynamically adjusted and redundant data is removed.
It effectively reduces data storage and computing resource consumption, improves processing efficiency, adapts to real-time scenario requirements, and provides higher precision non-uniformity correction.
Smart Images

Figure CN120782686B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to a scene-based non-uniformity correction method. Background Technology
[0002] With the rapid development of computer vision technology, non-uniformity correction in image processing has become one of the key technologies for improving image quality. In practical applications, due to factors such as sensor performance inhomogeneity, changes in ambient lighting, and object motion, image sequences often exhibit inconsistencies in brightness, contrast, and other aspects, affecting the accuracy of subsequent analysis and applications. Therefore, non-uniformity correction technology is widely used in the field of image processing, such as image enhancement in low-light environments and target recognition and tracking in video surveillance.
[0003] Currently, scene-based non-uniformity correction methods primarily analyze and model large numbers of consecutive image frames to correct non-uniformity in image sequences. These methods estimate and correct errors caused by uneven sensor responses by calculating features such as average brightness and contrast over a period of time. Traditional methods typically rely on long image sequences to calculate average values in order to obtain more accurate correction results. However, as the length of the image sequence increases, the consumption of data storage and computing resources increases significantly, severely limiting real-time performance. Furthermore, traditional methods process all frames indiscriminately, failing to consider the dynamic characteristics of scenes within the image. In scenes with significant dynamic changes, processing redundant frames does not effectively improve the correction; instead, it increases the overhead of ineffective computation and reduces correction efficiency. Summary of the Invention
[0004] The purpose of this invention is to provide a scene-based non-uniformity correction method to solve the problems mentioned in the background art.
[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0006] A scene-based non-uniformity correction method includes the following steps:
[0007] Step S100. Acquire a continuous image sequence from the night vision system, perform difference analysis on two adjacent frames to extract the difference region; extract the information entropy of each frame and combine it with the area of the difference region to evaluate the frame importance score;
[0008] Step S200. Based on frame importance scoring, identify key frames in the image sequence and mark key frames and non-key frames in the image sequence respectively; store key frames in their entirety, and retain only the pixel coordinates and grayscale values of the difference areas of non-key frames, and establish an index table to record the mapping relationship between key frames and non-key frames.
[0009] Step S300. Summarize the keyframes in the image sequence and generate a keyframe set; perform online averaging on all keyframes to generate initial non-uniformity correction parameters, and dynamically adjust the averaging termination condition according to the convergence of the standard deviation of the keyframes.
[0010] Step S400. Extract the pixel coordinates and grayscale values of the difference regions in non-key frames, and update the local average value of the pixels in the difference regions in combination with the initial non-uniformity correction parameters; analyze the statistical characteristics of the difference regions, evaluate the impact of the difference regions on the correction, and make corresponding optimization adjustments.
[0011] Step S500. Obtain the real-time image sequence. When a new keyframe is added, extract the coverage area of the difference region of the old keyframe. If the difference region of the new keyframe completely includes the difference region of the old keyframe, mark the old keyframe as redundant data and delete its associated non-keyframe compressed data.
[0012] Furthermore, step S100 includes:
[0013] S101. Obtain a continuous image sequence from the night vision system, represented as: {I1,I2,...,I...} n}, where I1 represents the first frame of the image sequence, I2 represents the second frame of the image sequence, and so on, I n Let I represent a frame image in an image sequence, where n represents the number of frames in the image sequence; for two adjacent frames in the image sequence... t and I t+1 Perform difference analysis to obtain the difference map D between adjacent frames. t+1 And D t+1 =|I t+1 -I t |, where D t+1 Indicates two adjacent frames I t and I t+1 The magnitude of change of each pixel over time;
[0014] S102. For the difference map D between adjacent frames t+1 Obtain the difference value |I for each pixel. t+1 (i,j)-I t (i,j)|, compare the difference value of each pixel with the difference threshold T; if |I t+1 (i,j)-I t If (i,j)|>T, it means that this pixel belongs to the difference region, and is labeled as D. t+1 (i,j)=1; if |I t+1 (i,j)-I t If (i,j)|≤T, it means that this pixel belongs to the indifferent region, and is labeled as D.t+1 (i,j)=0; where i and j represent the pixel positions in the image, D t+1 (i,j) represents the difference marker of the i-th and j-th pixels in the difference map of frame t+1; based on the difference region markers, summarize D t+1 Pixels with (i,j) = 1 are used to extract the difference region;
[0015] S103. Calculate the information entropy for each frame of the image, and the corresponding information entropy is defined as: Where p(h) represents image I t The probability of a gray value h is given by L, where L is the number of gray levels in the image. The probability distribution p(h) is obtained by statistically analyzing the gray-level histogram of the image. The higher the information entropy value, the more uniform the information distribution in the image, and the more complex the image. The importance of each frame is evaluated by combining image difference and information entropy, thereby calculating the corresponding frame importance score S. t And the specific calculation formula is: S t =α×(A diff / A total )+β×[H(I t ) / H max ], where A diff A represents the number of difference region markers in the t-th frame of the image. total H represents the total number of pixels in the t-th frame of the image; max This represents the maximum information entropy; for example, when the image has 256 gray levels, the maximum information entropy is log2256. α and β are weighting coefficients, and α + β = 1. These are adjusted according to the application scenario; for example, α = 0.6 and β = 0.4.
[0016] Furthermore, step S200 includes:
[0017] S201. Based on the formula for calculating frame importance score, calculate the frame importance score of each image in the image sequence. Arrange the frame importance scores of each image in descending order, select the first m images and mark them as keyframes, and mark the rest as non-keyframes. Store the keyframes in their entirety, saving all pixel data of the keyframes, represented as I. key ;
[0018] S202. For non-keyframes, extract the difference regions from the non-keyframes, and store the pixel coordinates and grayscale values of the difference regions in the non-keyframes, represented as: R non-key And R non-key There are several data groups, and each data group is represented as: [(i m ,j m ),I non-key (i m ,j m )], where, (im ,j m ) represents the coordinates of the m-th pixel in the difference region, I non-key (i m ,j m ) represents the grayscale value of the m-th pixel; based on the temporal order of keyframes and non-keyframes, an index table is established to record the mapping relationship between keyframes and non-keyframes.
[0019] Furthermore, based on the temporal order of keyframes and non-keyframes, an index table is established to record the mapping relationship between keyframes and non-keyframes. Specific content includes:
[0020] The index table records data in chronological order and includes frame number, frame type, pixel data, and difference region data. The frame type is either a keyframe or a non-keyframe. Pixel data corresponds to keyframes, and difference region data corresponds to non-keyframes. The difference region data includes the pixel coordinates and grayscale values of the difference regions within the non-keyframes. The index format for keyframes is (N, Z, I). key The index format for non-keyframes is: (N, Z, R) non-key ), where N represents the frame number and Z represents the frame type.
[0021] Furthermore, step S300 includes:
[0022] S301. Based on the frame type in the index table, summarize the keyframes in the image sequence to generate a keyframe set K, where K = {k1, k2, ..., kv}, where k1 represents the first keyframe in the image sequence, k2 represents the second keyframe in the image sequence, and so on, kv represents the vth keyframe in the image sequence, and v represents the number of keyframes in the image sequence.
[0023] S302. For the first keyframe k1 in the keyframe set K, transfer the pixel data I of keyframe k1. key1 As the initial average image A1, for each subsequent keyframe kf, where f ranges from 2 to v; the corresponding average image A is calculated using the update formula. f And A f =[(f-1)·A f-1 +I keyf ] / f, where A f A represents the average image up to the f-th keyframe. f-1 I represents the average image of the previous keyframe. keyfThis represents the pixel data of the current f-th keyframe. The corresponding update process is as follows: each time, the pixel data of the new keyframe is added to the current average image. The formula calculates the new average image based on the image data of the current keyframe and the weighted value of the previous average image. As the number of keyframes f increases, the average image gradually integrates the information of all previous keyframes. This online update method does not need to save all keyframe data, but gradually generates a comprehensive average image, which is suitable for processing real-time data streams or large-scale data. Through this online averaging calculation, an average image representing the comprehensive performance of all keyframes is obtained. This process can effectively extract the overall features of the keyframe set without processing all keyframes at once. Calculate the difference image Δf between each keyframe and its corresponding average image, and Δf = I. keyf -A f Based on the difference images of each keyframe, calculate the corresponding standard deviation of difference σf, and sum the average of the standard deviations of difference of all keyframes as the initial correction parameter C. init ;
[0024] S303. Obtain the difference standard deviation sequence of keyframes, and determine whether the difference standard deviation sequence has converged. The convergence judgment condition is: |σf-σ(f-1)|<∈, where ∈ represents a preset convergence threshold, indicating that when the difference between two standard deviation changes is less than this value, the difference standard deviation sequence is considered to have converged. Dynamically adjust the averaging termination condition based on the convergence of the difference standard deviation sequence of keyframes. When the standard deviation change of all keyframes is less than ∈, the averaging calculation is considered to have converged and can be terminated; otherwise, continue the online averaging calculation until the convergence condition is met. Whenever the standard deviation converges, update the non-uniformity correction parameter C according to the new standard deviation value. final .
[0025] Instead of calculating the average of all keyframes at once, the average image is updated incrementally, reducing memory overhead and improving real-time processing efficiency. By dynamically adjusting the calculation termination condition based on whether the standard deviation sequence converges, calculations are stopped at appropriate times, avoiding unnecessary computational overhead and improving computational efficiency and accuracy. As the standard deviation convergence is determined, the non-uniformity correction parameters are updated promptly, further improving image quality and resulting in more accurate and stable processing results.
[0026] Furthermore, step S400 includes:
[0027] S401. Based on the frame type in the index table, obtain the pixel coordinates and grayscale values of the difference regions in the non-key frames of the image sequence, and combine them with the initial non-uniformity correction parameter C. init For each pixel in the difference region of non-keyframes, a local average value is updated, and the corresponding calculation formula is:
[0028] I update (i m ,j m )=γ·I non-key (i m ,j m )+(1-γ)·(1 / N neighbor )Σ (ir,jr)∈N(im,jm) I non-key (i r ,j r );
[0029] Among them, I update (i m ,j m ) represents the updated grayscale value of the pixel in the difference region, I non-key (i m ,j m ) represents the grayscale value of the pixel in the difference region of the current non-keyframe, N(i m ,j m ) represents a pixel (i m ,j m The set of neighboring pixels of ), N neighbor This represents the number of pixels in the neighborhood, and γ represents the weighting coefficient, which controls the balance between the current pixel value and the average value of the neighboring pixels.
[0030] S402. When updating each pixel in the difference region, analyze the statistical characteristics of the difference region, including the local mean μ_local and the local standard deviation σ_local for each difference region; based on the local mean μ_local and the local standard deviation σ_local for each difference region, calculate the corresponding influence factor, and the formula for calculating the influence factor is:
[0031] g=1+λ·(q_local-q_target);
[0032] Where g represents the influence factor of the local mean or local standard deviation, λ represents a constant, q_local represents the local mean or local standard deviation of the region of difference, and q_target represents the desired target mean or target standard deviation; for each region of difference, the influence factors of the corresponding local mean and local standard deviation are obtained, denoted as g_μ and g_σ respectively, and the comprehensive correction factor γ is calculated. adjusted , and γ adjusted =g_μ×g_σ; based on the comprehensive correction factor γ adjusted The pixel grayscale values in the difference regions are optimized and adjusted accordingly, and the adjusted pixel values are represented as I. corrected (i m ,j m ), and the corresponding calculation formula is: I corrected (im ,j m ) = I update (i m ,j m )×γ adjusted .
[0033] Furthermore, step S500 includes:
[0034] A real-time image sequence is acquired, and the sequence is analyzed according to steps S100 and S200 to identify new keyframes. The difference regions in the new keyframes are extracted, and the coverage area of the difference region of the old keyframe closest to the time point corresponding to the new keyframe is extracted from the index table. It is determined whether the difference region of the new keyframe completely includes the difference region of the old keyframe. If the difference region of the new keyframe completely includes the difference region of the old keyframe, the old keyframe is marked as redundant data. Otherwise, the pixel data of the new keyframe is merged into the index table. Based on the redundancy marking, all non-keyframe data associated with the old keyframe is identified, and all non-keyframe data associated with the old keyframe is deleted.
[0035] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention effectively reduces the number of image frames that need to be processed through frame importance scoring and keyframe selection mechanisms; by processing only important keyframes and extracting only difference region data from non-keyframes, it significantly reduces the consumption of data storage and computing resources, thereby improving processing efficiency and adapting to the needs of real-time application scenarios. This invention avoids the redundant computation and storage overhead caused by indiscriminate processing of all image frames in traditional methods by dynamically identifying and deleting redundant keyframe data; by deleting redundant keyframe data containing completely covered difference regions, it saves storage space and computing resources. This invention combines image difference analysis, information entropy calculation, and local update algorithms to more accurately correct errors caused by sensor non-uniformity; during the local update process of non-keyframes, it considers the statistical characteristics of each difference region (such as local mean and local standard deviation), and optimizes the correction effect by adjusting influencing factors, thereby providing higher precision non-uniformity correction. This invention uses an online averaging calculation method instead of storing all keyframe image data at once; it retains only the pixel data of keyframes each time, and by gradually updating the average image, it effectively reduces memory usage and reduces data storage and processing time latency. Attached Figure Description
[0036] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0037] Figure 1 This is a schematic diagram of the steps of a scene-based non-uniformity correction method according to the present invention. Detailed Implementation
[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] Please see Figure 1 The present invention provides the following technical solution:
[0040] A scene-based non-uniformity correction method includes the following steps:
[0041] Step S100. Acquire a continuous image sequence from the night vision system, perform difference analysis on two adjacent frames to extract the difference region; extract the information entropy of each frame and combine it with the area of the difference region to evaluate the frame importance score;
[0042] Step S200. Based on frame importance scoring, identify key frames in the image sequence and mark key frames and non-key frames in the image sequence respectively; store key frames in their entirety, and retain only the pixel coordinates and grayscale values of the difference areas of non-key frames, and establish an index table to record the mapping relationship between key frames and non-key frames.
[0043] Step S300. Summarize the keyframes in the image sequence and generate a keyframe set; perform online averaging on all keyframes to generate initial non-uniformity correction parameters, and dynamically adjust the averaging termination condition according to the convergence of the standard deviation of the keyframes.
[0044] Step S400. Extract the pixel coordinates and grayscale values of the difference regions in non-key frames, and update the local average value of the pixels in the difference regions in combination with the initial non-uniformity correction parameters; analyze the statistical characteristics of the difference regions, evaluate the impact of the difference regions on the correction, and make corresponding optimization adjustments.
[0045] Step S500. Obtain the real-time image sequence. When a new keyframe is added, extract the coverage area of the difference region of the old keyframe. If the difference region of the new keyframe completely includes the difference region of the old keyframe, mark the old keyframe as redundant data and delete its associated non-keyframe compressed data.
[0046] Step S100 includes:
[0047] S101. Obtain a continuous image sequence from the night vision system, represented as: {I1,I2,...,I...} n}, where I1 represents the first frame of the image sequence, I2 represents the second frame of the image sequence, and so on, In Let I represent a frame image in an image sequence, where n represents the number of frames in the image sequence; for two adjacent frames in the image sequence... t and I t+1 Perform difference analysis to obtain the difference map D between adjacent frames. t+1 And D t+1 =|I t+1 -I t |, where D t+1 Indicates two adjacent frames I t and I t+1 The magnitude of change of each pixel over time;
[0048] S102. For the difference map D between adjacent frames t+1 Obtain the difference value |I for each pixel. t+1 (i,j)-I t (i,j)|, compare the difference value of each pixel with the difference threshold T; if |I t+1 (i,j)-I t If (i,j)|>T, it means that this pixel belongs to the difference region, and is labeled as D. t+1 (i,j)=1; if |I t+1 (i,j)-I t If (i,j)|≤T, it means that this pixel belongs to the indifferent region, and is labeled as D. t+1 (i,j)=0; where i and j represent the pixel positions in the image, D t+1 (i,j) represents the difference marker of the i-th and j-th pixels in the difference map of frame t+1; based on the difference region markers, summarize D t+1 Pixels with (i,j) = 1 are used to extract the difference region;
[0049] S103. Calculate the information entropy for each frame of the image, and the corresponding information entropy is defined as: Where p(h) represents image I t The probability of a gray value h is given by L, where L is the number of gray levels in the image. The probability distribution p(h) is obtained by statistically analyzing the gray-level histogram of the image. The higher the information entropy value, the more uniform the information distribution in the image, and the more complex the image. The importance of each frame is evaluated by combining image difference and information entropy, thereby calculating the corresponding frame importance score S. t And the specific calculation formula is: S t =α×(A diff / A total )+β×[H(I t ) / H max ], where A diff A represents the number of difference region markers in the t-th frame of the image. totalH represents the total number of pixels in the t-th frame of the image; max This represents the maximum information entropy; for example, when the image has 256 gray levels, the maximum information entropy is log2256. α and β are weighting coefficients, and α + β = 1. These are adjusted according to the application scenario; for example, α = 0.6, β = 0.4.
[0050] In this embodiment, it is assumed that there are two images I t and I t+1 Their size is 3×3, that is, M=N=3, the image gray level is 0 to 255, the difference threshold T=10, the weight coefficient α=0.6, β=0.4.
[0051] Assume the number of pixels in the difference region is A diff =1, total number of pixels A total =9, assuming the probability distribution of grayscale values is:
[0052] p(100)=1 / 9, p(110)=1 / 9, p(120)=1 / 9, p(130)=1 / 9, p(140)=1 / 9, p(150)=1 / 9, p(160)=1 / 9, p(170)=1 / 9, p(180)=1 / 9;
[0053] Information entropy is calculated as follows: Maximum information entropy H max =log2256=8;
[0054] The frame importance score S is calculated according to the formula. t :
[0055] S t =0.6×(1 / 9)+0.4×log29≈0.2252.
[0056] Step S200 includes:
[0057] S201. Based on the formula for calculating frame importance score, calculate the frame importance score of each image in the image sequence. Arrange the frame importance scores of each image in descending order, select the first m images and mark them as keyframes, and mark the rest as non-keyframes. Store the keyframes in their entirety, saving all pixel data of the keyframes, represented as I. key ;
[0058] S202. For non-keyframes, extract the difference regions from the non-keyframes, and store the pixel coordinates and grayscale values of the difference regions in the non-keyframes, represented as: R non-key And R non-key There are several data groups, and each data group is represented as: [(i m ,j m ),Inon-key (i m ,j m )], where, (i m ,j m ) represents the coordinates of the m-th pixel in the difference region, I non-key (i m ,j m ) represents the grayscale value of the m-th pixel; based on the temporal order of keyframes and non-keyframes, an index table is established to record the mapping relationship between keyframes and non-keyframes.
[0059] Based on the chronological order of keyframes and non-keyframes, an index table is established to record the mapping relationship between keyframes and non-keyframes. Specific content includes:
[0060] The index table records data in chronological order and includes frame number, frame type, pixel data, and difference region data. The frame type is either a keyframe or a non-keyframe. Pixel data corresponds to keyframes, and difference region data corresponds to non-keyframes. The difference region data includes the pixel coordinates and grayscale values of the difference regions within the non-keyframes. The index format for keyframes is (N, Z, I). key The index format for non-keyframes is: (N, Z, R) non-key ), where N represents the frame number and Z represents the frame type.
[0061] Step S300 includes:
[0062] S301. Based on the frame type in the index table, summarize the keyframes in the image sequence to generate a keyframe set K, where K = {k1, k2, ..., kv}, where k1 represents the first keyframe in the image sequence, k2 represents the second keyframe in the image sequence, and so on, kv represents the vth keyframe in the image sequence, and v represents the number of keyframes in the image sequence.
[0063] S302. For the first keyframe k1 in the keyframe set K, transfer the pixel data I of keyframe k1. key1 As the initial average image A1, for each subsequent keyframe kf, where f ranges from 2 to v; the corresponding average image A is calculated using the update formula. f And A f =[(f-1)·A f-1 +I keyf ] / f, where A f A represents the average image up to the f-th keyframe. f-1 I represents the average image of the previous keyframe. keyfThis represents the pixel data of the current f-th keyframe. The corresponding update process is as follows: each time, the pixel data of the new keyframe is added to the current average image. The formula calculates the new average image based on the image data of the current keyframe and the weighted value of the previous average image. As the number of keyframes f increases, the average image gradually integrates the information of all previous keyframes. This online update method does not need to save all keyframe data, but gradually generates a comprehensive average image, which is suitable for processing real-time data streams or large-scale data. Through this online averaging calculation, an average image representing the comprehensive performance of all keyframes is obtained. This process can effectively extract the overall features of the keyframe set without processing all keyframes at once. Calculate the difference image Δf between each keyframe and its corresponding average image, and Δf = I. keyf -A f Based on the difference images of each keyframe, calculate the corresponding standard deviation of difference σf, and sum the average of the standard deviations of difference of all keyframes as the initial correction parameter C. init ;
[0064] S303. Obtain the difference standard deviation sequence of keyframes, and determine whether the difference standard deviation sequence has converged. The convergence judgment condition is: |σf-σ(f-1)|<∈, where ∈ represents a preset convergence threshold, indicating that when the difference between two standard deviation changes is less than this value, the difference standard deviation sequence is considered to have converged. Dynamically adjust the averaging termination condition based on the convergence of the difference standard deviation sequence of keyframes. When the standard deviation change of all keyframes is less than ∈, the averaging calculation is considered to have converged and can be terminated; otherwise, continue the online averaging calculation until the convergence condition is met. Whenever the standard deviation converges, update the non-uniformity correction parameter C according to the new standard deviation value. final .
[0065] Instead of calculating the average of all keyframes at once, the average image is updated incrementally, reducing memory overhead and improving real-time processing efficiency. By dynamically adjusting the calculation termination condition based on whether the standard deviation sequence converges, calculations are stopped at appropriate times, avoiding unnecessary computational overhead and improving computational efficiency and accuracy. As the standard deviation convergence is determined, the non-uniformity correction parameters are updated promptly, further improving image quality and resulting in more accurate and stable processing results.
[0066] Step S400 includes:
[0067] S401. Based on the frame type in the index table, obtain the pixel coordinates and grayscale values of the difference regions in the non-key frames of the image sequence, and combine them with the initial non-uniformity correction parameter C. init For each pixel in the difference region of non-keyframes, a local average value is updated, and the corresponding calculation formula is:
[0068] I update (i m ,j m )=γ·I non-key (i m ,j m )+(1-γ)·(1 / N neighbor )Σ (ir,jr)∈N(im,jm) I non-key (i r ,j r );
[0069] Among them, I update (i m ,j m ) represents the updated grayscale value of the pixel in the difference region, I non-key (i m ,j m ) represents the grayscale value of the pixel in the difference region of the current non-keyframe, N(i m ,j m ) represents a pixel (i m ,j m The set of neighboring pixels of ), N neighbor This represents the number of pixels in the neighborhood, and γ represents the weighting coefficient, which controls the balance between the current pixel value and the average value of the neighboring pixels.
[0070] S402. When updating each pixel in the difference region, analyze the statistical characteristics of the difference region, including the local mean μ_local and the local standard deviation σ_local for each difference region; based on the local mean μ_local and the local standard deviation σ_local for each difference region, calculate the corresponding influence factor, and the formula for calculating the influence factor is:
[0071] g=1+λ·(q_local-q_target);
[0072] Where g represents the influence factor of the local mean or local standard deviation, λ represents a constant, q_local represents the local mean or local standard deviation of the region of difference, and q_target represents the desired target mean or target standard deviation; for each region of difference, the influence factors of the corresponding local mean and local standard deviation are obtained, denoted as g_μ and g_σ respectively, and the comprehensive correction factor γ is calculated. adjusted , and γ adjusted =g_μ×g_σ; based on the comprehensive correction factor γ adjusted The pixel grayscale values in the difference regions are optimized and adjusted accordingly, and the adjusted pixel values are represented as I. corrected (i m ,j m ), and the corresponding calculation formula is: I corrected (im ,j m ) = I update (i m ,j m )×γ adjusted .
[0073] Step S500 includes:
[0074] A real-time image sequence is acquired, and the sequence is analyzed according to steps S100 and S200 to identify new keyframes. The difference regions in the new keyframes are extracted, and the coverage area of the difference region of the old keyframe closest to the time point corresponding to the new keyframe is extracted from the index table. It is determined whether the difference region of the new keyframe completely includes the difference region of the old keyframe. If the difference region of the new keyframe completely includes the difference region of the old keyframe, the old keyframe is marked as redundant data. Otherwise, the pixel data of the new keyframe is merged into the index table. Based on the redundancy marking, all non-keyframe data associated with the old keyframe is identified, and all non-keyframe data associated with the old keyframe is deleted.
[0075] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0076] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A scene-based non-uniformity correction method, characterized in that: The method includes the following steps: Step S100. Acquire a continuous image sequence from the night vision system, perform difference analysis on two adjacent frames to extract the difference region; extract the information entropy of each frame and combine it with the area of the difference region to evaluate the frame importance score; Step S200. Based on frame importance scoring, identify key frames in the image sequence and mark key frames and non-key frames in the image sequence respectively; store key frames in their entirety, and retain only the pixel coordinates and grayscale values of the difference areas of non-key frames, and establish an index table to record the mapping relationship between key frames and non-key frames. Step S300. Summarize the keyframes in the image sequence and generate a keyframe set; perform online averaging on all keyframes to generate initial non-uniformity correction parameters, and dynamically adjust the averaging termination condition according to the convergence of the standard deviation of the keyframes. Step S400. Extract the pixel coordinates and grayscale values of the difference regions in non-keyframes, and update the local average value of the pixels in the difference regions based on the initial non-uniformity correction parameters; analyze the statistical characteristics of the difference regions, including local mean and local standard deviation; calculate the influence factors based on the difference between the local mean and the desired target mean, and the difference between the local standard deviation and the desired target standard deviation, and then calculate the comprehensive correction factor; use the comprehensive correction factor to optimize and adjust the updated grayscale values of the pixels in the difference regions. Step S500. Acquire a real-time image sequence, identify new keyframes and extract their difference regions; compare the coverage of the difference regions of the new keyframes with the difference regions of the stored old keyframes that are closest in time; if the difference regions of the new keyframes completely contain the difference regions of the old keyframes, then the old keyframes are determined to be redundant data, and the old keyframes and all non-keyframe data associated with them are deleted; otherwise, the data of the new keyframes are incorporated into the index table.
2. The scene-based non-uniformity correction method according to claim 1, characterized in that: The specific process for extracting the difference region in step S100 is as follows: Obtain a continuous image sequence from the night vision system, represented as: {I1,I2,...,I...} n }, where I1 represents the first frame of the image sequence, I2 represents the second frame of the image sequence, and so on, I n Let I represent a frame image in an image sequence, where n represents the number of frames in the image sequence; for two adjacent frames in the image sequence... t and I t+1 Perform difference analysis to obtain the difference map D between adjacent frames. t+1 And D t+1 =|I t+1 -I t |, where D t+1 Indicates two adjacent frames I t and I t+1 The magnitude of change of each pixel over time; For adjacent frame difference maps D t+1 Obtain the difference value |I for each pixel. t+1 (i,j)-I t (i,j)|, compare the difference value of each pixel with the difference threshold T; if |I t+1 (i,j)-I t If (i,j)|>T, it means that this pixel belongs to the difference region, and is labeled as D. t+1 (i,j)=1; if |I t+1 (i,j)-I t If (i,j)|≤T, it means that this pixel belongs to the indifferent region, and is labeled as D. t+1 (i,j)=0; where i and j represent the pixel positions in the image, D t+1 (i,j) represents the difference marker of the i-th and j-th pixels in the difference map of the (t+1)-th frame; Summarize D based on the difference region markers. t+1 The pixels with (i,j)=1 are used to extract the difference region.
3. The scene-based non-uniformity correction method according to claim 1, characterized in that: The extraction of information entropy for each frame in step S100, combined with the area of the difference region to evaluate the frame importance score, is detailed below: The information entropy is calculated for each frame of the image, and the corresponding information entropy is defined as follows: , Where p(h) represents image I t The probability of a grayscale value h is given, where L is the number of grayscale levels in the image. The importance of each frame is evaluated by combining image dissimilarity and information entropy, thereby calculating the corresponding frame importance score S. t And the specific calculation formula is: S t =α×(A diff / A total )+β×[H(I t ) / H max ], where A diff A represents the number of difference region markers in the t-th frame of the image. total H represents the total number of pixels in the t-th frame of the image; max This represents the maximum information entropy; α and β are weighting coefficients, and α+β=1.
4. The scene-based non-uniformity correction method according to claim 3, characterized in that: Step S200 includes: Based on the formula for calculating frame importance score, the frame importance score of each image in the image sequence is calculated. The frame importance scores of each image are then arranged in descending order. The first m images are selected and marked as keyframes, and the rest are marked as non-keyframes. For keyframes, full-frame storage is performed, saving all pixel data of the keyframe, represented as I. key ; For non-keyframes, extract the difference regions from the non-keyframes, and store the pixel coordinates and grayscale values of the difference regions in the non-keyframes, represented as: R non-key And R non-key There are several data groups, and each data group is represented as: [(i m ,j m ),I non-key (i m ,j m )], where, (i m ,j m ) represents the coordinates of the m-th pixel in the difference region, I non-key (i m ,j m ) represents the grayscale value of the m-th pixel; based on the temporal order of keyframes and non-keyframes, an index table is established to record the mapping relationship between keyframes and non-keyframes.
5. The scene-based non-uniformity correction method according to claim 4, characterized in that: In step S200, an index table is established based on the temporal order of key frames and non-key frames to record the mapping relationship between key frames and non-key frames. The specific content includes: The index table records data in chronological order and includes frame number, frame type, pixel data, and difference region data. The frame type is either a keyframe or a non-keyframe. Pixel data corresponds to keyframes, and difference region data corresponds to non-keyframes. The difference region data includes the pixel coordinates and grayscale values of the difference regions within the non-keyframes. The index format for keyframes is (N, Z, I). key The index format for non-keyframes is: (N, Z, R) non-key ), where N represents the frame number and Z represents the frame type.
6. The scene-based non-uniformity correction method according to claim 1, characterized in that: In step S300, the keyframes in the image sequence are summarized and a keyframe set is generated. Online averaging is performed on all keyframes to generate initial non-uniformity correction parameters, including: Based on the frame type in the index table, the keyframes in the image sequence are summarized to generate a keyframe set K, where K = {k1, k2, ..., kv}, where k1 represents the first keyframe in the image sequence, k2 represents the second keyframe in the image sequence, and so on, kv represents the v-th keyframe in the image sequence, and v represents the number of keyframes in the image sequence. For the first keyframe k1 in the keyframe set K, the pixel data I of keyframe k1 is... key1 As the initial average image A1, for each subsequent keyframe kf, where f ranges from 2 to v; the corresponding average image A is calculated using the update formula. f And A f =[(f-1)·A f-1 +I keyf ] / f, where A f A represents the average image up to the f-th keyframe. f-1 I represents the average image of the previous keyframe. keyf This represents the pixel data of the current f-th keyframe; Calculate the difference image Δf between each keyframe and the corresponding average image, where Δf = I. keyf -A f Based on the difference images of each keyframe, calculate the corresponding standard deviation of difference σf, and sum the average of the standard deviations of difference of all keyframes as the initial correction parameter C. init .
7. The scene-based non-uniformity correction method according to claim 6, characterized in that: The step S300, which dynamically adjusts the average termination condition based on the convergence of the keyframe standard deviation, specifically includes: Obtain the difference standard deviation sequence of keyframes, determine whether the difference standard deviation sequence converges, and the convergence criterion is: |σf-σ(f-1)|< ,in This represents the preset convergence threshold; the average termination condition is dynamically adjusted based on the convergence of the keyframe difference standard deviation sequence, and the condition is met when the standard deviation change of all keyframes is less than a certain value. If convergence is achieved, the averaging calculation is considered complete and can be terminated; otherwise, online averaging calculation continues until convergence is reached. Whenever the standard deviation converges, the non-uniformity correction parameter C is updated based on the new standard deviation value. final .
8. The scene-based non-uniformity correction method according to claim 6, characterized in that: Step S400 includes: Based on the frame type in the index table, obtain the pixel coordinates and grayscale values of the difference regions in non-key frames of the image sequence, and combine them with the initial non-uniformity correction parameter C. init For each pixel in the difference region of non-keyframes, a local average value is updated, and the corresponding calculation formula is: I update (i m ,j m )=γ·I non-key (i m ,j m )+(1-γ)·(1 / N neighbor )Σ (ir,jr)∈N(im,jm) I non-key (i r ,j r ); Among them, I update (i m ,j m ) represents the updated grayscale value of the pixel in the difference region, I non-key (i m ,j m ) represents the grayscale value of the pixel in the difference region of the current non-keyframe, N(i m ,j m ) represents a pixel (i m ,j m The set of neighboring pixels of ) , N neighbor γ represents the number of pixels in the neighborhood, and γ represents the weighting coefficient. When updating each pixel in a difference region, the statistical characteristics of the difference region are analyzed. These statistical characteristics include the local mean μ_local and the local standard deviation σ_local for each difference region. Based on the local mean μ_local and the local standard deviation σ_local for each difference region, the corresponding influence factor is calculated, and the formula for calculating the influence factor is as follows: g = 1 + λ (q_local - q_target); Where g represents the influence factor of the local mean or local standard deviation, λ represents a constant, q_local represents the local mean or local standard deviation of the region of difference, and q_target represents the desired target mean or target standard deviation; for each region of difference, the influence factors of the corresponding local mean and local standard deviation are obtained, denoted as g_μ and g_σ respectively, and the comprehensive correction factor γ is calculated. adjusted , and γ adjusted =g_μ×g_σ; based on the comprehensive correction factor γ adjusted The pixel grayscale values in the difference regions are optimized and adjusted accordingly, and the adjusted pixel values are represented as I. corrected (i m ,j m ), and the corresponding calculation formula is: I corrected (i m ,j m )=I update (i m ,j m )×γ adjusted .