Method for obtaining clarity of mid-wave refrigeration infrared automatic focusing under marine scene
Through FPGA processing images and selecting the region of interest in blocks, the difficulty in obtaining automatic focus clarity of refrigeration infrared imaging in special scenarios such as sea and sky is solved, and the clarity of automatic focus is improved.
Patent Information
- Application Number
- CN202211741706.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-12-28
AI Technical Summary
In special scenarios such as sea and sky, it is difficult to obtain the clarity of automatic focus of refrigeration infrared imaging, especially because the scenery is single and the contrast is not strong, resulting in the failure of automatic focus.
Images are acquired through FPGA and preprocessed, the histogram and variance are calculated, the images are processed in blocks, the region of interest is automatically selected and the definition calculation is used by the sobel operator to achieve automatic focus.
Automatically selecting the area of interest in special scenarios improves the clarity acquisition effect of automatic focus and solves the problem of single scenery and weak contrast.
Smart Images

Figure CN115953318B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of infrared imaging, and specifically to a method for obtaining the clarity of mid-wave cooled infrared autofocus in a maritime scenario. Background Art
[0002] In the scenario of cooled infrared images for remote monitoring, due to reasons such as temperature changes, focusing operations need to be performed multiple times. Therefore, for an unattended environment, autofocus is very necessary.
[0003] For the method of obtaining the clarity of autofocus in ordinary long-distance infrared imaging, the region of interest is mostly manually selected and then calculated and accumulated for the region of interest using the sobel template.
[0004] However, in some special scenarios, such as the sea, sky, etc., the contrast of the entire picture is not strong and the scenery is single. Since the monitoring distance of cooled infrared is relatively long, scenes such as clouds or ships that appear occupy a relatively small proportion in the image, which may lead to the situation that there are no scenes in the region of interest but there are outside the region, or when the region of interest is selected as the full screen, due to the small size and weak contrast of the scenery, the clarity obtained at this time has poor referenceability and the autofocus will not succeed. Summary of the Invention
[0005] Aiming at the defects of the prior art, the present invention provides a method for obtaining the clarity of mid-wave cooled infrared autofocus in a maritime scenario, which is used to automatically select the region of interest to output the clarity and has a good effect on special scenarios such as the sea and sky.
[0006] To solve the above technical problems, the technical solution adopted by the present invention is: a method for obtaining the clarity of mid-wave cooled infrared autofocus in a maritime scenario, including the following steps:
[0007] S01), the FPGA acquires an image from the detector and first performs preprocessing;
[0008] S02), calculate the histogram of the image to statistically obtain the maximum difference D of the pixel values of the pixels raw , and then judge whether D raw < D thre holds. If it holds, perform step S03). If it does not hold, perform step S06);
[0009] S03), perform histogram equalization and calculate the variance δ 2 of the histogram, set a threshold H thre , and judge whether δ 2 < H thre holds. If it holds, it is a special maritime scenario and perform step S04). If it does not hold, it is an ordinary scenario and perform step S06);
[0010] S04), divide the image after histogram equalization into n blocks and perform histogram statistics, where n is a positive integer, to obtain the variance of each block …、 ; Set a threshold , , judge the difference between the variance of each block in the current frame and the threshold, and denote the difference obtained from the block with the largest difference as D max , calculate the difference D of each block n , that is, the difference of the sum of variances of, judge D n <qD max holds or not, where q is a coefficient, taking values from 0 to 1. If it holds, set it as a non - interesting block; otherwise, if it does not hold, it is an interesting block;
[0011] S05), denote the block with the largest connected region where the interesting blocks are located as the final interesting region. After separately performing gamma correction on the interesting region, perform sobel operator cumulative summation to calculate the final sharpness value, and proceed to step S07);
[0012] S06), perform sobel operator cumulative summation on the entire image, and proceed to step S07);
[0013] S07), Quantitatively output the image sharpness.
[0014] Furthermore, the pre - processing described in step S01) includes non - uniformity correction and removing bad pixels.
[0015] Furthermore, before calculating the pixel difference D raw of the image, first discard the 1% of the points with the largest and smallest values in the original image.
[0016] Furthermore, in step S04), divide the image into 9 blocks.
[0017] Advantages of the present invention: Solve the problem of automatic focusing blur in an environment with a single scene and a small proportion of the scene on the imaging target surface. This method can automatically select the interesting region and can select appropriate scenes and targets for automatic focusing in the above - mentioned environment, with good results. Brief Description of the Drawings
[0018] Figure 1 is the flowchart of this method. Detailed Embodiments
[0019] The technical solutions in the embodiments of the present invention will be clearly and completely described below. The described embodiments of the present invention are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0020] Embodiment 1
[0021] This embodiment discloses a method for obtaining the clarity of mid-wave refrigeration infrared autofocus in a marine scenario, as Figure 1 shown, including the following steps:
[0022] S01). The FPGA acquires an image from the detector, first performs non-uniformity correction to make the image normally imaged, and then repairs the defects in the image on the detector by removing bad pixels;
[0023] S02). Calculate the histogram of the image and statistically calculate the maximum difference D of the pixel values of the pixels raw , first discard the 1% of the points with the largest and smallest values in the original image to obtain D raw , and judge whether D raw <D thre holds. If it holds, perform step S03). If it does not hold, perform step S06);
[0024] S03). Perform histogram equalization and calculate the variance of the histogram , and then determine whether the scene is single according to the variance statistically calculated from the histogram, that is, set a threshold H , and judge whether thre <H thre holds. If it holds, it is a special scene such as the sea or the sky, and perform step S04). If it does not hold, it is a normal scene, and perform step S06);
[0025] S04). Divide the image after histogram equalization into 9 blocks, as follows:
[0026] ,
[0027] Separate histograms are statistically calculated for the image after histogram equalization to obtain the variances of each block as follows:
[0028] ,
[0029] Subsequently, when the focusing position changes, the variances of each block also change. Set a threshold , max , judge the difference between the variance of each block and the threshold, and record the difference obtained from the block with the largest difference as D max , calculate the difference D of each blockn , that is, the sum of variances of the difference, judge D n <qD max whether it holds. q is a coefficient, taking values from 0 to 1. If it holds, set it as an uninteresting block; otherwise, if it does not hold, it is an interesting block.
[0030] S05), Denote the block with the largest connected region where the interesting block is located as the final interesting region. After separately performing gamma correction on the interesting region, perform the cumulative summation of the Sobel operator to calculate the final sharpness value, and proceed to step S07);
[0031] S06), Perform the cumulative summation of the Sobel operator on the entire image, and proceed to step S07);
[0032] S07), Quantitatively output the image sharpness. The output sharpness value is used for autofocus in special scenarios.
[0033] The blocks designed by the method in this embodiment are not limited to 9 blocks. If there are sufficient FPGA resources, there can be more.
[0034] The above description only presents the basic principles and preferred embodiments of the present invention. The improvements and substitutions made by those skilled in the art based on the present invention fall within the protection scope of the present invention.
Claims
1. Method for obtaining clarity of mid-wave refrigeration infrared automatic focusing in marine scenarios, characterized in that: Including the following steps: S01), the FPGA acquires images from the detector and first performs preprocessing; S02), calculate the histogram of the image to statistically obtain the maximum pixel value difference D of the pixels raw , and then judge D raw < D thre to check if it holds. If it holds, proceed to step S03); if not, proceed to step S06). S03), Histogram equalization and calculation of the variance of the histogram , Set the threshold H thre , Judge <H thre Whether it holds. If it holds, it is a special offshore scene, and step S04) is carried out. If it does not hold, it is a normal scene, and step S06) is carried out; S04), divide the image after histogram equalization into n blocks (n is a positive integer) and perform histogram statistics to obtain the variance of each block …, ; Set a threshold , , judge the difference between the variance of each block in the current frame and the threshold, and record the difference obtained from the block with the largest difference as D max , calculate the difference D of each block n, That is, the difference in variance sum , judge D n <qD max Whether it holds (q is a coefficient, taking values from 0 to 1). If it holds, set it as a non - interested block; otherwise, if it does not hold, it is an interested block; S05), mark the block with the largest connected region where the region of interest block is located as the final region of interest. After separately performing gamma correction on the region of interest, perform the accumulation summation of the sobel operator to calculate the final sharpness value, and proceed to step S07); S06), perform the accumulation summation of the sobel operator on the entire image, and proceed to step S07); S07), quantitatively output the image sharpness.
2. The method for obtaining the clarity of mid-wave refrigeration infrared autofocus in a maritime scenario according to claim 1, characterized in that: The preprocessing described in step S01) includes non-uniformity correction and dead pixel removal.
3. The method for obtaining the clarity of mid-wave refrigeration infrared autofocus in a maritime scenario according to claim 1, wherein: Calculate the pixel difference D of the image raw Before that, discard the 1% of the points with the largest and smallest values in the original image.
4. The method for obtaining the clarity of mid-wave refrigeration infrared autofocus in a maritime scenario according to claim 1, wherein: In step S04), the image is divided into 9 blocks.
Citation Information
Patent Citations
Video automatic focusing method applied to multi-main-body scene
CN101950116A
Method and system for enhancing picture contrast
CN104732487A