Turnout switch rail detection method, device, equipment and medium

By using the AIC-CLAHE algorithm with adaptive illumination compensation and the improved YOLOv11 model, the image quality problem of turnout switch detection under complex lighting conditions was solved, achieving high-precision turnout switch detection and improving the accuracy and reliability of the detection.

CN121837089APending Publication Date: 2026-04-10TRAFFIC CONTROL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing machine vision-based turnout switch rail detection methods are not adaptable to complex lighting conditions, resulting in decreased image quality and affecting detection accuracy.

Method used

The AIC-CLAHE algorithm with adaptive illumination compensation is used to process turnout switch rail images. By dividing the image into blocks, filtering normal illumination blocks, calculating dynamic reference brightness, constructing a nonlinear mapping function to adjust the contrast threshold, and combining the YOLOv11 model and the improved bounding box regression loss function, adaptive illumination compensation and high-precision detection are achieved.

Benefits of technology

It effectively improved the image quality of turnout switch rails, solved the problems of detail loss and noise amplification under complex lighting conditions, improved the accuracy and reliability of detection, and ensured the safety of train operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837089A_ABST
    Figure CN121837089A_ABST
Patent Text Reader

Abstract

The invention provides a turnout switch rail detection method, device and equipment and a medium, and the method comprises the steps: collecting a turnout switch rail image, and carrying out the detail enhancement processing of the turnout switch rail image based on an AIC-CLAHE algorithm for realizing adaptive illumination compensation, and the processing process comprises the steps: segmenting the turnout switch rail image into a plurality of image blocks, extracting illumination brightness information of each image block, screening out a first image block with normal illumination according to a variance range of a set normal illumination image block, and taking an average value of the illumination brightness of the first image block as global reference brightness; determining a second image block with over-exposed or over-dark brightness according to the global reference brightness; determining a contrast limit threshold of the second image block based on a nonlinear mapping function according to the brightness information of the second image block, performing histogram equalization operation on the second sub-image blocks, and finally fusing the sub-image blocks to obtain a contrast-enhanced turnout switch rail image. And inputting into the target detection model to obtain a turnout switch rail detection result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to a turnout point rail detection method, device, equipment and medium. BACKGROUND

[0002] The state of the turnout point rail directly affects the safety of train operation, and its wear, deformation or position deviation can cause serious accidents such as train derailment. Therefore, accurate identification of the state of the turnout point rail is a core task of railway maintenance. At present, the detection of turnout point rail mainly relies on manual inspection and monitoring devices based on sensors. Manual inspection is inefficient and is greatly affected by the experience and responsibility of the inspectors, and is prone to missed detection at night or in bad weather; monitoring devices based on sensors such as pressure sensors and displacement sensors require the installation of special equipment on the turnout structure, which is difficult to modify, has high cost, and is easily affected by track vibration, resulting in data drift and high maintenance cost.

[0003] With the development of machine vision technology, image-based turnout point rail detection methods have gradually become a research hotspot. The existing Chinese patent CN119831855A discloses “an infrared image enhancement method based on CLAHE”, which applies the Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm to image enhancement, and improves the image contrast through block histogram equalization. This method has certain advantages in low-illumination image processing, but it has the following limitations in the scene of detecting turnout point rail: In the scene of detecting turnout point rail in rail transit, the image quality is significantly affected by the light, and the light difference between open-air and tunnel environment easily leads to overexposure or overdarkness of the turnout image. The use of a fixed contrast limit threshold cannot adapt to the sudden change of light in open-air and tunnel environment, which easily leads to blurred details of the point rail edge in the overexposed area and amplifies noise in the overdark area, affecting the identification of local details. The contrast limited self-CLAHE algorithm in the above-mentioned existing patent enhances the local contrast by histogram equalization of the image block, which is commonly used for low-illumination and high-noise image enhancement. However, in the scene of detecting turnout point rail, the existing CLAHE algorithm does not consider the dynamic change of light, and the static clipping threshold easily causes loss of details or amplification of noise in extreme light (overexposure / overdarkness), making it difficult to adapt to the complex light requirements of turnout point rail images.

[0004] (II) The enhancement strategy is not designed for the specific texture features of turnout point rail, and the enhanced image may have “block effect”, which interferes with the recognition of the point rail profile.

[0005] Therefore, it is necessary to provide an improved scheme that can solve the obvious defects in the adaptability of the existing machine vision-based turnout point rail detection method to complex light and can also optimize the image quality. Summary of the Invention

[0006] To overcome the problems existing in the related technologies, this disclosure provides a method, device, equipment and medium for detecting turnout switch rails, so as to solve the technical problems in the related technologies.

[0007] This specification provides one or more embodiments of a turnout switch rail detection method, including the following steps: Images of the turnout switch rails are acquired using a camera array at the front of the train. The images are then enhanced with details using the AIC-CLAHE algorithm, which provides adaptive illumination compensation. The processing steps include: The switch point rail image is segmented into multiple image blocks of equal size. The illumination information of each image block is extracted. The first image block with normal illumination is selected based on the variance range of the normally illuminated image blocks, and the average illumination of the first image block is taken as the global reference brightness. Based on the global reference brightness, the brightness variance of each image block is determined to identify overexposed or underexposed image blocks, thus obtaining the second image blocks. Then, based on the brightness information of the second image blocks and the constructed nonlinear mapping function, the contrast limit threshold of the second image blocks is determined. Each second sub-image block is cropped by the histogram corresponding to the contrast limit to constrain the enhancement amplitude. The histogram equalization operation of the second sub-image blocks is performed. Finally, the sub-image blocks are merged to obtain the contrast-enhanced switch point rail image. The enhanced switch point rail image is then input into the trained target detection model to obtain the switch point rail detection results.

[0008] Furthermore, the specific steps for detail enhancement processing of the turnout switch rail image based on the AIC-CLAHE algorithm for adaptive illumination compensation are as follows: Image block segmentation and brightness channel extraction steps: Divide the turnout switch rail image into several image blocks of equal size, convert them to YUV color space, and extract the brightness channel as the object of illumination analysis; The dynamic reference brightness calculation steps include image block parameter calculation, normal image block selection, and dynamic reference brightness calculation; Image patch parameter calculation: Calculate the average brightness of each image patch. and brightness variance ; Normal image patch filtering: The brightness variance range of normal lighting image patches is set based on prior data. Filter out The image block shown is the first image block with normal lighting. Calculate the dynamic reference brightness: For the first image patch under all normal lighting, take the average brightness of the first image patch. The statistical average value is used as the global reference brightness; Image patch illumination classification steps: For each first image patch, compare its... and , and Determine the lighting type, including overexposed and underexposed image blocks, to obtain the second image block. The determination conditions are as follows: The overexposed image patch meets the following conditions: and ; Darker image patches meet the following conditions: and ; Dynamic contrast limit threshold calculation steps: For second image blocks with different lighting types, a non-linear threshold mapping function with reference to global reference brightness is constructed, and the contrast limit threshold of each pixel in the second image block is adjusted to achieve adaptive adjustment of the contrast limit factor. Image block equalization and fusion steps: For each second image block, first perform histogram cropping with contrast limitation to constrain the enhancement amplitude and perform histogram equalization operation, then fuse all image blocks to obtain the contrast-enhanced turnout switch rail image.

[0009] Furthermore, the contrast limiting threshold mapping function is as follows: ; In the formula, This is the index of the sub-block's position within the entire image. Based on the threshold, This is the light sensitivity coefficient. For located Brightness value of the character block For reference brightness, The maximum value of the brightness channel of the current turnout switch rail image is given, where W and H are the image block sizes and G is the number of gray levels.

[0010] Furthermore, the method for fusing the sub-image blocks uses bilinear interpolation to achieve the fusion of the sub-image blocks.

[0011] Furthermore, the target detection model is the YOLOv11 model, and the loss function is a bounding box regression loss function based on the fusion of Alpha-IoU and SIoU.

[0012] This specification provides one or more embodiments of a turnout switch rail detection device, comprising: The image acquisition module is used to acquire images of the switch points via a camera array at the front of the train. The image processing module is used to perform detail enhancement processing on the switch point rail image based on the AIC-CLAHE algorithm for adaptive illumination compensation; the processing includes: The switch point rail image is segmented into multiple image blocks of equal size. The illumination information of each image block is extracted. The first image block with normal illumination is selected based on the variance range of the normally illuminated image blocks, and the average illumination of the first image block is taken as the global reference brightness. Based on the global reference brightness, the brightness variance of each image block is determined to identify overexposed or underexposed image blocks, thus obtaining the second image blocks. Then, based on the brightness information of the second image blocks and the constructed nonlinear mapping function, the contrast limit threshold of the second image blocks is determined. Each second sub-image block is cropped by the histogram corresponding to the contrast limit to constrain the enhancement amplitude. The histogram equalization operation of the second sub-image blocks is performed. Finally, the sub-image blocks are merged to obtain the contrast-enhanced switch point rail image. The target detection module is used to input the enhanced turnout switch rail image into the trained target detection model to obtain the turnout switch rail detection results.

[0013] Furthermore, the image processing module includes a segmentation and brightness extraction unit, a dynamic reference brightness calculation unit, a sub-block level illumination classification unit, a dynamic contrast limit threshold calculation unit, and a sub-block equalization and fusion unit. The segmentation and brightness extraction unit is used to divide the turnout switch rail image into several image blocks of equal size, convert them to the YUV color space, and extract the brightness channel as the object of illumination analysis. The dynamic reference brightness calculation unit is used to calculate the average brightness of each image patch. and brightness variance The range of brightness variance for normally lit image blocks is set using prior data. Filter out The image block is the first image block with normal illumination. For all first image blocks with normal illumination, its... The statistical average value is used as the global reference brightness. ; Sub-block level illumination classification unit, used to compare each first image block with its... and , and The lighting type is determined, including overexposed and underexposed image blocks, to obtain a second image block, and the determination conditions are as follows: The overexposed image patch meets the following conditions: and ; Darker image patches meet the following conditions: and ; The dynamic contrast limit threshold calculation unit is used to construct a non-linear threshold mapping function that references the global reference brightness for the second image block under different lighting conditions, and adjust the contrast limit threshold of each pixel in the second image block. The sub-block equalization and fusion unit is used to first perform histogram cropping with contrast-limited histogram to constrain the enhancement amplitude and perform histogram equalization on each second image block, and then fuse all image blocks to obtain the contrast-enhanced turnout switch rail image.

[0014] Furthermore, the contrast limiting threshold mapping function is as follows: ; In the formula, This is the index of the sub-block's position within the entire image. Based on the threshold, This is the light sensitivity coefficient. For located Brightness value of the character block For reference brightness, The maximum value of the brightness channel of the current turnout switch rail image is given, where W and H are the image block sizes and G is the number of gray levels.

[0015] This specification provides one or more embodiments of a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the turnout switch detection method as described in any of the preceding embodiments.

[0016] This specification provides one or more embodiments of a computer-readable storage medium storing a computer program that, when executed by a processor, implements the turnout switch detection method as described in any of the preceding claims.

[0017] The disclosure provides a turnout rail detection method, device, equipment and medium, which has the advantages that for each collected image, an AIC-CLAHE algorithm is used based on a traditional CLAHE algorithm, which is a contrast enhancement technique for image preprocessing. The algorithm reduces the amplification of noise by limiting the contrast amplification in the histogram equalization process. A local light perception mechanism is introduced to analyze the light of the brightness channel of each image block. The image blocks with normal light are selected according to the set variance range of the normal light image blocks, and the average value of the light brightness of these image blocks is taken as the global reference brightness. The overexposed and overdark image blocks are selected according to the global reference brightness. For these image blocks, the corresponding contrast limiting threshold is determined based on the constructed nonlinear mapping function according to the brightness information of the image blocks, and the local details are enhanced. In this way, not only the brightness information of the current region is considered, but also the brightness information of the entire image is considered. The local light perception mechanism is introduced to realize image block level dynamic threshold adjustment, form a complete light adaptive compensation mechanism, solve the problem of detail loss and noise amplification caused by overexposure or overdarkness of the turnout rail image under complex light, break through the limitation of the fixed threshold of the traditional CLAHE algorithm, effectively preserve the image details, and improve the image quality. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the one or more embodiments of the present specification or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present specification, and other drawings can also be obtained by those skilled in the art without creative labor.

[0019] Figure 1 A flowchart of a turnout rail detection method provided for one or more embodiments of the present specification; Figure 2 A flowchart of a turnout rail detection method provided for one or more embodiments of the present specification; Figure 3 A block diagram of a turnout rail detection device provided for one or more embodiments of the present specification; Figure 4 A structural schematic block diagram of an image processing module provided for one or more embodiments of the present specification; Figure 5 A structural schematic diagram of a computer device provided for one or more embodiments of the present specification. DETAILED DESCRIPTION

[0020] In order to make the person skilled in the art better understand the technical solutions in one or more embodiments of the present specification, the technical solutions in one or more embodiments of the present specification will be described clearly and completely in the following with reference to the drawings in one or more embodiments of the present specification. Obviously, the described embodiments are only a part of the embodiments of the present specification, not all. Based on one or more embodiments of the present specification, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the present application.

[0021] The present application will be described in detail below in conjunction with the specific embodiments and the drawings of the specification.

[0022] Method embodiments According to the embodiments of the present application, a turnout rail detection method is provided, as shown in Figure 1 and Figure 2 , the flow chart of the turnout rail detection method provided for the present embodiment, Figure 1 the flow structure chart of the turnout rail detection method provided for the present embodiment, according to the turnout rail detection method of the embodiments of the present application, comprising: Figure 2 Step S1, the turnout rail image is collected by the train front camera group, the AIC-CLAHE algorithm for realizing adaptive illumination compensation is used for detail enhancement processing of the turnout rail image, and the processing process includes: The turnout rail image is divided into multiple equal-size image blocks, the illumination brightness information of each image block is extracted, the first image block with normal illumination is selected according to the set variance range of the normal illumination image block, and the average value of the illumination brightness of the first image block is taken as the global reference brightness; the brightness variance of each image block is determined according to the global reference brightness to determine the overexposed or overdark image block, and the second image block is obtained; then the contrast limit threshold of the second image block is determined based on the constructed nonlinear mapping function according to the brightness information of the second image block, the contrast limit factor of the second image block is adaptively adjusted, each second sub-image block is clipped by the corresponding contrast limit histogram to constrain the enhancement amplitude, the second sub-image block histogram equalization operation is performed, and finally each sub-image block is fused to obtain the contrast-enhanced turnout rail image; Step S2, the enhanced turnout rail image is input into the trained target detection model to obtain the turnout rail detection result.

[0023] ​The turnout frog detection method provided in the embodiment is used for each frame of image collected, and an improved CLAHE algorithm (AIC-CLAHE algorithm) is used based on a traditional CLAHE algorithm. The algorithm is a contrast enhancement technique for image preprocessing, which reduces the amplification of noise by limiting the contrast amplification in the histogram equalization process. A local light perception mechanism is introduced, the luminance channel of each image block is extracted for light analysis, the image blocks with normal light are screened out according to the set variance range of the normal light image block, the average value of the light luminance of the image blocks is taken as the global reference luminance, and the overexposed and overdark image blocks are screened out according to the global reference luminance, so that the accurate classification of the light type is realized, the deviation of the enhanced object is ensured, and the sub-blocks are accurately divided into overexposed and overdark sub-blocks based on the sub-block luminance mean and luminance variance. In the turnout image, the frog may span the "overexposed area (open sky reflection), normal area (middle part), and overdark area (track bed shadow)", the classification logic of the method can accurately divide all the sub-blocks where the frog is located according to the light type, and there is no "missing classification and wrong classification". During subsequent enhancement, each local part of the frog can obtain an adaptive threshold value, so that the profile break caused by misclassification is avoided. Moreover, the classification logic of the method can establish an adaptive "normal light reference" for each frame. The global reference luminance is not a fixed value, but dynamically changes with the actual light conditions of the current frame. Then, the image blocks obtained are enhanced in the local details according to the luminance information of the image blocks, and a corresponding contrast limiting threshold value is determined based on the constructed nonlinear mapping function, so that the luminance information of the current region and the luminance information of the entire image are considered, the local light perception mechanism is introduced to realize the image block level dynamic threshold adjustment, a complete light adaptive compensation mechanism is formed, the problems of detail loss and noise amplification caused by overexposure or overdark of the turnout frog image under complex light are solved, the limitation of the fixed threshold value of the traditional CLAHE algorithm is broken through, the image details are effectively preserved, and the image quality is improved. When the adjustment coefficient is calculated, only the luminance information of the current region is used, the real light characteristics of the current region can be more accurately adapted, irrelevant information interference is avoided, and the threshold value is bound with the actual light intensity.

[0024] In the embodiment, the fusion of each sub-image block in step S1 is specifically implemented by a bilinear interpolation method, which not only ensures the continuity of the turnout frog image, but also avoids the "block effect" of the segmented image, and naturally connects the regions after local enhancement.

[0025] In the embodiment, the specific steps of the AIC-CLAHE algorithm for realizing adaptive light compensation and performing detail enhancement processing on the turnout frog image are as follows. Step S11, image block division and luminance channel extraction; The switch rail image is divided into several equal-sized image blocks, converted to YUV color space, and the luminance channel (Y channel) is extracted as the light analysis object.

[0026] Step S12, dynamic reference luminance Calculation; Image block parameter calculation: calculate the luminance mean of each image block and luminance variance , wherein the luminance variance reflects the discrete degree of the image block grayscale distribution, and the variance of the overexposed / underexposed area is extremely low because the grayscale is concentrated in the highlight or dark part.

[0027] Normal image block screening: set the luminance variance range of the normal light image block through prior data , screen out image blocks, which are the first image blocks with normal light; wherein the prior data is obtained by statistical analysis of a large number of normal light switch rail images.

[0028] In this embodiment, since the normal light of the switch rail image has no fixed value, it is affected by the weather and tunnel lighting, and the reference luminance is dynamically determined through the image block parameter calculation and normal image block screening steps of the photographed switch rail image. The solution solves the problem that the switch image is affected by strong light in the open air, tunnel shadow, etc., and there is no fixed normal light standard. The dynamic determination of the reference luminance can avoid the limitations of fixed values, accurately match the actual lighting environment of the current frame, and through the screening of normal image blocks, the luminance mean is calculated as the reference, which can eliminate the extreme luminance influence of overexposed / underexposed blocks, and ensure that the reference luminance is the real normal light level of the current frame, rather than a false value biased by extreme areas.

[0029] Calculation of dynamic reference luminance: for all first image blocks with normal light, take the statistical average of as the global reference luminance , which represents the normal light anchor point of the entire image, and is used for the light deviation of the subsequent comparison image blocks.

[0030] Step S13, image block light classification: for each first image block, compare its with , and to determine the light type, including overexposed image blocks and underexposed image blocks, obtain the second image blocks, and the judgment conditions are as follows: Overexposed image blocks meet the conditions: and , that is, the grayscale is concentrated in the highlight area, such as the switch rail under strong light in the open air; Underexposed image blocks meet the conditions: and , that is, the grayscale is concentrated in the dark part, such as the switch rail in the tunnel shadow. In this embodiment, the above judgment conditions are designed based on the nature of the gray-level distribution of an image caused by illumination. The average brightness directly reflects the overall illumination intensity of a sub-block. Overexposed blocks, due to strong illumination, have an overall brightness much higher than the normal illumination baseline of the current frame, while underexposed blocks, due to insufficient illumination, have an overall brightness much lower than the normal illumination baseline. The sub-block brightness variance reflects the dispersion of the gray-level distribution within the sub-block. The gray-level of overexposed blocks is almost concentrated in the highlight area, with no obvious difference between light and dark, resulting in extremely low variance. Similarly, the gray-level of underexposed blocks is concentrated in the shadow area, also with no difference between light and dark, and extremely low variance. The combination of these two factors perfectly matches the actual performance of overexposed / underexposed blocks in a turnout scene. In addition, from the perspective of the actual application scenario of turnout switch rail detection, these three categories cover all the requirements of turnout detection. Theoretically, there may be special blocks that are not overexposed / not underexposed / abnormal, but they can also be handled through neighbor block correlation verification. For example, if the L_block of a certain block is close to L_ref, but the V_block is far beyond V_max, it is determined to be a noise interference block. The threshold is not calculated separately, but the threshold of the adjacent normal block is referenced for fine adjustment to avoid the enhancement out of control due to local noise.

[0031] Step S14, Dynamic contrast limit threshold calculation: For the second image block under different lighting types, a nonlinear threshold mapping function referencing the global reference brightness is constructed to adjust the contrast limit threshold of each pixel in the second image block, thereby adaptively adjusting the contrast limit factor, improving the contrast between high and low brightness areas, and enhancing the identifiability of minor defects in the image. The contrast limit threshold mapping function is as follows: ; In the formula, This is the index of the sub-block's position within the entire image. Based on the threshold, This is the light sensitivity coefficient. For located Brightness value of the character block For reference brightness, The maximum value of the brightness channel of the current turnout switch rail image is the reference parameter used to normalize the brightness deviation. W and H are the image block size, and G is the gray level.

[0032] Step S14, Image Patch Equalization and Fusion: For each second image patch, first use contrast-limited histogram cropping to constrain the enhancement amplitude, then perform histogram equalization to enhance local details, and finally fuse all image patches through bilinear interpolation to obtain the contrast-enhanced switch rail image, ensuring the continuity of the switch rail image, avoiding block effects, and allowing the locally enhanced areas to connect naturally.

[0033] In this embodiment, the target detection model uses the YOLO model, preferably the YOLOv11 model.

[0034] However, the IoU loss function used in the existing model has difficulty in accurately fitting the narrow and long geometry and specific installation angle of the switch tongue when detecting the switch tongue, has limitations in high-precision regression and direction constraint, resulting in low recognition accuracy, and does not consider the diversity of the installation angle of the switch tongue. When the switch tongue and the track are distributed at a non-right angle, the prediction box is prone to directional deviation, resulting in increased positioning error.

[0035] Therefore, the loss function of the YOLOv11 model is also optimized in the embodiment, and an Alpha-SIoU boundary box regression loss function based on the fusion of Alpha-IoU and SIoU is used. The advantages of the two are combined to strengthen the shape and position fine-tuning of the high overlap area, and the fitting of the direction of the switch tongue is optimized through angle, distance and shape triple constraints, which significantly improves the accuracy of the boundary box regression of the switch tongue, thereby improving the accuracy and reliability of the switch tongue state recognition; wherein, Alpha-IoU amplifies the loss of high IoU samples (such as prediction boxes and real boxes with high overlap) by a power parameter Constructing loss The core advantage is to exponentially amplify the loss of high IoU samples (such as prediction boxes and real boxes with high overlap), forcing the model to focus on fine-tuning of the switch tongue boundary box, adapting to the demand for high-precision positioning, and enhancing the robustness to annotation noise.

[0036] SIoU optimizes the regression loss through angle loss, distance loss and shape loss triple constraints based on IoU, especially through angle loss to explicitly correct the directional deviation of the switch tongue due to the installation angle, solving the problem of consistent width-height ratio but wrong direction in the traditional IoU loss; After the fusion of the two, the shape and position fine-tuning of the high overlap area are strengthened by Alpha-IoU, and the fitting of the direction of the switch tongue is constrained by SIoU, improving the regression accuracy from the angle-distance-shape three dimensions, providing more accurate supervision signals for the YOLOv11 model to detect the switch tongue. The Alpha-SIoU loss function is as follows: ; In the formula, represents the distance loss obtained by the angle loss, represents the shape loss.

[0037] The use of the Alpha-SIoU loss function in the embodiment realizes multi-dimensional optimization from the overlap area to the angle-distance-shape, strengthens the fine-tuning of the boundary box, and corrects the directional deviation, making up for the limitations of the traditional IoU in narrow and long target detection.

[0038] The method provided by the embodiment forms a complete technical chain covering preprocessing to detection through the cooperative design of the image enhancement-loss function, solves the fragmentation problem of single-link optimization in the prior art, is an improved scheme considering image quality optimization and high-precision target positioning, improves the accuracy and reliability of turnout point rail detection, and provides a strong guarantee for rail transit safety.

[0039] Device embodiment According to the embodiment of the present application, a turnout point rail detection device is provided, as shown in the figure, the device provided by the embodiment includes: Figure 3 As shown in the figure, the device provided by the embodiment is a block diagram of a turnout point rail detection device, according to the device provided by the embodiment, the device includes: An image acquisition module 10 is configured to acquire a turnout point rail image through a train front camera group, An image processing module 20 is configured to perform detail enhancement processing on the turnout point rail image based on an AIC-CLAHE algorithm for realizing adaptive illumination compensation, wherein the processing process includes: The turnout point rail image is divided into a plurality of image blocks of equal size, the illumination intensity information of each image block is extracted, the first image block with normal illumination is selected according to the set variance range of the normal illumination image block, and the average value of the illumination intensity of the first image block is taken as the global reference brightness; the brightness variance of each image block is determined according to the global reference brightness to determine the image block with overexposure or overdarkness, and the second image block is obtained; the contrast limit threshold of the second image block is determined based on the constructed nonlinear mapping function according to the brightness information of the second image block, the contrast limit factor of the second image block is adaptively adjusted, each second sub-image block is clipped through the corresponding contrast limit histogram to constrain the enhancement amplitude, the second sub-image block histogram equalization operation is performed, and finally each sub-image block is fused to obtain the contrast-enhanced turnout point rail image; A target detection module 30 is configured to input the enhanced turnout point rail image into a trained target detection model to obtain a turnout point rail detection result.

[0040] The turnout frog detection device provided by the embodiment is used for each frame of image collected by the image acquisition module 10, and the image processing module 20 is based on the traditional CLAHE algorithm and through the improved CLAHE algorithm (AIC-CLAHE algorithm). The algorithm is a contrast enhancement technique for image preprocessing. The algorithm reduces the amplification of noise by limiting the contrast amplification in the histogram equalization process. The local light perception mechanism is introduced. The luminance channel of each image block is extracted for light analysis. The image blocks with normal light are screened out according to the set variance range of the normal light image block. The average value of the light luminance of the image blocks is taken as the global reference luminance. The overexposed and overdark image blocks are screened out according to the global reference luminance. According to the luminance information of the image block itself, the corresponding contrast limiting threshold is determined based on the constructed nonlinear mapping function, and the local details are enhanced. In this way, not only the luminance information of the current region is considered, but also the luminance information of the whole image is considered. The local light perception mechanism is introduced to realize the dynamic threshold adjustment at the image block level. A complete light adaptive compensation mechanism is formed. The problem of detail loss and noise amplification caused by the overexposure or overdarkness of the turnout frog image under complex light is solved. The limitation of the fixed threshold of the traditional CLAHE algorithm is broken through. The image details are effectively preserved, and the image quality is improved.

[0041] In the embodiment, as shown in the structure schematic block diagram of the image processing module 20 provided by the embodiment, the image processing module 20 includes a division and luminance extraction unit, a dynamic reference luminance calculation unit, a sub-block level light classification unit, a dynamic contrast limiting threshold calculation unit and a sub-block equalization and fusion unit. Figure 4 The division and luminance extraction unit is used for dividing the turnout frog image into a plurality of equal-size image blocks, converting to the YUV color space and extracting the luminance channel as the light analysis object. The dynamic reference luminance calculation unit is used for calculating the luminance mean value and the luminance variance of each image block. The luminance variance range of the normal light image block is set through the prior data. The image blocks are screened out. The statistical average value of the first image block is taken as the global reference luminance . The sub-block level light classification unit is used for comparing the and , and of each first image block, judging the light type, including the overexposed image block and the overdark image block, obtaining the second image block, and the judgment condition is as follows: The overexposed image block satisfies the condition: and That is, the grayscale is concentrated in the highlight area, such as the switch point rail under strong open-air light; Darker image patches meet the following conditions: and This means that the grayscale is concentrated in the dark area, such as the switch point rail in the shadow of a tunnel.

[0042] The dynamic contrast limit threshold calculation unit is used to construct a non-linear threshold mapping function referencing the global reference brightness for second image blocks under different lighting types. This adjusts the contrast limit threshold of each pixel in the second image block, achieving adaptive adjustment of the contrast limit factor. This improves the contrast between high and low brightness areas and enhances the identifiability of minor defects in the image. The contrast limit threshold mapping function is as follows: ; In the formula, This is the index of the sub-block's position within the entire image. Based on the threshold, This is the light sensitivity coefficient. For located Brightness value of the character block For reference brightness, The maximum value of the brightness channel of the current turnout switch rail image is the reference parameter used to normalize the brightness deviation. W and H are the image block size, and G is the gray level.

[0043] The sub-block equalization and fusion unit is used to first crop the histogram of the contrast limit determined by the dynamic contrast limit threshold calculation unit for each second image block to constrain the enhancement amplitude, perform histogram equalization operation to enhance local details, and finally fuse all image blocks through bilinear interpolation to obtain the contrast-enhanced switch rail image, ensuring the continuity of the switch rail image, avoiding block effects, and allowing the locally enhanced areas to connect naturally.

[0044] In this embodiment, the target detection model uses the YOLO model, preferably the YOLOv11 model.

[0045] This embodiment also optimizes the loss function of the YOLOv11 model, using a bounding box regression loss function (Alpha-SIoU) based on the fusion of Alpha-IoU and SIoU. Alpha-IoU is determined by a power parameter. Constructing loss SIoU, based on IoU, optimizes the regression loss through triple constraints of angle loss, distance loss, and shape loss. The Alpha-SIoU loss function is shown below: ; In the formula, This represents the distance loss obtained through angle loss. representing shape loss.

[0046] The embodiment of the present application is a device corresponding to the above-mentioned method embodiment, and the specific operation of each module processing step can be understood with reference to the description of the method embodiment, which will not be repeated here.

[0047] As shown in Figure 5 The present application also provides a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the turnout frog detection method in the above-mentioned embodiment when executing the computer program.

[0048] The present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the turnout frog detection method in the above-mentioned embodiment, and the computer program is executed by the processor to implement the following method steps: Step S1, the turnout frog image is collected by the train front camera group, the AIC-CLAHE algorithm for realizing adaptive illumination compensation is used for detail enhancement processing of the turnout frog image, and the processing process includes: The turnout frog image is divided into a plurality of image blocks of equal size, the illumination brightness information of each image block is extracted, the first image block with normal illumination is screened out according to the set variance range of the normal illumination image block, and the average value of the illumination brightness of the first image block is taken as the global reference brightness; the second image block with overexposure or overdarkness is determined according to the global reference brightness; the contrast limit threshold of the second image block is determined based on the constructed nonlinear mapping function according to the brightness information of the second image block, the contrast limit factor of the second image block is adaptively adjusted, each second sub-image block is clipped through the corresponding contrast limit histogram to constrain the enhancement amplitude, the second sub-image block histogram equalization operation is performed, and finally each sub-image block is fused to obtain the contrast-enhanced turnout frog image; Step S2, the enhanced turnout frog image is input into the trained target detection model to obtain the turnout frog detection result.

[0049] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0050] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device or system embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts can be referred to the part of the method embodiments. The above-described device and system embodiments are only illustrative, and the units described as separate components can be or can not be physically separated, and the components displayed as units can be or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0051] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can still be modified, or some or all of the technical features can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and the contents not described in detail in the specification of the present application are the known technology of those skilled in the art.

Claims

1. A method of detecting a switch blade, characterized by, Comprising the following steps: The switch tongue image is segmented into multiple image blocks of equal size, the illumination brightness information of each image block is extracted, the first image block with normal illumination is selected according to the set variance range of the normal illumination image block, and the average value of the illumination brightness of the first image block is taken as the global reference brightness; the brightness variance of each image block is determined according to the global reference brightness to determine the overexposed or overdarkened image block, and the second image block is obtained; then, the contrast limit threshold of the second image block is determined based on the constructed nonlinear mapping function according to the brightness information of the second image block, the contrast limit factor of the second image block is adaptively adjusted, each second sub-image block is clipped through the corresponding contrast limit histogram to constrain the enhancement amplitude, the second sub-image block is histogram equalized, and finally each sub-image block is fused to obtain the switch tongue image after contrast enhancement. The enhanced switch tongue image is input into the trained target detection model to obtain the switch tongue detection result. The specific steps of the AIC-CLAHE algorithm based on adaptive illumination compensation for detail enhancement processing of the switch tongue image are as follows:

2. The method of detecting a switch rail according to claim 1, wherein Image block division and brightness channel extraction step: divide the switch tongue image into several image blocks of equal size, convert to YUV color space, and extract the brightness channel as the illumination analysis object; Dynamic reference brightness calculation step, including image block parameter calculation, normal image block screening and dynamic reference brightness calculation; Dynamic contrast limit threshold calculation step: for different illumination types of the second image block, a nonlinear threshold mapping function is constructed based on the global reference brightness, the contrast limit threshold of each pixel of the second image block is adjusted, and the contrast limit factor is adaptively adjusted; Image block parameter calculation: Calculate the mean of the luminance of each image block and the variance of the luminance ; Normal image block screening: set the brightness variance range of normal illumination image block by prior data , screen out image block, first image block with normal illumination Compute dynamic reference luminance: for all normally illuminated first image blocks, take the statistical mean of the luminance mean of the first image block as the global reference luminance Compute dynamic reference luminance: for all normally illuminated first image blocks, take the statistical mean of the luminance mean of the first image block as the global reference luminance Image block light classification step: for each first image block, compare it with and , and to determine the light type, including overexposed image blocks and overdark image blocks, obtain the second image block, and the determination conditions are as follows: The overexposed image block satisfies the condition: and ; a dark image block satisfies the condition: and ; Image block equalization and fusion step: each second image block is first clipped through the contrast limit histogram to constrain the enhancement amplitude and histogram equalized, and then all image blocks are fused to obtain the switch tongue image after contrast enhancement. The contrast limit threshold mapping function is as follows:

3. A method of detecting a switch blade according to either one of claims 1 or 2, characterized in that, The method of fusing each sub-image block uses a bilinear interpolation method to fuse each sub-image block. ; wherein, is the position index of the sub-block in the whole image, is the base threshold, is the light sensitivity coefficient, is the luminance value of the word block at is the reference luminance, is the maximum value of the current switch tongue image luminance channel, W and H are the image block size, and G is the number of gray levels.​ 4. The method of claim 1, wherein, The target detection model is a YOLOv11 model, and the loss function is a bounding box regression loss function based on the fusion of Alpha-IoU and SIoU.

5. The method of claim 1, wherein, Comprising:

6. A switch blade detection device, characterized in that An image acquisition module for acquiring a switch tongue image through a train front camera group, An image processing module for detail enhancement processing of the switch tongue image based on an AIC-CLAHE algorithm for adaptive illumination compensation; wherein the processing process comprises: ​ The switch rail image is divided into multiple equal-sized image blocks, the illumination brightness information of each image block is extracted, the first image block with normal illumination is screened out according to the set variance range of the normal illumination image block, and the average value of the illumination brightness of the first image block is taken as the global reference brightness; the brightness variance of each image block is determined according to the global reference brightness to determine the overexposed or overdarkened image block, and the second image block is obtained; then the contrast limit threshold of the second image block is determined based on the constructed nonlinear mapping function according to the brightness information of the second image block, the contrast limit factor of the second image block is adaptively adjusted, each second sub-image block is clipped through the corresponding contrast limit histogram to constrain the enhancement amplitude, the second sub-image block is histogram equalized, and finally each sub-image block is fused to obtain the switch rail image after contrast enhancement; The target detection module is configured to input the enhanced switch rail image into the trained target detection model to obtain a switch rail detection result.

7. A switch blade detection device as claimed in claim 6, characterised in that, The image processing module includes a division and brightness extraction unit, a dynamic reference brightness calculation unit, a sub-block level illumination classification unit, a dynamic contrast limit threshold calculation unit, and a sub-block equalization and fusion unit. The division and brightness extraction unit is configured to divide the switch rail image into a plurality of equal-sized image blocks, convert the image blocks to the YUV color space, and extract the brightness channel as the illumination analysis object. a dynamic reference brightness calculation unit for calculating the brightness mean value of each image block and the brightness variance , setting the brightness variance range of the normal illumination image block through prior data , screening out the image block, taking the statistical average value of the first image block as the global reference brightness of all normal illumination first image blocks ; a sub-block level illumination classification unit for comparing each first image block with and , and to determine the illumination type, including overexposed image blocks and underexposed image blocks, obtaining second image blocks, and determining the following conditions: The overexposed image block satisfies the condition: and ; a dark image block satisfies the condition: and ; The dynamic contrast limit threshold calculation unit is configured to construct a nonlinear threshold mapping function with reference to the global reference brightness for the second image blocks of different illumination types, and adjust the contrast limit threshold of each pixel of the second image blocks. The sub-block equalization and fusion unit is configured to clip each second image block through the contrast limit histogram to constrain the enhancement amplitude and perform histogram equalization, and then fuse all the image blocks to obtain the switch rail image after contrast enhancement.

8. A switch blade detection device according to any one of claims 6-7, characterized in that, The contrast limit threshold mapping function is as follows: ; In the formula, This is the index of the sub-block's position within the entire image. Based on the threshold, This is the light sensitivity coefficient. For located Brightness value of the character block For reference brightness, The maximum value of the brightness channel of the current turnout switch rail image is given, where W and H are the image block sizes and G is the number of gray levels.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the switch rail detection method according to any one of claims 1 to 5.

10. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program is executed by the processor to implement the switch rail detection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Infrared image enhancement method based on CLAHE

    CN119831855A