Image processing method and device for rail profile detection
By calculating the exposure time series based on the illuminance sensor and image brightness calibration method, and combining the laser line signal-to-noise ratio and multi-exposure time fusion, the problems of overexposure and underexposure in rail profile detection are solved, the measurement accuracy is improved, and efficient and accurate image processing is achieved.
Patent Information
- Application Number
- CN202511471702.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-15
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-10-15
AI Technical Summary
In existing technologies, rail profile detection methods based on laser triangulation are affected by ambient lighting and complex optical conditions on the rail surface, leading to overexposure and underexposure of images, which reduces the measurement accuracy of indicators such as wear values.
Data acquisition is performed using an illuminance sensor to obtain the ambient illuminance and target grayscale value range. The exposure time series is calculated using a coefficient calibration method for the linear response of image brightness. Combined with the laser line signal-to-noise ratio and image fusion of multiple exposure times, polynomial curve fitting is used for segmentation and denoising to extract the laser centerline image.
It improves the measurement accuracy of rail profile detection, avoids interference from noise in complex environments, obtains high-quality images, solves the problem of abnormal image exposure under single exposure time, and achieves efficient and accurate image processing.
Smart Images

Figure CN120953274B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail maintenance technology, and in particular to an image processing method and apparatus for rail profile detection. Background Technology
[0002] In the field of rail maintenance technology, it is common practice to obtain indicators such as rail wear and wear level by registering the actual rail profile with a standard profile, which is then used to guide rail grinding operations. Machine vision methods based on laser triangulation are a commonly used method for obtaining the actual rail profile, offering advantages such as intelligence and high efficiency. This method uses a line laser source to project laser lines onto the rail surface, simultaneously capturing images containing the laser lines using a camera. Image processing methods are then used to extract the point cloud data of the laser lines from the images.
[0003] However, in actual measurement scenarios, due to interference from ambient lighting conditions and the complex optical conditions of the rail surface (such as quasi-specular reflection, surface pits, and foreign objects), the laser triangulation-based measurement method commonly suffers from local overexposure and underexposure of the laser line in the acquired image. These phenomena lead to significant errors in image processing, resulting in reduced measurement accuracy of indicators such as wear values.
[0004] In the existing technology, there is a lack of an efficient and accurate image processing method for rail profile detection. Summary of the Invention
[0005] To address the technical problems of overexposure and underexposure in machine vision measurement of rail profiles in existing technologies, this invention provides an image processing method and apparatus for rail profile detection. The technical solution is as follows:
[0006] On the one hand, an image processing method for rail profile detection is provided, which is implemented by an image processing device and includes:
[0007] Data is acquired using an illuminance sensor to obtain ambient illuminance; the target grayscale range and laser power of the detected image are obtained.
[0008] The coefficient calibration method based on the linear response of image brightness calculates the exposure time series based on the ambient illumination, target gray value range and laser power; based on the exposure time series, the camera is used to acquire images of the rail surface to obtain a rail profile image containing the laser line.
[0009] Based on the laser line signal-to-noise ratio, the rail profile image is preprocessed to obtain a binarized rail profile image; the laser line width is obtained by counting the pixels with gray values greater than 0 column by column in the binarized rail profile image; based on the preset reference width, the laser line width and the binarized rail profile image are used to perform multi-exposure time image fusion, and the laser center line image is extracted.
[0010] Based on the polynomial curve fitting method, the laser centerline image is segmented and denoised to obtain the rail head centerline image and the rail web centerline image; the rail head centerline image and the rail web centerline image are then stitched together to obtain the processed rail profile image.
[0011] On the other hand, an image processing apparatus for rail profile detection is provided, which is applied to an image processing method for rail profile detection, the apparatus comprising:
[0012] The data acquisition module is used to collect data based on the illuminance sensor to obtain the ambient illuminance; and to obtain the target grayscale value range and laser power of the detected image.
[0013] The image acquisition module is used for coefficient calibration based on the linear response of image brightness. It calculates the exposure time series based on ambient illuminance, target grayscale range and laser power. Based on the exposure time series, the camera is used to acquire images of the rail surface to obtain a rail profile image containing the laser line.
[0014] The centerline extraction module is used to preprocess the rail profile image based on the laser line signal-to-noise ratio to obtain a binarized rail profile image; to obtain the laser line width by counting the pixels with gray values greater than 0 column by column in the binarized rail profile image; and to perform multi-exposure image fusion based on the preset reference width, the laser line width, and the binarized rail profile image to extract the laser centerline image.
[0015] The image processing module is used to segment and denoise the laser centerline image based on the polynomial curve fitting method to obtain the rail head centerline image and the rail web centerline image; the rail head centerline image and the rail web centerline image are then stitched together to obtain the processed rail profile image.
[0016] On the other hand, an image processing apparatus is provided, the image processing apparatus comprising: a processor; and a memory storing computer-readable instructions, which, when executed by the processor, implement any of the above-described image processing methods for rail profile detection.
[0017] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored therein, the at least one instruction being loaded and executed by a processor to implement any of the above-described image processing methods for rail profile detection.
[0018] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:
[0019] This invention proposes an image processing method for rail profile detection. By calculating the normalized signal-to-noise ratio weight and performing noise reduction processing, the obtained laser line image avoids noise interference from complex environments, improving robustness. It introduces an image fusion weight based on the laser line width in the denoised image to determine the original image for different exposure times. Through image fusion, a high-quality image is obtained, compensating for the insufficient information of a single image and solving the problem of abnormal exposure in images acquired at a single exposure time, effectively improving the measurement accuracy of rail wear values. This invention is a highly efficient and accurate image processing method for rail profile detection. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of an image processing method for rail profile detection provided by an embodiment of the present invention;
[0022] Figure 2 This is a schematic diagram of a rail profile detection device based on line laser machine vision provided in an embodiment of the present invention;
[0023] Figure 3 This is a block diagram of an image processing device for rail profile detection provided in an embodiment of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of an image processing device provided in an embodiment of the present invention. Detailed Implementation
[0025] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0026] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0027] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.
[0028] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0029] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0030] This invention provides an image processing method for rail profile detection. This method can be implemented by an image processing device, which can be a terminal or a server. Figure 1 The flowchart shown is for an image processing method used for rail profile detection. The processing flow of this method may include the following steps:
[0031] S1. Data acquisition is performed based on the illuminance sensor to obtain the ambient illuminance; the target grayscale value range and laser power of the detection image are obtained;
[0032] In one feasible implementation, the rail profile detection device based on line laser machine vision used in this invention comprises the following components: Figure 2 As shown, it includes: bracket 1, laser 2, camera 3, illuminance sensor 4, camera 5, laser 6, connecting rod 7, connector 8, support rod 9, computer 10, and rail to be tested 11.
[0033] The computer 10 is connected to the illuminance sensor 4, the camera 3, and the camera 5.
[0034] Lasers 2 and 6 project laser lines onto the rail under test, while cameras 3 and 5 acquire laser line images from both sides at positions relatively inclined to the rail. The relative positions of lasers 2 and 6, and cameras 3 and 5 are fixed.
[0035] Illuminance sensor 4 is used to acquire the illuminance of ambient light in real time and send the illuminance results to computer 10;
[0036] The bracket 1 is placed on the rail to be measured and is connected to the connector 8 and the support rod 9 through the connecting rod 7. The support rod 9 is supported on another rail to ensure the correct relative position between the camera 3 and camera 5 and the rail to be measured during the rail profile measurement process.
[0037] The image processing program installed on the computer 10, on the one hand, selects the exposure time of camera 3 and camera 5 according to the ambient illumination result and the set algorithm, and controls camera 3 and camera 5 to take pictures according to the exposure time; on the other hand, the image processing program processes the images obtained by camera 3 and camera 5 under different exposure time conditions to obtain a fused image, and performs subsequent processing to obtain a high-precision profile curve.
[0038] S2. A coefficient calibration method based on the linear response of image brightness is used to calculate the exposure time series based on the ambient illuminance, target gray value range and laser power. Based on the exposure time series, a camera is used to acquire images of the rail surface to obtain a rail profile image containing the laser line.
[0039] Optionally, a coefficient calibration method based on the linear response of image brightness is used to calculate the exposure time series based on ambient illumination, target grayscale range, and laser power, including:
[0040] Under conditions of no ambient light, the brightness value at the laser line on the rail surface was experimentally measured based on a preset exposure time, and a first brightness value-exposure curve was plotted. The slope of the first brightness value-exposure curve was fitted to obtain the laser contribution coefficient.
[0041] Under conditions without laser illumination, the brightness value at the laser line on the rail surface was experimentally measured based on a preset exposure time, and a second brightness value-exposure curve was plotted. The ambient light coefficient was obtained by fitting the slope of the second brightness value-exposure curve.
[0042] The exposure time series is obtained by calculating based on ambient illuminance, target grayscale range, laser power, laser contribution coefficient, and ambient illuminance coefficient.
[0043] In one feasible implementation, the present invention uses experimental measurements of the brightness values at the laser line in images under different exposure times in the absence of ambient light, and fits a brightness value-exposure time curve. The slope of this curve is the laser contribution term coefficient. .
[0044] This invention uses experimental measurements of the brightness values at the laser line in images taken under different exposure times at ambient illuminance conditions without the laser being turned on. A brightness value-exposure time curve is then fitted, and the slope of this curve represents the ambient illuminance coefficient. .
[0045] According to the exposure time sequence, the computer controls cameras 3 and 5 to perform image acquisition operations, obtaining a set of images containing laser lines corresponding to each exposure time in the time sequence. Image.
[0046] The exposure time series is calculated as follows: (1)
[0047] (1);
[0048] in, , represents the target grayscale value of the k-th frame image. The minimum grayscale value of the underexposed area. The maximum grayscale value of the overexposed area; Laser power; The number of exposure times in the exposure time series; The coefficient for the laser contribution term; This is the ambient light intensity coefficient.
[0049] In one feasible implementation, the exposure time series is calculated as shown in the above formula (1), requiring that the selected exposure time series can cover the region with the lowest reflectivity and the region with the highest reflectivity of the laser line in the captured image.
[0050] S3. Based on the laser line signal-to-noise ratio, preprocess the rail profile image to obtain a binarized rail profile image; count the pixels with gray values greater than 0 column by column in the binarized rail profile image to obtain the laser line width; based on the preset reference width, perform multi-exposure time image fusion based on the laser line width and the binarized rail profile image, and extract the laser center line image.
[0051] Optionally, based on the laser line signal-to-noise ratio, the rail profile image is preprocessed to obtain a binarized rail profile image, including:
[0052] Based on the laser line signal-to-noise ratio, the signal-to-noise ratio weight is calculated according to the gray value of the rail profile image.
[0053] Based on the signal-to-noise ratio weight, grayscale value optimization and noise reduction are performed on the rail profile image to obtain the noise-reduced rail profile image;
[0054] The denoised rail profile image is binarized to obtain a binarized rail profile image.
[0055] In one feasible implementation, since the images acquired in the field experiment will contain a large number of redundant noise points, it is necessary to first calculate the laser line signal-to-noise ratio of the image when calculating the laser line width.
[0056] Calculate the signal-to-noise ratio weight for each image based on the laser line signal-to-noise ratio. The calculation process is as follows (2):
[0057] (2);
[0058] in, For the k-th image at pixel point Signal-to-noise ratio at the location; This is the signal-to-noise ratio weighting adjustment factor.
[0059] Denoising is performed on each image, where the noise level of the k-th image after denoising is calculated at pixel [value missing]. The gray value at the given location is calculated using the following formula (3):
[0060] (3);
[0061] in, For the k-th image after noise reduction, at pixel point The grayscale value at that location; is the original grayscale value of the k-th image.
[0062] Each denoised image is binarized. For each binarized image, the number of pixels with a grayscale value greater than zero in each pixel column is calculated, and this number is used as the laser line width corresponding to that pixel column. For example, the laser line width of the j-th pixel column in the k-th image is represented as... These parameter values are then stored within the computer.
[0063] Among them, the laser line signal-to-noise ratio refers to the ratio of the intensity of the laser line pixels in the rail profile image to the intensity of the background noise fluctuations outside the laser line;
[0064] The laser line signal-to-noise ratio is calculated as follows (4):
[0065] (4);
[0066] in, The image represents the first Line number Column pixels; The pixels of the rail profile image The grayscale value at that location; In pixels Centered The standard deviation of gray values within the neighborhood; This is a preset signal-to-noise ratio calculation constant.
[0067] In one feasible implementation, the signal-to-noise ratio of an image containing laser lines is defined as the ratio of the intensity of the laser line pixels in the image to the fluctuation intensity of the background noise other than the laser lines. Taking one image as an example, the formula for calculating the signal-to-noise ratio is as shown in equation (4) above.
[0068] Optionally, based on a preset reference width, multi-exposure time image fusion is performed according to the laser line width and the binarized rail profile image, and the laser centerline image is extracted, including:
[0069] The pixel fusion weight is calculated based on the laser line width and the preset reference width.
[0070] Based on pixel fusion weights, image fusion processing is performed on the binarized rail profile image under multiple exposure times to obtain the fused rail profile image.
[0071] Image extraction is performed based on the fused rail profile image to obtain the laser centerline image.
[0072] In one possible implementation, the pixel point of each image is calculated. The fusion weight is calculated based on the principle that the smaller the difference between the laser line width and the reference width, the higher the laser line image quality, and the greater the corresponding fusion weight. The calculation process is as follows (5):
[0073] (5);
[0074] in, Let be the laser line width of the j-th pixel column in the k-th image; For reference, the laser line width can be taken as the average value of the laser line width of all pixel columns in a certain image; This is the laser linewidth weighting adjustment factor; is the weighted fusion constant.
[0075] Calculate the grayscale values for image fusion. For example, the final fused image at pixel points... grayscale value at for:
[0076] (6);
[0077] Laser line extraction is performed on the fused image, including filtering, image segmentation, edge detection, and centerline extraction.
[0078] S4. Based on the polynomial curve fitting method, the laser centerline image is segmented and denoised to obtain the rail head centerline image and the rail web centerline image; the rail head centerline image and the rail web centerline image are stitched together to obtain the processed rail profile image.
[0079] Optionally, segmentation and denoising processing is performed on the laser centerline image to obtain the rail head centerline image and the rail web centerline image, including:
[0080] The laser centerline image is used to identify abnormal regions in laser line width, and images of abnormal regions are obtained.
[0081] Based on the polynomial curve fitting method, abnormal pixels are removed from the images of abnormal regions to obtain the images after removing abnormal regions.
[0082] Based on the image after removing abnormal regions, the region growing method is used for segmentation and denoising to obtain the centerline image of the rail head and the centerline image of the rail web.
[0083] In one feasible implementation, the laser line width of the statistically fused image is used, and... The criteria identify the column coordinates of pixels with abnormal laser line widths, merge consecutive abnormal pixel column coordinates into a single region, and mark the column coordinates of the starting pixel of each abnormal region. and the column coordinates of the terminating pixel .
[0084] For the pixel coordinates on the laser line in the image Pixels within a certain range are fitted with a polynomial curve, and then pixels within that region that are more than a certain distance from the fitted curve are removed. The number of pixels is 100, which eliminates the influence of abnormal laser line width on the center line extraction result.
[0085] The rail head and rail web portions within the centerline are segmented, and outlier noise in both portions is removed using the region growing method. The specific steps are as follows:
[0086] Sort all pixel grayscale values of the merged image in descending order, find the pixel with the largest current grayscale value, and use the nearest neighbor of this pixel on the center line as the seed point S.
[0087] Centered on seed point S, The neighborhood radius (can be taken as...) The process involves adding pixels located in the neighborhood along the center line to the neighborhood and using them as new seed points. This diffusion process continues until no new seed points can be found. All pixels found in this growth process are then marked as a cluster.
[0088] If the number of pixels contained in the cluster is greater than If so, then this cluster is output as the centerline of the railhead (or rail web) section. The value is the number of pixels on the center line of the laser line head (or rail) section obtained under normal lighting conditions.
[0089] If the number of pixels contained in the cluster is less than or equal to If the cluster is removed from the set of pixels along the center line, then that cluster is removed.
[0090] The rail head centerline image and the rail web centerline image obtained by camera 3 and camera 5 are stitched together to obtain the final rail profile curve.
[0091] This invention proposes an image processing method for rail profile detection. By calculating the normalized signal-to-noise ratio weight and performing noise reduction processing, the obtained laser line image surface avoids noise interference from complex environments, improving robustness. An image fusion weight is introduced based on the laser line width in the denoised image to determine the original image fusion weight for different exposure times. High-quality images are obtained through image fusion, compensating for the insufficient information of a single image and solving the problem of abnormal exposure in images acquired at a single exposure time, effectively improving the measurement accuracy of rail wear values. This invention is a highly efficient and accurate image processing method for rail profile detection.
[0092] Figure 3 This is a block diagram of an image processing device for rail profile detection provided in an embodiment of the present invention. The device is used for an image processing method for rail profile detection. (Refer to...) Figure 3 The device includes a data acquisition module 310, an image acquisition module 320, a centerline extraction module 330, and an image processing module 340. Among them:
[0093] The data acquisition module 310 is used to acquire data based on the illuminance sensor to obtain the ambient illuminance; and to acquire the target grayscale value range and laser power of the detected image.
[0094] The image acquisition module 320 is used for a coefficient calibration method based on the linear response of image brightness. It calculates the exposure time series based on the ambient illuminance, target gray value range and laser power. Based on the exposure time series, the camera is used to acquire images of the rail surface to obtain a rail profile image containing the laser line.
[0095] The centerline extraction module 330 is used to preprocess the rail profile image based on the laser line signal-to-noise ratio to obtain a binarized rail profile image; to obtain the laser line width by counting the pixels with gray values greater than 0 column by column according to the binarized rail profile image; and to perform multi-exposure time image fusion based on the preset reference width, the laser line width and the binarized rail profile image, and extract the laser centerline image.
[0096] The image processing module 340 is used to perform segmentation and noise reduction processing on the laser centerline image based on the polynomial curve fitting method to obtain the rail head centerline image and the rail web centerline image; and to stitch the rail head centerline image and the rail web centerline image together to obtain the processed rail profile image.
[0097] Optionally, the image acquisition module 320 is further used for:
[0098] Under conditions of no ambient light, the brightness value at the laser line on the rail surface was experimentally measured based on a preset exposure time, and a first brightness value-exposure curve was plotted. The slope of the first brightness value-exposure curve was fitted to obtain the laser contribution coefficient.
[0099] Under conditions without laser illumination, the brightness value at the laser line on the rail surface was experimentally measured based on a preset exposure time, and a second brightness value-exposure curve was plotted. The ambient light coefficient was obtained by fitting the slope of the second brightness value-exposure curve.
[0100] The exposure time series is obtained by calculating based on ambient illuminance, target grayscale range, laser power, laser contribution coefficient, and ambient illuminance coefficient.
[0101] The exposure time series is calculated as follows: (1)
[0102] (1);
[0103] in, , represents the target grayscale value of the k-th frame image. The minimum grayscale value of the underexposed area. The maximum grayscale value of the overexposed area; Laser power; The number of exposure times in the exposure time series; The coefficient for the laser contribution term; This is the ambient light intensity coefficient.
[0104] Optionally, the centerline extraction module 330 is further used for:
[0105] Based on the laser line signal-to-noise ratio, the signal-to-noise ratio weight is calculated according to the gray value of the rail profile image.
[0106] Based on the signal-to-noise ratio weight, grayscale value optimization and noise reduction are performed on the rail profile image to obtain the noise-reduced rail profile image;
[0107] The denoised rail profile image is binarized to obtain a binarized rail profile image.
[0108] Among them, the laser line signal-to-noise ratio refers to the ratio of the intensity of the laser line pixels in the rail profile image to the intensity of the background noise fluctuations outside the laser line;
[0109] The laser line signal-to-noise ratio is calculated as follows (2):
[0110] (2);
[0111] in, The image represents the first Line number Column pixels; The pixels of the rail profile image The grayscale value at that location; In pixels Centered The standard deviation of gray values within the neighborhood; This is a preset signal-to-noise ratio calculation constant.
[0112] Optionally, the centerline extraction module 330 is further used for:
[0113] The pixel fusion weight is calculated based on the laser line width and the preset reference width.
[0114] Based on pixel fusion weights, image fusion processing is performed on the binarized rail profile image under multiple exposure times to obtain the fused rail profile image.
[0115] Image extraction is performed based on the fused rail profile image to obtain the laser centerline image.
[0116] Optionally, the image processing module 340 is further used for:
[0117] The laser centerline image is used to identify abnormal regions in laser line width, and images of abnormal regions are obtained.
[0118] Based on the polynomial curve fitting method, abnormal pixels are removed from the abnormal region image to obtain the image after removing the abnormal region.
[0119] Based on the image after removing abnormal regions, the region growing method is used for segmentation and denoising to obtain the centerline image of the rail head and the centerline image of the rail web.
[0120] This invention proposes an image processing method for rail profile detection. By calculating the normalized signal-to-noise ratio weight and performing noise reduction processing, the obtained laser line image surface avoids noise interference from complex environments, improving robustness. An image fusion weight is introduced based on the laser line width in the denoised image to determine the original image fusion weight for different exposure times. High-quality images are obtained through image fusion, compensating for the insufficient information of a single image and solving the problem of abnormal exposure in images acquired at a single exposure time, effectively improving the measurement accuracy of rail wear values. This invention is a highly efficient and accurate image processing method for rail profile detection.
[0121] Figure 4 This is a schematic diagram of the structure of an image processing device provided in an embodiment of the present invention, such as... Figure 4 As shown, the image processing device may include the above-mentioned Figure 3 The image processing apparatus shown is for detecting the profile of a rail. Optionally, the image processing apparatus 410 may include a first processor 2001.
[0122] Optionally, the image processing device 410 may also include a memory 2002 and a transceiver 2003.
[0123] The first processor 2001, memory 2002, and transceiver 2003 can be connected via a communication bus.
[0124] The following is combined Figure 4 A detailed description of each component of the image processing device 410 is provided below:
[0125] The first processor 2001 is the control center of the image processing device 410. It can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).
[0126] Optionally, the first processor 2001 can perform various functions of the image processing device 410 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.
[0127] In a specific implementation, as one example, the first processor 2001 may include one or more CPUs, for example... Figure 4 CPU0 and CPU1 are shown in the diagram.
[0128] In a specific implementation, as one example, the image processing device 410 may also include multiple processors, for example... Figure 4 The first processor 2001 and the second processor 2004 are shown in the diagram. Each of these processors can be a single-core processor or a multi-core processor. Here, a processor can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).
[0129] The memory 2002 is used to store the software program that executes the present invention, and is controlled by the first processor 2001 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.
[0130] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 2002 may be integrated with the first processor 2001 or may exist independently and be connected via the interface circuit of the image processing device 410. Figure 4 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.
[0131] The transceiver 2003 is used to communicate with network devices or with terminal devices.
[0132] Alternatively, transceiver 2003 may include a receiver and a transmitter. Figure 4 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.
[0133] Optionally, the transceiver 2003 can be integrated with the first processor 2001, or it can exist independently and be connected to the interface circuit of the image processing device 410. Figure 4 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.
[0134] It should be noted that, Figure 4 The structure of the image processing device 410 shown does not constitute a limitation on the router. Actual image processing devices may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0135] Furthermore, the technical effects of the image processing device 410 can be referred to the technical effects of the image processing method for rail profile detection described in the above method embodiments, and will not be repeated here.
[0136] It should be understood that the first processor 2001 in the embodiments of the present invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or it may be any conventional processor, etc.
[0137] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0138] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0139] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0140] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.
[0141] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0142] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0143] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0144] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0145] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0146] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0147] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0148] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An image processing method for rail profile detection, characterized in that, The method includes: Data is acquired using an illuminance sensor to obtain ambient illuminance; the target grayscale range and laser power of the detected image are obtained. The coefficient calibration method based on the linear response of image brightness calculates the exposure time series based on the ambient illumination, target gray value range and laser power; based on the exposure time series, the camera is used to acquire images of the rail surface to obtain a rail profile image containing the laser line. The coefficient calibration method based on the linear response of image brightness calculates the exposure time series based on ambient illumination, target grayscale range, and laser power, including: Under conditions of no ambient light, the brightness value at the laser line on the rail surface was experimentally measured based on a preset exposure time, and a first brightness value-exposure curve was plotted. The slope of the first brightness value-exposure curve was fitted to obtain the laser contribution coefficient. Under conditions without laser illumination, the brightness value at the laser line on the rail surface was experimentally measured based on a preset exposure time, and a second brightness value-exposure curve was plotted. The ambient light coefficient was obtained by fitting the slope of the second brightness value-exposure curve. The exposure time series is obtained by calculating based on ambient illuminance, target grayscale range, laser power, laser contribution coefficient, and ambient illuminance coefficient. Based on the laser line signal-to-noise ratio, the rail profile image is preprocessed to obtain a binarized rail profile image. The laser line width is obtained by statistically analyzing the pixels with grayscale values greater than 0 in each column of the binarized rail profile image. Based on a preset reference width, multi-exposure time image fusion is performed using the laser line width and the binarized rail profile image, and the laser centerline image is extracted, including: The pixel fusion weight is calculated based on the laser line width and the preset reference width. Based on pixel fusion weights, image fusion processing is performed on the binarized rail profile image under multiple exposure times to obtain the fused rail profile image. Image extraction is performed based on the fused rail profile image to obtain the laser centerline image; Based on the polynomial curve fitting method, the laser centerline image is segmented and denoised to obtain the rail head centerline image and the rail web centerline image; the rail head centerline image and the rail web centerline image are then stitched together to obtain the processed rail profile image.
2. The image processing method for rail profile detection according to claim 1, characterized in that, The process of preprocessing the rail profile image based on the laser line signal-to-noise ratio to obtain a binarized rail profile image includes: Based on the laser line signal-to-noise ratio, the signal-to-noise ratio weight is calculated according to the gray value of the rail profile image. Based on the signal-to-noise ratio weight, grayscale value optimization and noise reduction are performed on the rail profile image to obtain the noise-reduced rail profile image; The denoised rail profile image is binarized to obtain a binarized rail profile image.
3. The image processing method for rail profile detection according to claim 2, characterized in that, The laser line signal-to-noise ratio refers to the ratio of the intensity of the laser line pixels in the rail profile image to the intensity of background noise fluctuations outside the laser line.
4. The image processing method for rail profile detection according to claim 1, characterized in that, The polynomial curve fitting method is used to segment and denoise the laser centerline image to obtain the rail head centerline image and the rail waist centerline image, including: The laser centerline image is used to identify abnormal regions in laser line width, and images of abnormal regions are obtained. Based on the polynomial curve fitting method, abnormal pixels are removed from the abnormal region image to obtain the image after removing the abnormal region. Based on the image after removing abnormal regions, the region growing method is used for segmentation and denoising to obtain the centerline image of the rail head and the centerline image of the rail web.
5. An image processing apparatus for rail profile detection, wherein the image processing apparatus for rail profile detection is used to implement the image processing method for rail profile detection as described in any one of claims 1-4, characterized in that, The device includes: The data acquisition module is used to collect data based on the illuminance sensor to obtain the ambient illuminance; and to obtain the target grayscale value range and laser power of the detected image. The image acquisition module is used for coefficient calibration based on the linear response of image brightness. It calculates the exposure time series based on ambient illuminance, target grayscale range and laser power. Based on the exposure time series, the camera is used to acquire images of the rail surface to obtain a rail profile image containing the laser line. The coefficient calibration method based on the linear response of image brightness calculates the exposure time series based on ambient illumination, target grayscale range, and laser power, including: Under conditions of no ambient light, the brightness value at the laser line on the rail surface was experimentally measured based on a preset exposure time, and a first brightness value-exposure curve was plotted. The slope of the first brightness value-exposure curve was fitted to obtain the laser contribution coefficient. Under conditions without laser illumination, the brightness value at the laser line on the rail surface was experimentally measured based on a preset exposure time, and a second brightness value-exposure curve was plotted. The ambient light coefficient was obtained by fitting the slope of the second brightness value-exposure curve. The exposure time series is obtained by calculating based on ambient illuminance, target grayscale range, laser power, laser contribution coefficient, and ambient illuminance coefficient. The centerline extraction module is used to preprocess the rail profile image based on the laser line signal-to-noise ratio to obtain a binarized rail profile image; to obtain the laser line width by counting the pixels with grayscale values greater than 0 column by column in the binarized rail profile image; and to perform multi-exposure image fusion based on a preset reference width, the laser line width, and the binarized rail profile image to extract the laser centerline image, including: The pixel fusion weight is calculated based on the laser line width and the preset reference width. Based on pixel fusion weights, image fusion processing is performed on the binarized rail profile image under multiple exposure times to obtain the fused rail profile image. Image extraction is performed based on the fused rail profile image to obtain the laser centerline image; The image processing module is used to segment and denoise the laser centerline image based on the polynomial curve fitting method to obtain the rail head centerline image and the rail web centerline image; the rail head centerline image and the rail web centerline image are then stitched together to obtain the processed rail profile image.
6. An image processing device, characterized in that, The image processing device includes: processor; A memory storing computer-readable instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Visible light image detector test and demonstration verification platform and method for aerospace
CN109243268A
Steel rail profile detection method and device
CN111369484A
Binocular multi-exposure steel rail visual perception method and device
CN120235862A