A method for rapidly processing sea stray light in sea and air background infrared images
By performing pooling processing and minimizing the segmentation of straight line energy to extract the water antenna, combined with CLAHE technology, the problem of sea stray light interference in sea and sky background infrared images was solved, achieving clear water antenna extraction and sky region enhancement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CENT CHINA OPTOELECTRONICS TECH RES INST (CHINA STATE SHIPBUILDING CORP 717TH RES INST)
- Filing Date
- 2024-12-31
- Publication Date
- 2026-05-26
AI Technical Summary
Existing infrared image processing techniques, when dealing with sea and sky background images affected by sea stray light, exhibit large dark or overly bright areas near the sea-sky boundary. The CLAHE algorithm is inflexible in its block division, the Otsu thresholding method is prone to segmentation errors, and the Hough transform is computationally intensive and susceptible to interference, making it difficult to accurately extract the waterline.
By acquiring infrared images and performing pooling processing, a minimum segmentation line energy equation is established to extract the optimal water antenna. Then, CLAHE image enhancement technology is used for block processing to suppress the influence of sea stray light and enhance the effect in the sky area.
It quickly extracts the horizon line, suppresses the influence of sea stray light on the sky area, enhances image visibility, avoids grid-like ghost images produced by CLAHE, and improves image clarity.
Smart Images

Figure CN119963424B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method for rapid processing of sea stray light in ocean and air background infrared images. Background Technology
[0002] Existing infrared image processing techniques include CLAHE image enhancement, Otsu thresholding for underwater antenna extraction, and Hough transform for underwater antenna extraction. CLAHE, short for Contrast-Limited Adaptive Histogram, is an image processing algorithm that adaptively adjusts pixel brightness to improve the contrast of dark or overly bright areas of an image, allowing the human eye to observe image details. The CLAHE algorithm sets a contrast limit, divides the input image into blocks, and enhances each block according to this limit. This method avoids interference from extremely bright or dark areas in ordinary histogram equalization algorithms, preventing excessive noise. However, existing CLAHE algorithms are somewhat mechanical in selecting image blocks. When processing infrared images with sea and sky backgrounds affected by sea clutter, the effect is influenced by the position of the sea-sky boundary. Large dark or overly bright areas may still exist near the sea-sky boundary, and due to the fixed block equalization, weak, blocky virtual images may be produced.
[0003] The Otsu thresholding method, also known as the maximum inter-class variance method, works by dividing the image's grayscale histogram into two parts using an optimal threshold, minimizing the intra-class variance and maximizing the inter-class variance. While the Otsu thresholding principle is intuitive, it has two drawbacks for water surface detection: First, when there is extensive high-brightness reflection from the water surface, the sky, dark water, and reflective water will form more than three peaks in the grayscale histogram. Since the Otsu thresholding method can only distinguish between two different classes, segmentation errors often occur. Second, water surface detection requires finding the boundary between the water surface and the sky, but the Otsu thresholding method provides a binary image, necessitating the use of other algorithms to obtain this boundary.
[0004] In the extraction of the water antenna line, the Hough transform calculates the edge of the binarized image. For the parameters of the straight line, the coordinate space of the image edge is transformed into the parameter space. Then, the most frequent parameter pairs in the parameter space are counted to determine the optimal straight line and fit the water antenna line. However, this method has a large computational load, and due to sea clutter interference, the image edge may not contain the water antenna line. In this case, the Hough transform cannot fit the water antenna line.
[0005] In view of this, this solution proposes a method for rapid processing of sea stray light in sea and air background infrared images to address the aforementioned problems. Summary of the Invention
[0006] The purpose of this invention is to provide a method for rapid processing of sea stray light in ocean and air background infrared images, so as to solve the problems mentioned in the background art.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for rapid processing of sea stray light in sea and air background infrared images, the rapid processing method comprising the following steps:
[0008] The first step is to acquire an infrared image of the sea and sky background, wherein the infrared image is acquired by the sensor and the image is a grayscale image;
[0009] The second step is to perform pooling processing on the obtained grayscale image to obtain the pooling matrix A of the image;
[0010] The third step is to minimize the energy of the segmented line by minimizing the obtained pooling matrix, including establishing the equation for the energy of the horizontal segmented line and obtaining the result of minimizing the energy of the segmented line, which is represented as the optimal water antenna.
[0011] The fourth step involves using CLAHE image enhancement technology to process the image based on the optimal waterline, resulting in an enhanced image.
[0012] The fifth step is to output the enhanced image and display it.
[0013] Preferably, the image acquired by the sensor is a two-dimensional infrared image.
[0014] Preferably, the image pooling process involves dividing the acquired image into regions based on pixels, calculating the grayscale of pixels within each region, and then selecting the pixel with the highest grayscale value as the representative pixel.
[0015] Preferably, the pooling matrix A after image pooling is obtained by forming a matrix of all representative pixels in order.
[0016] Preferably, the construction of the energy equation for the horizontally segmented line is to set the element value to p for each element in the pooling matrix A. i Its coordinates are represented as:
[0017]
[0018] Then, the energy equation for the dividing line is expressed as:
[0019]
[0020] Where e represents the energy of the segmentation line, n represents the energy weight of the line height, q represents the pixel energy weight, h represents the number of rows in the pooling matrix A, and y represents the number of rows where the current segmentation line is located.
[0021] Preferably, n·(hy) represents the energy at the position of the straight line, and the energy is higher as the line goes higher.
[0022] Preferably, the Let p represent the sum of the energies of all elements above the line, and let p be the element value. i The higher the height, the stronger the energy.
[0023] Preferably, the optimal lateral waterline segmentation line of the sea stray light image is represented as:
[0024]
[0025]
[0026]
[0027] The dividing line represents the setting of a horizontal dividing line in the sea stray light image, and requires that the energy of the elements above the line be small.
[0028] Preferably, the calculation of the optimal hydrothermal line involves iterating through all y-values, substituting them into formula (2) to calculate the energy of all transversely segmented straight lines, and taking the minimum value among them. This is the result of minimizing the energy of the segmented line.
[0029] Preferably, the enhanced image is obtained by using the optimal hydrographic line as the boundary of the image blocks, and then using CLAHE technology to process the block images, and the processing result is the enhanced image.
[0030] The technical effects and advantages of this invention are as follows:
[0031] The purpose of this invention is to process infrared images with sea stray light in the sea and sky background. First, the waterline is quickly extracted by pooling the grayscale image. Then, based on the optimal waterline, CLAHE image enhancement technology is used for image processing to suppress the influence of sea stray light on the sky area image and enhance the visibility of the sky area. The resulting enhanced image can be displayed more clearly. Attached Figure Description
[0032] Figure 1 This is a flowchart of the processing method of the present invention. Detailed Implementation
[0033] 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.
[0034] This invention provides, for example Figure 1 The method for rapid processing of sea stray light in infrared images of sea and air backgrounds, as shown, includes the following steps:
[0035] The first step is to acquire an infrared image of the sea and sky background, wherein the infrared image is acquired by the sensor and the image is a grayscale image;
[0036] Specifically, the image acquired by the sensor is a two-dimensional infrared image.
[0037] It should be noted that acquiring infrared images of the sea and sky background typically requires the use of infrared sensors. These sensors can capture infrared radiation of different wavelengths. When acquiring infrared images, it is necessary to select a suitable infrared sensor and ensure that the sensor operates within the appropriate wavelength range, usually the mid-infrared (3-5 micrometers) or long-infrared (8-14 micrometers) range. Setting the shooting environment involves selecting an appropriate time and location to ensure the sea and sky background is clearly visible. Sensor parameters are adjusted according to environmental conditions, including exposure time, gain, and other parameters, to ensure a clear image is captured. Image acquisition is performed at the sensor, ensuring sensor stability and avoiding jitter and blur. Image processing involves using image processing software (such as MATLAB or OpenCV in Python) to convert the acquired image into a grayscale image. Finally, the processed image is saved in an appropriate format (such as PNG or TIFF) for subsequent analysis. Obtaining a two-dimensional grayscale image through an infrared sensor is more conducive to subsequent image processing.
[0038] The second step is to perform pooling processing on the obtained grayscale image to obtain the pooling matrix A of the image;
[0039] It's important to note that image pooling is a common technique in deep learning and computer vision, primarily used to reduce the spatial dimensionality of images, thereby reducing computational cost and preventing overfitting. Pooling operations are commonly used in convolutional neural networks (CNNs). Pooling methods include max pooling, average pooling, and global average pooling. Max pooling takes the maximum value within each pooling window, preserving the most salient features in the feature map, and is used for image classification tasks. Average pooling takes the average value within each pooling window, smoothing the feature map and reducing noise, and is used in scenarios where more information needs to be preserved. Global average pooling averages the entire feature map, outputting a single numerical value, and is used in the last layer of the network to reduce the number of parameters and prevent overfitting.
[0040] The steps for pooling are as follows:
[0041] Choose a pooling layer; select an appropriate pooling layer (including max pooling or average pooling) in the neural network.
[0042] Define the pooling window, and set its size (including 2x2 or 3x3) and stride;
[0043] Apply pooling by sliding a pooling window across the input feature map to perform pooling operations and generate a new feature map.
[0044] Specifically, image pooling involves dividing the acquired image into regions based on pixels, calculating the grayscale value of pixels within each region, and then selecting the pixel with the highest grayscale value as the representative pixel.
[0045] Furthermore, the pooling matrix A after image pooling is obtained by forming a matrix of all representative pixels in order.
[0046] It should be noted that in the application of this solution, assuming that the infrared device outputs a stray light image with a resolution of 640*512 pixels, the input image is pooled, dividing the 640*512 pixels into 80*512 regions, each region containing 8*1 pixels. The grayscale of the 8*1 pixels in each region is counted, and the highest grayscale value is selected as the representative pixel. All representative pixels are arranged in order to form an 80*512 matrix, which is the pooling matrix A.
[0047] The third step is to minimize the energy of the segmented line by minimizing the obtained pooling matrix, including establishing the equation for the energy of the horizontal segmented line and obtaining the result of minimizing the energy of the segmented line, which is represented as the optimal water antenna.
[0048] It should be noted that the optimal waterline is obtained by minimizing the energy of the dividing line. This adopts the energy minimization method in image segmentation. Minimizing the energy of the dividing line is a concept in image segmentation and computer vision, used to divide an image into different regions or objects. Its core idea is to find the best dividing line (or dividing boundary) by optimizing an energy function to achieve effective separation of different regions in the image. Minimizing the energy of the dividing line is based on a data term and a smoothing term. The data term represents the similarity of pixels on both sides of the dividing line. The goal is to make the dividing line group similar pixels into the same category and separate different pixels. The data term can be defined by calculating the difference in pixel features (including color and texture) on both sides of the dividing line. The smoothing term is used to control the smoothness of the dividing line to avoid generating complex or irregular dividing lines. The smoothing term will penalize dividing lines that are too steep or irregular. The total energy function is constructed by combining the data term and the smoothing term, and the optimal dividing line is found by optimizing the energy function.
[0049] Specifically, the construction of the energy equation for the horizontally split line involves setting the element value to p for each element in the pooling matrix A. i Its coordinates are represented as:
[0050]
[0051] Then, the energy equation for the dividing line is expressed as:
[0052]
[0053] Where e represents the energy of the segmentation line, n represents the energy weight of the line height, q represents the pixel energy weight, h represents the number of rows in the pooling matrix A, and y represents the number of rows where the current segmentation line is located;
[0054] It should be noted that line height energy weight refers to the effect of changes in the height of the segmentation line (or boundary) on the energy function in image segmentation or image processing tasks. The significance of line height energy weight is that, in many cases, the segmentation line is not just a simple binary separator, but may have different heights or shapes. Line height energy weight can be used to adjust the flexibility of the segmentation line and control its changes. Adjusting the flexibility of the segmentation line can better fit complex object boundaries, while maintaining smoothness and simplicity in other areas; controlling the changes in the segmentation line is done in areas with large height variations to avoid overfitting noise or unnecessary complexity.
[0055] Pixel energy weighting refers to assigning different weights to different pixels when calculating the energy of each pixel in an image, so as to better reflect its importance in a specific task. In image processing and computer vision, pixel energy weighting is often used for tasks such as image segmentation, edge detection, or image reconstruction.
[0056] n·(hy) represents the energy at the position of the line, and the energy is higher as the line goes higher.
[0057] Let p represent the sum of the energies of all elements above the line, and let p be the element value. i The higher the height, the stronger the energy.
[0058] Furthermore, the optimal lateral waterline segmentation line for the sea stray light image is expressed as:
[0059]
[0060]
[0061]
[0062] The dividing line represents the setting of a horizontal dividing line in the sea stray light image, and requires that the energy of the elements above the line be small.
[0063] The optimal waterline is calculated by iterating through all y-values, substituting them into formula (2) to obtain the energy of all transversely segmented lines, and then taking the minimum value. This is the result of minimizing the energy of the segmented line.
[0064] The fourth step involves using CLAHE image enhancement technology to process the image based on the optimal waterline, resulting in an enhanced image.
[0065] Specifically, the enhanced image is obtained by using the optimal waterline as the boundary for image segmentation, and then using the CLAHE technique to process the segmented images, resulting in the enhanced image.
[0066] It should be noted that CLAHE stands for Contrast Limiting Adaptive Histogram. It is an image processing algorithm that aims to adaptively adjust pixel brightness to improve the contrast of dark or overly bright parts of an image, allowing the human eye to observe image details. The CLAHE algorithm sets a contrast limit, divides the input image into blocks, and enhances the blocks according to the set contrast limit. This method can avoid the interference of extremely bright or dark areas by ordinary histogram equalization algorithms and avoid generating too much noise.
[0067] The fifth step is to output the enhanced image and display it.
[0068] It should be noted that the enhanced image can also be output to other image processing content for further processing. This scheme is suitable for infrared image processing with sea clutter, which refers to the large area of strong reflected sunlight from the sea surface. When sea clutter is present, the brightness of the sea clutter area is very high while the brightness of other parts is very low in the infrared image output by the imaging device. This phenomenon results in the overall brightness of the sky in the sea-sky background infrared image being too low, making it difficult for the naked eye to distinguish cloud details. The purpose of this scheme is to process the infrared image with sea clutter in the sea-sky background, to quickly extract the waterline, and at the same time suppress the influence of sea clutter on the sky area image, thereby enhancing the visibility of the sky area. The enhanced image output by this method enhances the sky imaging area and is less likely to produce grid-like virtual images similar to CLAHE. It also enhances the details of the image near the waterline better than CLAHE.
[0069] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is 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 method for rapid processing of sea stray light in sea and air background infrared images, characterized in that, The rapid processing method includes the following steps: The first step is to acquire an infrared image of the sea and sky background, wherein the infrared image is acquired by the sensor and the image is a grayscale image; The second step is to perform pooling processing on the obtained grayscale image to obtain the pooling matrix A of the image; The third step is to minimize the energy of the horizontally segmented line by minimizing the obtained pooling matrix, including establishing the equation for the energy of the horizontally segmented line and obtaining the result of minimizing the energy of the segmented line, which is represented as the optimal water antenna. The construction of the energy equation for the horizontally segmented line is to set the element value to p for each element in the pooling matrix A. i Its coordinates are represented as: Then, the energy equation for the dividing line is expressed as: Where e represents the energy of the segmentation line, n represents the energy weight of the line height, q represents the pixel energy weight, h represents the number of rows in the pooling matrix A, and y represents the number of rows where the current segmentation line is located; The term n·(hy) represents the energy at the position of the line, and the energy increases as the line moves upwards. Let p represent the sum of the energies of all elements above the line, and let p be the element value. i The higher the altitude, the stronger the energy. The optimal lateral waterline segmentation line of the sea stray light image is represented as: The dividing line represents the content of setting a horizontal dividing line in the sea stray light image, and requires that the energy of the elements above the line be small; The calculation of the optimal hydrothermal line involves iterating through all y-values, substituting them into formula (2) to calculate the energy of all transversely segmented straight lines, and then taking the minimum value corresponding to the energy of the y-value. This is the result of minimizing the energy of the segmented line; The fourth step involves using CLAHE image enhancement technology based on the optimal hydro-line to process the image and obtain an enhanced image. The fifth step is to output the enhanced image and display it.
2. The method for rapid processing of sea clutter light in sea and air background infrared images according to claim 1, characterized in that, The image acquired by the sensor is a two-dimensional infrared image.
3. The method for rapid processing of sea stray light in sea and air background infrared images according to claim 1, characterized in that, The image pooling process involves dividing the acquired image into regions based on pixels, calculating the grayscale value of pixels within each region, and then selecting the pixel with the highest grayscale value as the representative pixel.
4. The method for rapid processing of sea stray light in sea and air background infrared images according to claim 3, characterized in that, The pooling matrix A after image pooling is obtained by forming a matrix of all representative pixels in order.
5. The method for rapid processing of sea stray light in sea and air background infrared images according to claim 1, characterized in that, The enhanced image is obtained by using the optimal hydrographic line as the boundary of the image blocks, and then using CLAHE technology to process the block images, resulting in the enhanced image.