Runway extraction method and system based on adaptive exposure and contrast adjustment
Patent Information
- Application Number
- CN202611200988.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]尽管上述两类技术方案均能在常规环境下实现一定的跑道提取效果,但在实际的无人机降落应用场景中,仍存在明显的技术缺陷,导致其难以适配复杂的环境条件,泛化性较差
[0056]上述基于自适应曝光及对比度调节的跑道提取方法及系统,首先对跑道原始图像进行灰度转换处理得到初始灰度图,解决了原始图像维度复杂、处理效率低的问题,提升了图像处理的简便性与计算效率。其次,基于初始灰度图进行自适应曝光调节处理得到第一灰度图,提升了不同光照环境下图像质量的稳定性。进一步的,基于第一灰度图进行自适应对比度调节处理得到第二灰度图,解决了沙尘、大雾等恶劣天气下跑道与背景对比度不足、边界模糊的问题,提升了跑道特征的显著性与可提取性。最后,结合第一灰度图与第二灰度图进行特征融合,输出强化后的优化图像,为后续位姿解算提供了高质量的图像基础,进而提升了跑道提取的精度与复杂环境适应性。
Smart Images

Figure CN122989657A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, and in particular relates to a method and system for runway extraction based on adaptive exposure and contrast adjustment. Background Technology
[0002] Runway extraction is a core and crucial step in visually guided landing of UAVs. Its accuracy directly determines the accuracy of UAV pose calculation, thus affecting the stability and safety of the landing process. Therefore, efficient and accurate runway extraction algorithms are an important foundation for the practical application of UAV visual navigation technology. Here, "UAV" refers to a drone used for visual navigation and autonomous landing.
[0003] Currently, there are two main approaches to runway extraction technology for UAV vision-guided landing: One approach uses traditional digital image processing algorithms to extract runway features. This involves preprocessing the acquired runway image using edge detection and image filtering algorithms to identify runway edges and various line segments of interest. Then, Hough detection and other line extraction algorithms are used to identify valid line segments. Finally, the coordinates of the identified line segments in the image coordinate system are output, and the UAV's rotation matrix and offset vector are calculated based on this coordinate information to obtain the UAV's pose information, such as its angle and distance relative to the runway. The other approach combines deep learning object detection algorithms with traditional image processing algorithms. This involves using YOLOv5 and other object detection algorithms to detect the original runway image, identifying small regions of interest (ROIs) containing the runway, and then using traditional line extraction algorithms within these limited regions to extract runway line segments. By narrowing the feature extraction area, interference from irrelevant information is reduced, thus decreasing the probability of false detections of runway line segments.
[0004] While both of the aforementioned technical solutions can achieve certain runway extraction results in normal environments, they still have significant technical shortcomings in actual drone landing applications, making them difficult to adapt to complex environmental conditions and exhibiting poor generalization. Firstly, the runway extraction process of these technologies is directly based on the raw images captured by the camera, without considering the impact of ambient light on image quality. In bright sunlight, images captured by the camera are prone to overexposure, while in dim light, they are prone to underexposure. Both situations lead to abnormal average grayscale values in the image, weakening runway features and making them difficult to extract effectively using subsequent algorithms. Secondly, in severe weather conditions such as sandstorms and heavy fog, images captured by the camera exhibit an overall hazy visual effect, significantly reducing the contrast between the runway and the surrounding background, making it almost a seamless boundary between the two. This makes it impossible to effectively separate the runway edges from the background using conventional edge detection and filtering algorithms. On the other hand, when processing the original image, the above-mentioned technology has a low degree of separation between the runway edge and the environment on both sides. Even if the ROI region is selected by deep learning algorithm, it is still difficult to completely avoid the interference of irrelevant line segments, which can easily cause false detection of straight lines. The falsely detected line segment information will directly affect the accuracy of the subsequent UAV pose calculation, thereby reducing the reliability of UAV visual guidance landing.
[0005] In summary, to address the issues of low runway extraction accuracy and poor generalization caused by abnormal image exposure and insufficient contrast in complex environments, there is an urgent need for an optimized runway extraction scheme that can adapt to different lighting and weather conditions. This scheme would perform targeted preprocessing and optimization on runway images acquired by the camera, enhance the distinction between runway features and the background, provide a high-quality image foundation for subsequent runway feature extraction, and thus improve the accuracy and stability of runway extraction in complex environments. Summary of the Invention
[0006] Therefore, it is necessary to provide a runway extraction method and system based on adaptive exposure and contrast adjustment to address the above-mentioned technical problems. This aims to improve the quality of runway images under complex lighting and adverse weather conditions, enhance the distinction between runway features and background, reduce the interference of environmental factors on runway extraction accuracy, and thus improve the accuracy of pose calculation and the system's environmental adaptability during UAV visual-guided landing.
[0007] Firstly, this application provides a runway extraction method based on adaptive exposure and contrast adjustment, including:
[0008] Acquire raw images of the runway during the drone's landing process, and perform grayscale conversion on the raw runway images to obtain an initial grayscale image;
[0009] Based on the initial grayscale image, adaptive exposure adjustment is performed to obtain the first grayscale image; based on the first grayscale image, adaptive contrast adjustment is performed to obtain the second grayscale image.
[0010] By combining the first grayscale image and the second grayscale image, an enhanced and optimized image is output.
[0011] In one embodiment, an adaptive exposure adjustment process is performed based on an initial grayscale image to obtain a first grayscale image, including:
[0012] Pixel grayscale values are statistically analyzed based on the initial grayscale image to obtain a grayscale histogram that characterizes the distribution features of pixel grayscale values in the initial grayscale image.
[0013] Obtain the image size parameters of the initial grayscale image, including the number of rows and columns;
[0014] Based on the image size parameters of the initial grayscale image, the total number of pixels in the initial grayscale image is calculated. The number of pixels whose pixel values are less than the first preset pixel threshold and the second preset pixel threshold are extracted from the grayscale histogram to obtain the corresponding number of low-light pixels and number of high-light pixels. The second preset pixel threshold is greater than the first preset pixel threshold.
[0015] Based on the total number of pixels in the initial grayscale image, the corresponding proportions of low-light and high-light areas are calculated by combining the number of low-light pixels and the number of high-light pixels respectively.
[0016] Calculate the average grayscale value based on the initial grayscale image;
[0017] Obtain the preset optimal grayscale value range, and based on the proportion of low-light area, the proportion of high-light area, and the average grayscale value, combine the optimal grayscale value range to determine the exposure status and obtain the exposure status determination result, which is any one of underexposure, overexposure, or normal exposure.
[0018] Obtain the current original exposure value. When the exposure state determination result meets the corresponding preset exposure optimization conditions, optimize the original exposure value to obtain a new exposure value.
[0019] The initial grayscale image is then optimized for exposure based on the new exposure value to obtain the first grayscale image.
[0020] In one embodiment, an adaptive contrast adjustment process is performed based on the first grayscale image to obtain a second grayscale image, including:
[0021] Calculate the standard deviation of the gray values based on the gray values of each pixel in the first grayscale image;
[0022] Obtain the preset normal contrast standard deviation range, compare the grayscale value standard deviation with the normal contrast standard deviation range to determine the contrast status, and obtain the contrast status determination result. The contrast status determination result is any one of the following: contrast too high, contrast too low, or normal contrast.
[0023] Obtain the current original contrast value. When the contrast status judgment result meets the preset contrast optimization conditions, optimize and adjust the original contrast value based on the standard deviation of gray values to obtain a new contrast value.
[0024] The first grayscale image is then optimized for contrast based on the new contrast value to obtain the second grayscale image.
[0025] In one embodiment, when the exposure state determination result, the proportion of low-light areas, the proportion of high-light areas, and the average gray value meet the corresponding preset exposure optimization conditions, the original exposure value is optimized to obtain a new exposure value, including:
[0026] Obtain the preset threshold values for the proportion of low-light areas and the proportion of high-light areas;
[0027] When the exposure status is determined to be underexposed, the original exposure value is optimized using the first correction formula to calculate a new exposure value; among them, when the proportion of low light area is greater than the low light area proportion threshold and the average gray value is less than the minimum value in the optimal gray value range, the exposure status is determined to be underexposed.
[0028] When the exposure status is determined to be overexposed, the original exposure value is optimized using the second correction formula to calculate a new exposure value; among them, when the proportion of the highlight area is greater than the highlight area proportion threshold and the average gray value is greater than the maximum value in the optimal gray value range, the exposure status is determined to be overexposed.
[0029] When the exposure status is determined to be normal exposure, the original exposure value is kept unchanged and the original exposure value is output as the new exposure value.
[0030] The first correction formula is:
[0031]
[0032] In the formula, For the new exposure value, It is the minimum value in the optimal grayscale value range. Original exposure value This represents the average grayscale value.
[0033] The second corrected formula is:
[0034]
[0035] In the formula, It is the maximum value within the optimal grayscale range.
[0036] In one embodiment, when the contrast state determination result meets the preset contrast optimization conditions, the original contrast value is optimized and adjusted based on the standard deviation of grayscale values to obtain a new contrast value, including:
[0037] When the contrast status determination result meets the preset contrast optimization conditions, the contrast adjustment coefficient is calculated based on the standard deviation of gray values, and the original contrast value is optimized and adjusted according to the contrast adjustment coefficient to obtain a new contrast value.
[0038] When the contrast status determination result is normal contrast, keep the original contrast value unchanged and output the original contrast value as the new contrast value;
[0039] The contrast adjustment coefficient is obtained through the following steps:
[0040] When the contrast status determination result is that the contrast is too high, the contrast adjustment coefficient is calculated according to the first optimization formula;
[0041] When the contrast status determination result is that the contrast is too low, the contrast adjustment coefficient is calculated according to the second optimization formula.
[0042] The first optimization formula is:
[0043]
[0044] In the formula, This is the contrast adjustment coefficient. The standard deviation of the grayscale value. This represents the maximum value within the normal standard deviation range for contrast.
[0045] The second optimization formula is:
[0046]
[0047] In the formula, This is the minimum value within the normal standard deviation range for contrast.
[0048] In one embodiment, both the low-light region percentage threshold and the high-light region percentage threshold are 20%.
[0049] The first preset pixel threshold is 30, and the second preset pixel threshold is 225.
[0050] Secondly, this application also provides a runway extraction system based on adaptive exposure and contrast adjustment, including:
[0051] The image acquisition and grayscale conversion module is used to acquire the original runway image during the UAV landing process, and to perform grayscale conversion processing on the original runway image to obtain the initial grayscale image.
[0052] An adaptive enhancement processing module is used to perform adaptive exposure adjustment processing based on an initial grayscale image to obtain a first grayscale image; and to perform adaptive contrast adjustment processing based on the first grayscale image to obtain a second grayscale image.
[0053] The image output module is used to combine the first grayscale image and the second grayscale image to output an enhanced and optimized image.
[0054] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the first aspect.
[0055] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the first aspect.
[0056] The aforementioned runway extraction method and system based on adaptive exposure and contrast adjustment first performs grayscale conversion on the original runway image to obtain an initial grayscale image, solving the problems of complex original image dimensions and low processing efficiency, and improving the simplicity and computational efficiency of image processing. Second, adaptive exposure adjustment is performed on the initial grayscale image to obtain a first grayscale image, improving the stability of image quality under different lighting conditions. Furthermore, adaptive contrast adjustment is performed on the first grayscale image to obtain a second grayscale image, solving the problems of insufficient contrast and blurred boundaries between the runway and background under severe weather conditions such as sandstorms and heavy fog, improving the saliency and extractability of runway features. Finally, feature fusion is performed by combining the first and second grayscale images to output an enhanced and optimized image, providing a high-quality image foundation for subsequent pose calculation, thereby improving the accuracy of runway extraction and its adaptability to complex environments. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 A flowchart of a runway extraction method based on adaptive exposure and contrast adjustment, provided as an exemplary embodiment of the present invention;
[0059] Figure 2A flowchart of a method for adaptive contrast adjustment based on a first grayscale image is provided as an exemplary embodiment of the present invention;
[0060] Figure 3 This is a schematic diagram of a runway extraction system based on adaptive exposure and contrast adjustment, provided as an exemplary embodiment of the present invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0062] In one embodiment, such as Figure 1 As shown, a runway extraction method based on adaptive exposure and contrast adjustment is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0063] S101: Acquire raw images of the runway during the UAV landing process, perform grayscale conversion on the raw runway images, and obtain an initial grayscale image.
[0064] Specifically, during the UAV's vision-guided landing process, runway visual images can be acquired in real time using cameras mounted on the UAV. This image acquisition process is synchronized with the UAV's landing trajectory to ensure that the acquired raw runway images accurately reflect the actual visual characteristics of the runway at different flight altitudes and spatial positions. These raw runway images are color images output by the camera, containing red, green, and blue color information. However, this color information is not the core feature required for runway extraction and increases the computational load of subsequent image processing. Furthermore, color information is easily distorted by ambient light and weather factors, making it unable to stably represent the regional differences between the runway and the surrounding background. Grayscale images, on the other hand, can represent the brightness of pixels using only a single grayscale value, effectively removing irrelevant color interference and focusing on the brightness differences between the runway and the background. Therefore, a general grayscale conversion algorithm can be used to process the color raw runway image. This involves mapping the three-channel pixel values to a single grayscale value according to a preset grayscale conversion formula. The generated initial grayscale image is completely consistent with the pixel dimensions and spatial contours of the raw runway image, ensuring that the spatial features of the image are not distorted and guaranteeing the spatial accuracy of subsequent adjustment processing.
[0065] S102: Based on the initial grayscale image, perform adaptive exposure adjustment processing to obtain the first grayscale image; based on the first grayscale image, perform adaptive contrast adjustment processing to obtain the second grayscale image.
[0066] Specifically, since exposure directly determines the overall brightness of an image, overexposure or underexposure can lead to abnormal saturation or loss of pixel grayscale values. In such cases, direct contrast adjustment cannot effectively enhance the runway features and may even amplify grayscale distortion. Therefore, a phased adaptive adjustment strategy can be adopted, first adjusting the exposure and then adjusting the contrast to ensure that each adjustment is based on the normal image brightness, thus improving the accuracy and effectiveness of the adjustment. The purpose of adaptive exposure adjustment is to address overexposure or underexposure issues caused by different natural lighting conditions (direct sunlight, cloudy days, evening, etc.) and different shooting angles (backlighting, sidelighting, etc.) during drone landing. Overexposure causes pixel grayscale values in highlight areas to tend towards saturation, while underexposure causes pixel grayscale values in low-light areas to tend towards zero. Both weaken the core features of the runway, such as edges and contours, making it impossible to effectively distinguish between the runway and the background. Therefore, the exposure state of the initial grayscale image can be accurately detected and adaptively optimized, and the exposure state of the image can be adjusted to the preset normal exposure range to generate the first grayscale image. The overall brightness of the first grayscale image is adapted to the requirements of subsequent image processing, and the pixel grayscale value distribution is in a reasonable range. The basic brightness and darkness features of the runway are effectively restored and initially highlighted.
[0067] After obtaining the first grayscale image, adaptive contrast adjustment can be performed on this image to address the issue of an overall hazy visual effect in images encountered during drone landings in severe weather conditions such as sandstorms, heavy fog, and smog. This significantly reduces the difference in grayscale values between the runway and the surrounding background, causing their boundaries to merge. Contrast, as a core indicator representing the degree of difference in grayscale values between bright and dark areas in an image, is crucial. Insufficient contrast leads to significant confusion between runway features and the background, a major reason for false positives and missed features in traditional runway extraction methods. Therefore, adaptive contrast adjustment can be performed on the first grayscale image after exposure adjustment. While maintaining normal overall image brightness, the grayscale value difference between the runway and background areas is specifically increased to enhance the runway's edge definition and contour features, generating a second grayscale image. This second grayscale image shows significantly improved separation between the runway and background areas, providing a contrast-optimized image foundation for subsequent image fusion operations.
[0068] S103: Combine the first grayscale image and the second grayscale image to output the enhanced and optimized image.
[0069] Specifically, the first grayscale image is the image after exposure optimization. Its core features are normal overall brightness and darkness, reasonable pixel grayscale value distribution, and preservation of the true light and dark contour features of the runway. The second grayscale image is the image after contrast adjustment based on exposure optimization. Its core features are significant differences in grayscale values between the runway and the background, and clear runway edge features. The two images have different optimization dimensions and complement each other. If either image is used as input for subsequent runway extraction, there will be feature limitations. Illustratively, an image fusion algorithm can be used to fuse the first and second grayscale images. During the fusion process, the pixel grayscale values of the two images are weighted and fused. Based on the preset fusion weights, while preserving the normal exposure grayscale features of the first grayscale image, the enhanced contrast grayscale features of the second grayscale image are superimposed. This ensures that the fused image has both normal overall brightness and darkness and clear runway and background boundary features. Simultaneously, the fusion process follows the spatial pixel correspondence of the images to ensure that the spatial contour features of the runway are not distorted. The optimized image with enhanced runway features output by this fusion processing integrates the dual optimization effects of exposure and contrast, effectively solving the problems of weakened runway features and blurred boundaries caused by abnormal exposure and insufficient contrast in traditional runway extraction methods. The core features such as the outline and edges of the runway are significantly highlighted, and the separation from the surrounding background is greatly improved.
[0070] The method described above first converts the original runway image captured by the UAV into grayscale, providing a unified grayscale image foundation for subsequent adaptive exposure and contrast adjustment. Second, adaptive exposure adjustment is performed on the initial grayscale image to obtain a first grayscale image, resolving overexposure or underexposure issues caused by excessively bright or dark lighting, and mitigating the impact of ambient light on runway features. Then, adaptive contrast adjustment is performed on the first grayscale image after exposure optimization to obtain a second grayscale image, precisely enhancing the separation between the runway and the surrounding background. This overcomes the blurring of runway edges under adverse weather conditions such as sandstorms and heavy fog, improving the environmental adaptability of runway feature extraction. Finally, by combining the first and second grayscale images to output an enhanced optimized image, the dual optimization effects of exposure and contrast are integrated, effectively highlighting runway features and providing high-quality image input for subsequent runway extraction. This solves the problems of weak runway features and susceptibility to false straight-line detection in traditional methods, improving the accuracy and stability of runway extraction.
[0071] In one embodiment, based on an initial grayscale image, adaptive exposure adjustment processing is performed to obtain a first grayscale image, including:
[0072] Pixel grayscale values are statistically analyzed based on the initial grayscale image to obtain a grayscale histogram that characterizes the distribution features of pixel grayscale values in the initial grayscale image.
[0073] Obtain the image size parameters of the initial grayscale image, including the number of rows and columns;
[0074] Based on the image size parameters of the initial grayscale image, the total number of pixels in the initial grayscale image is calculated. The number of pixels whose pixel values are less than the first preset pixel threshold and the second preset pixel threshold are extracted from the grayscale histogram to obtain the corresponding number of low-light pixels and number of high-light pixels. The second preset pixel threshold is greater than the first preset pixel threshold.
[0075] Based on the total number of pixels in the initial grayscale image, the corresponding proportions of low-light and high-light areas are calculated by combining the number of low-light pixels and the number of high-light pixels respectively.
[0076] Calculate the average grayscale value based on the initial grayscale image;
[0077] Obtain the preset optimal grayscale value range, and based on the proportion of low-light area, the proportion of high-light area, and the average grayscale value, combine the optimal grayscale value range to determine the exposure status and obtain the exposure status determination result, which is any one of underexposure, overexposure, or normal exposure.
[0078] Obtain the current original exposure value. When the exposure state determination result meets the corresponding preset exposure optimization conditions, optimize the original exposure value to obtain a new exposure value.
[0079] The initial grayscale image is then optimized for exposure based on the new exposure value to obtain the first grayscale image.
[0080] Specifically, frequency statistics can be performed on the grayscale values of all pixels in the initial grayscale image. After quantifying the number of pixels corresponding to different grayscale values, a grayscale histogram is formed. This grayscale histogram uses grayscale values as the horizontal axis and the number of pixels corresponding to the grayscale values as the vertical axis. It can intuitively and quantitatively represent the overall distribution characteristics of pixel grayscale values in the initial grayscale image. Furthermore, the exposure state of the image can be directly reflected in the distribution bias of grayscale values. For example, an overexposed image will show a distribution characteristic with a large proportion of high grayscale value pixels, while an underexposed image will show a distribution characteristic with a large proportion of low grayscale value pixels. Therefore, the grayscale histogram provides core pixel distribution data support for subsequent exposure state determination.
[0081] Furthermore, the image size parameters of the initial grayscale image, i.e., the number of rows, can be obtained. Number of columns The number of rows represents the number of pixels in the vertical direction of the initial grayscale image, and the number of columns represents the number of pixels in the horizontal direction of the initial grayscale image. This parameter can be directly extracted from the image attributes of the initial grayscale image, while the total number of pixels is... This represents the total number of pixels in the initial grayscale image. Since the grayscale histogram has already counted the number of pixels corresponding to each grayscale value, the number of pixels within a specified grayscale value range can be directly extracted from the grayscale histogram by summing them up. Pixels with values less than a first preset pixel threshold, such as 30, can be considered as low-light pixels in the image. Summing the number of pixels within this range yields the number of low-light pixels. Similarly, pixels with values less than a second preset pixel threshold, such as 225, can be considered as high-light pixels in the image. Summing the number of pixels within this range yields the number of high-light pixels. This process, by setting two preset pixel thresholds of different values, enables precise quantification of low-light and high-light pixels in the image, providing accurate pixel count data for subsequent calculations of the proportion of low-light and high-light areas.
[0082] Specifically, based on the total number of pixels in the initial grayscale image, and combining this with the number of low-light and high-light pixels, the corresponding proportions of the low-light and high-light areas can be calculated. For example, the formula for calculating the proportion of the low-light area can be:
[0083]
[0084] in, The proportion of low-light areas, This represents the number of low-light pixels. Illustratively, the formula for calculating the proportion of highlight areas can be:
[0085]
[0086] in, The percentage of the highlight area. This represents the number of highlight pixels. Multiplying the ratio by 100 in the above formula converts the pixel count ratio into a percentage, facilitating subsequent threshold determination. This calculation method transforms the absolute number of low-light and highlight pixels into a relative proportion, effectively eliminating the influence of initial grayscale images of different resolutions and sizes on pixel count statistics. This allows the criteria for determining the proportion of low-light and highlight areas to be adaptable to various initial grayscale image specifications, improving the versatility of exposure state determination.
[0087] Specifically, the grayscale values of all pixels in the initial grayscale image are first summed to obtain the total grayscale value. Then, this sum is divided by the total number of pixels in the initial grayscale image to obtain the average grayscale value. This average grayscale value is a core global indicator representing the overall brightness of the initial grayscale image, reflecting the overall exposure of the image from a macroscopic perspective. In contrast, the previously calculated proportions of low-light and high-light areas only represent the distribution characteristics of local pixels and cannot reflect the overall brightness of the image. Therefore, by combining the average grayscale value, a comprehensive and accurate determination of the image's exposure status can be achieved, avoiding the one-sidedness caused by judging with a single local indicator. The pre-defined optimal grayscale range is the average grayscale range of an image under normal exposure, determined experimentally based on the subsequent image processing requirements extracted from the UAV runway. The minimum and maximum values within this range are the core grayscale boundary for exposure determination. Simultaneously, pre-defined low-light and high-light area proportion thresholds are obtained. These two thresholds serve as percentage benchmarks for determining whether the low-light and high-light areas in the image constitute an excessive proportion, quantifying whether the pixel scale of these areas affects the normal exposure of the image. After obtaining these preset parameters, a comprehensive logical determination can be made by combining the calculated low-light area proportion, high-light area proportion, and average grayscale value.
[0088] To illustrate, when the proportion of low-light areas exceeds the low-light area proportion threshold and the average gray value is less than the minimum value of the optimal gray value range, it indicates that the proportion of pixels in the low-light areas in the initial grayscale image is too high, and the overall brightness of the image is too dark. In this case, the image can be determined to be underexposed. When the proportion of highlight areas exceeds the highlight area proportion threshold and the average gray value is greater than the maximum value of the optimal gray value range, it indicates that the proportion of pixels in the highlight areas in the initial grayscale image is too high, and the overall brightness of the image is too bright. In this case, the image can be determined to be overexposed. Other cases indicate that the proportions of both low-light and highlight areas in the initial grayscale image are within a reasonable range, and the overall brightness meets the requirements for normal exposure. In this case, the image can be determined to be normally exposed. Furthermore, the low-light area proportion threshold and the highlight area proportion threshold can be the same value, such as 20. By combining the local pixel area proportion and the global average gray value in the above comprehensive judgment process, not only are the local pixel distribution characteristics and overall brightness characteristics of the image taken into account, but the deviation of single index judgment is also effectively avoided. It can accurately identify the actual exposure state of the initial grayscale image and provide an accurate judgment basis for subsequent exposure value optimization.
[0089] Furthermore, the original exposure value can be obtained. This original exposure value is the actual exposure parameter value set by the camera on the drone when capturing the original image of the current runway. This parameter value can be directly obtained from the camera's parameter configuration. When the exposure status is determined to be underexposed or overexposed, it indicates that the camera's current original exposure value cannot meet the requirements for normal image exposure. Adaptive optimization is needed based on the corresponding correction formula. For underexposed images, the first correction formula can be used for optimization, which is:
[0090]
[0091] In the formula, For the new exposure value, It is the minimum value in the optimal grayscale value range. Original exposure value Here, is the average grayscale value, and 255 is the maximum grayscale value, serving as the baseline value for grayscale value normalization. The second correction formula used for overexposure can be:
[0092]
[0093] In the formula, It is the maximum value within the optimal grayscale range.
[0094] Both of the above correction formulas can adaptively calculate based on the actual exposure deviation of the image. In cases of underexposure, the difference between the average gray value and the minimum value of the optimal gray value range is calculated, and normalized using the maximum gray value of 255 to obtain a normalization coefficient for the exposure deviation. The original exposure value is then amplified to improve the overall brightness of the image, bringing the average gray value closer to the optimal gray value range. Conversely, in cases of overexposure, the difference between the average gray value and the maximum value of the optimal gray value range is calculated, and normalized using the maximum gray value of 255 to obtain a normalization coefficient for the exposure deviation. The original exposure value is then reduced to decrease the overall brightness of the image, bringing the average gray value back to the optimal gray value range. By adaptively and precisely correcting based on the actual degree of exposure anomalies, this approach can adapt to various exposure anomalies in different scenarios, ensuring the accuracy and adaptability of exposure value optimization. Furthermore, when the exposure status is determined to be normal exposure, the original exposure value can be kept unchanged.
[0095] Finally, using the new exposure value as a benchmark, adaptive brightness adjustments can be made to the grayscale values of each pixel in the initial grayscale image. During the adjustment process, the spatial correspondence of the pixels is followed to ensure that the spatial contour features of the initial grayscale image are not distorted. Through this brightness correction process, the exposure state of the initial grayscale image can be adjusted to a preset normal exposure range, making the overall brightness of the corrected image suitable for the requirements of subsequent image processing. The distribution of pixel grayscale values is within a reasonable range, and the basic brightness and darkness features of the runway, which were weakened due to overexposure or underexposure, are effectively restored and initially highlighted.
[0096] In one embodiment, such as Figure 2 As shown, based on the first grayscale image, adaptive contrast adjustment processing is performed to obtain the second grayscale image, including:
[0097] S201: Calculate the standard deviation of grayscale values based on the grayscale values of each pixel in the first grayscale image.
[0098] Specifically, the standard deviation of grayscale values is a core quantitative indicator characterizing the dispersion of grayscale values across all pixels in an image. The dispersion of pixel grayscale values directly corresponds to the contrast strength of the image. Higher dispersion indicates a greater difference in grayscale values between bright and dark areas, resulting in higher contrast; conversely, lower dispersion indicates a smaller difference in grayscale values between bright and dark areas, resulting in lower contrast. Therefore, the standard deviation of grayscale values can be used as a measure of image contrast. The specific formula for calculating the standard deviation of grayscale values is as follows:
[0099]
[0100] In the formula, To calculate the standard deviation of the grayscale values of the first grayscale image, Let be the grayscale value of any pixel in the first grayscale image. This is the arithmetic mean of the grayscale values of all pixels in the first grayscale image. Let be the total number of pixels in the first grayscale image. This calculation process can be performed by iterating through all pixels in the first grayscale image, first calculating the difference between the grayscale value of each pixel and the overall average grayscale value, then squaring the difference to eliminate positive and negative deviations, then summing all the squaring results, dividing the sum by the total number of pixels in the first grayscale image to obtain the variance of the pixel grayscale values, and finally performing an arithmetic square root operation on the variance to obtain the standard deviation of the grayscale values.
[0101] S202: Obtain the preset normal contrast standard deviation range, compare the grayscale value standard deviation with the normal contrast standard deviation range to determine the contrast status, and obtain the contrast status determination result. The contrast status determination result is any one of the following: contrast too high, contrast too low, or normal contrast.
[0102] Specifically, the preset normal contrast standard deviation range is a numerical range calibrated based on the actual technical requirements of runway extraction during UAV visual-guided landing, combined with experiments in actual scenarios. The minimum and maximum values of this range are the core boundaries for contrast status determination, corresponding to the grayscale standard deviation range when the image contrast is in the optimal state for adapting to subsequent runway feature extraction algorithms. At this point, the grayscale difference between the runway area and the surrounding background area can meet the technical requirements of subsequent edge detection and line segment extraction. Illustratively, the calculated grayscale standard deviation of the first grayscale image can be compared with this preset range. If the grayscale standard deviation is greater than the maximum value of the preset normal contrast standard deviation range, it indicates that the pixel grayscale value dispersion of the first grayscale image is too high, and the grayscale value difference between bright and dark areas in the image exceeds a reasonable range, indicating that the contrast status determination result is too high. If the grayscale standard deviation is less than the minimum value of the preset normal contrast standard deviation range, it indicates that the pixel grayscale value dispersion of the first grayscale image is too low, and the grayscale value difference between bright and dark areas in the image is too small, with the boundary between the runway and the background tending to merge, indicating that the contrast status determination result is too low. If the standard deviation of grayscale values is between the minimum and maximum values of the preset normal contrast standard deviation range, it indicates that the contrast of the first grayscale image is at a normal and reasonable level, and the contrast status determination result can be judged as normal contrast.
[0103] S203: Obtain the current original contrast value. When the contrast status judgment result meets the preset contrast optimization conditions, optimize and adjust the original contrast value based on the standard deviation of grayscale value to obtain a new contrast value.
[0104] Specifically, the original contrast ratio is the actual contrast parameter value configured by the camera on the UAV when acquiring the original image of the current runway. This parameter value can be directly extracted from the camera's hardware parameter configuration module. The preset contrast optimization condition is when the contrast status judgment result is too high or too low, that is, when the grayscale value standard deviation exceeds the preset normal contrast standard deviation range. When this condition is met, a contrast adjustment coefficient can be calculated first, and then the original contrast ratio can be optimized and adjusted based on this coefficient. When the contrast status judgment result is normal contrast, it means that the contrast of the current image does not need to be adjusted, and the original contrast ratio can be directly used as the new contrast ratio output to reduce meaningless calculation operations and improve the overall image processing efficiency. Among them, the contrast adjustment coefficient is the core intermediate parameter for realizing adaptive contrast optimization. It can convert the contrast deviation represented by the grayscale value standard deviation into a quantified parameter adjustment ratio, realizing precise adaptive adjustment of the original contrast ratio, rather than a coarse adjustment of a fixed ratio.
[0105] For example, when the contrast status is determined to be too high and the standard deviation of the grayscale value is greater than the maximum value of the preset normal contrast standard deviation range, the contrast adjustment coefficient is calculated using the first optimization formula. The first optimization formula can be:
[0106]
[0107] In the formula, This is the contrast adjustment coefficient. The standard deviation of the grayscale value. This represents the maximum value within the normal standard deviation range for contrast. To maximize the value, this function ensures that the calculated contrast adjustment coefficient is not less than 0, preventing negative adjustment ratios that could cause the contrast parameter adjustment to fail. This formula quantifies the degree of excessive contrast deviation by calculating the difference between the standard deviation of grayscale values and the maximum value within the normal range. Normalization then converts the deviation into a corresponding adjustment coefficient, allowing the adjustment coefficient to accurately match the actual contrast deviation. When the contrast status is determined to be too low and the standard deviation of grayscale values is less than the minimum value of the preset normal contrast standard deviation range, a second optimized formula can be used to calculate the contrast adjustment coefficient. The second optimized formula is as follows:
[0108]
[0109] In the formula, This is the minimum value within the normal standard deviation range for contrast. To minimize the value, this function ensures that the calculated contrast adjustment coefficient is no greater than 1, preventing excessive contrast adjustment due to an excessively large adjustment coefficient, which could lead to image grayscale distortion. This formula quantifies the degree of low contrast deviation by calculating the ratio of the standard deviation of grayscale values to the minimum value within the normal range. This deviation can be directly converted into a corresponding adjustment coefficient, achieving precise adaptation to low contrast conditions.
[0110] Furthermore, the original contrast value is optimized based on the calculated contrast adjustment coefficient to obtain a new contrast value, as shown in the following formula:
[0111]
[0112] In the formula, The new contrast value obtained after optimization. The camera's current original contrast value. The contrast adjustment coefficient is calculated using either the first or second optimization formula. When the contrast is too high, the calculated adjustment coefficient is greater than 1. Dividing the original contrast value by this coefficient yields a smaller new contrast value, thus reducing the image contrast. When the contrast is too low, the calculated adjustment coefficient is less than 1. Dividing the original contrast value by this coefficient yields a larger new contrast value, thus increasing the image contrast. This formula enables adaptive and precise adjustment of the original contrast value, ensuring that the adjusted contrast matches the actual situation of the image.
[0113] S204: Optimize the contrast of the first grayscale image based on the new contrast value to obtain the second grayscale image.
[0114] Specifically, based on the calculated new contrast value, the dynamic range of pixel grayscale values in the first grayscale image can be adjusted. For example, for a first grayscale image with excessively low contrast, grayscale value stretching can increase the difference in grayscale values between bright and dark areas, enhancing the distinction between the grayscale values of the track edges and the background area, thus making the originally blurry track outline clearer. For a first grayscale image with excessively high contrast, grayscale value compression can reduce the difference in grayscale values between bright and dark areas, preventing the loss of track features caused by grayscale saturation in bright areas or grayscale deficiency in dark areas. Furthermore, during the dynamic range adjustment of grayscale values in the first grayscale image, the spatial correspondence of pixels must be followed to ensure that the spatial outline features of the track in the first grayscale image are not distorted, and the spatial position and shape features of the track are fully preserved. After this contrast optimization process, the contrast of the first grayscale image is precisely adjusted to the preset normal range, the separation between the runway area and the surrounding background area is significantly improved, and the edge layering and contour features of the runway are effectively enhanced. The resulting second grayscale image retains the exposure state optimization features of the first grayscale image and achieves precise contrast state optimization, providing a high-quality image foundation for subsequent image fusion operations with enhanced contrast features. This can effectively improve the recognition accuracy and environmental adaptability of subsequent runway feature extraction algorithms.
[0115] Based on the same inventive concept, this application also provides a runway extraction system based on adaptive exposure and contrast adjustment for implementing the runway extraction method based on adaptive exposure and contrast adjustment described above. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more runway extraction system embodiments based on adaptive exposure and contrast adjustment provided below can be found in the limitations of the runway extraction method based on adaptive exposure and contrast adjustment described above, and will not be repeated here.
[0116] In one exemplary embodiment, such as Figure 3As shown, a runway extraction system 300 based on adaptive exposure and contrast adjustment is provided, including:
[0117] The image acquisition and grayscale conversion module 301 is used to acquire the original runway image during the UAV landing process, and perform grayscale conversion processing on the original runway image to obtain an initial grayscale image.
[0118] The adaptive enhancement processing module 302 is used to perform adaptive exposure adjustment processing based on the initial grayscale image to obtain a first grayscale image; and to perform adaptive contrast adjustment processing based on the first grayscale image to obtain a second grayscale image.
[0119] Image output module 303 is used to combine the first grayscale image and the second grayscale image to output an enhanced and optimized image.
[0120] In one exemplary embodiment, the present invention also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the runway extraction method based on adaptive exposure and contrast adjustment of this application. A multi-core processor is preferred to improve the parallel processing capability of the system. The memory provides sufficient temporary storage space to support program execution and data processing. The memory capacity should be large enough to accommodate large amounts of data and computational tasks.
[0121] In one exemplary embodiment, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the runway extraction method based on adaptive exposure and contrast adjustment of this application. The computer-readable storage medium may include: a read-only memory, a random access memory, a solid-state drive, or an optical disk, etc.
[0122] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.
Claims
1. A method for extracting runways based on adaptive exposure and contrast adjustment, characterized in that, The method includes: Acquire raw images of the runway during the UAV landing process, and perform grayscale conversion on the raw runway images to obtain an initial grayscale image; Based on the initial grayscale image, adaptive exposure adjustment processing is performed to obtain a first grayscale image; based on the first grayscale image, adaptive contrast adjustment processing is performed to obtain a second grayscale image. By combining the first grayscale image and the second grayscale image, an enhanced and optimized image is output.
2. The method according to claim 1, characterized in that, The adaptive exposure adjustment process based on the initial grayscale image to obtain the first grayscale image includes: Based on the initial grayscale image, pixel grayscale values are statistically analyzed to obtain a grayscale histogram that characterizes the distribution features of pixel grayscale values in the initial grayscale image. Obtain the image size parameters of the initial grayscale image, wherein the image size parameters include the number of rows and the number of columns; Based on the image size parameters of the initial grayscale image, the total number of pixels in the initial grayscale image is calculated. The number of pixels with pixel values less than a first preset pixel threshold and a second preset pixel threshold is extracted from the grayscale histogram to obtain the corresponding number of low-light pixels and number of high-light pixels. The second preset pixel threshold is greater than the first preset pixel threshold. Based on the total number of pixels in the initial grayscale image, the corresponding proportions of low-light and high-light regions are calculated by combining the number of low-light pixels and the number of high-light pixels respectively. The average grayscale value is calculated based on the initial grayscale image. Obtain a preset optimal grayscale value range, and based on the proportion of low-light area, the proportion of high-light area, and the average grayscale value, combine the optimal grayscale value range to determine the exposure state and obtain an exposure state determination result. The exposure state determination result is any one of underexposure, overexposure, or normal exposure. Obtain the current original exposure value. When the exposure state determination result meets the corresponding preset exposure optimization conditions, optimize the original exposure value to obtain a new exposure value. The initial grayscale image is then optimized for exposure based on the new exposure value to obtain the first grayscale image.
3. The method according to claim 1, characterized in that, The step of performing adaptive contrast adjustment processing based on the first grayscale image to obtain the second grayscale image includes: The standard deviation of the gray values is calculated based on the gray values of each pixel in the first grayscale image. Obtain a preset normal contrast standard deviation range, compare the gray value standard deviation with the normal contrast standard deviation range to determine the contrast status, and obtain a contrast status determination result. The contrast status determination result is any one of the following: contrast too high, contrast too low, or normal contrast. Obtain the current original contrast value. When the contrast state determination result meets the preset contrast optimization conditions, optimize and adjust the original contrast value based on the gray value standard deviation to obtain a new contrast value. The first grayscale image is optimized for contrast based on the new contrast value to obtain the second grayscale image.
4. The method according to claim 2, characterized in that, When the exposure state determination result, the low-light area proportion, the high-light area proportion, and the average gray value meet the corresponding preset exposure optimization conditions, the original exposure value is optimized to obtain a new exposure value, including: Obtain the preset threshold values for the proportion of low-light areas and the proportion of high-light areas; When the exposure state determination result is underexposure, the original exposure value is optimized using the first correction formula to calculate the new exposure value; wherein, when the proportion of the low-light area is greater than the low-light area proportion threshold and the average gray value is less than the minimum value in the optimal gray value range, the exposure state determination result is underexposure. When the exposure state determination result is overexposure, the original exposure value is optimized using the second correction formula to calculate the new exposure value; wherein, when the proportion of the highlight area is greater than the highlight area proportion threshold and the average gray value is greater than the maximum value in the optimal gray value range, the exposure state determination result is overexposure; When the exposure state determination result is normal exposure, the original exposure value is kept unchanged, and the original exposure value is output as the new exposure value; The first correction formula is: In the formula, For the new exposure value, It is the minimum value within the optimal grayscale value range. The original exposure value, The average gray value; The second corrected formula is: In the formula, It is the maximum value within the optimal grayscale value range.
5. The method according to claim 3, characterized in that, When the contrast state determination result meets the preset contrast optimization conditions, the original contrast value is optimized and adjusted based on the grayscale value standard deviation to obtain a new contrast value, including: When the contrast state determination result meets the preset contrast optimization conditions, the contrast adjustment coefficient is calculated based on the standard deviation of the gray value, and the original contrast value is optimized and adjusted according to the contrast adjustment coefficient to obtain the new contrast value; When the contrast status determination result is the normal contrast, the original contrast value is kept unchanged, and the original contrast value is output as the new contrast value; The contrast adjustment coefficient is obtained through the following steps: When the contrast status determination result is that the contrast is too high, the contrast adjustment coefficient is calculated according to the first optimization formula; When the contrast status determination result is that the contrast is too low, the contrast adjustment coefficient is calculated according to the second optimization formula; The first optimization formula is: In the formula, The contrast adjustment coefficient is... The standard deviation of the grayscale value is... It is the maximum value within the normal contrast standard deviation range; The second optimization formula is: In the formula, It is the minimum value within the normal contrast standard deviation range.
6. The method according to claim 4, characterized in that, Both the low-light region percentage threshold and the high-light region percentage threshold are 20%; The first preset pixel threshold is 30, and the second preset pixel threshold is 225.
7. A runway extraction system based on adaptive exposure and contrast adjustment, characterized in that, The system includes: The image acquisition and grayscale conversion module is used to acquire the original runway image during the UAV landing process, and to perform grayscale conversion processing on the original runway image to obtain an initial grayscale image. An adaptive enhancement processing module is used to perform adaptive exposure adjustment processing based on the initial grayscale image to obtain a first grayscale image; and to perform adaptive contrast adjustment processing based on the first grayscale image to obtain a second grayscale image. The image output module is used to combine the first grayscale image and the second grayscale image to output an enhanced and optimized image.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.