A finger plate misalignment fault detection method and system based on machine vision
Through the finger-shaped plate misalignment fault detection method based on machine vision, image processing and deep learning models are used to solve the problems of low credibility and reduced accuracy of finger-shaped plate misalignment detection in the existing technology, and improve the fault detection rate. and security.
Patent Information
- Application Number
- CN202411074260.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-08-07
AI Technical Summary
The existing technology lacks intelligent detection methods, resulting in finger plate misalignment fault detection relying on manual inspection, which has problems of low reliability, reduced accuracy and potential safety hazards.
The finger plate misalignment fault detection method based on machine vision is adopted. By acquiring and processing the finger plate image on the track beam, the target detection model is used for binary processing and pixel image analysis to calculate the finger width and gap width, combined with the depth. The learning model is used to determine the misalignment of finger-shaped plates to reduce the impact of light and rust.
It improves the fault detection rate, reduces labor costs, enhances the reliability of train maintenance and safe driving, and avoids the problem of reduced judgment accuracy caused by light and rust in traditional methods.
Smart Images

Figure CN118587221B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rail vehicle detection, and more particularly to a finger plate misalignment fault detection method and system based on machine vision. Background Art
[0002] The straddle-type monorail train is a type of urban rail transit that has many advantages, such as strong adaptability, low noise, small turning radius, and strong climbing ability. The straddle-type monorail train runs on the track beam. The upper surface of the track beam is the running surface for the monorail train to run; the side surface is the stabilizing surface and the guiding surface. The steering wheels and stabilizing wheels of the monorail train clamp the track from both sides to stabilize the train on the track beam. The finger plate is a component that connects adjacent track beams. When the train is running, the steering wheels and stabilizing wheels will press over the finger plate. Therefore, the misalignment detection of the finger plate is a routine operation of the daily inspection of the track beam. The purpose is to ensure that the fingers of the finger plate are not seriously misaligned, thereby damaging the train tires, so as to ensure the normal operation of the train on the track.
[0003] At present, there is not much experience in the operation of straddle-type monorails in China, and maintenance work mainly relies on manpower. There is a lack of experience in intelligent detection, especially for the automated detection technology of finger-plate misalignment. Traditionally, the detection of finger-plates is done by operators using flashlights, observing with the human eye, and combining personal experience to make judgments. Due to the long track mileage, the large number of finger-plates, and the difficulty in quantitatively checking misalignment, workers are prone to visual fatigue or miss detection due to personal misjudgment, which may bring potential safety hazards. Therefore, it is an important task to study the automated detection of finger-plate misalignment to replace manual inspections.
[0004] Existing methods, such as Chinese patent application with publication number CN117405669A, discloses a method for detecting the docking status of a movable finger plate of a straddle-type monorail turnout. The invention collects images of the finger plate and the fixed end of the PC beam being fully fitted and not fitted, and separately creates data sets, which are put into the yolov5 network for training. The network is then used to judge the status of the finger plate. This method only uses a target detection network for judgment, which is completely based on a deep learning black box, and does not perform quantitative analysis on the indicators of finger plate misalignment. The result has low credibility, and the network is limited by the production and parameter adjustment of the data set. When the finger plate undergoes a large state change, such as rust, and the image imaging undergoes a large change, such as a change in lighting, resulting in the image to be predicted being inconsistent with the image in the data set, the accuracy of the target detection network will be greatly reduced. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a finger plate misalignment fault detection method and system based on machine vision. This finger plate misalignment fault detection targets the stable surface and the guide surface, which greatly saves labor costs and greatly improves the fault detection rate compared to traditional manual detection, playing an important role in the maintenance and safe driving of trains.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A finger plate misalignment fault detection method based on machine vision comprises the following steps:
[0008] The finger pattern plate image acquisition step is to acquire an image with a portion of the finger pattern plate taken obliquely downward after being illuminated by light, and to stitch the image together to obtain a complete finger pattern plate image;
[0009] The finger pattern plate image processing step is to search the finger domain of the finger pattern plate image through the target detection model, and obtain a pixel image by binarization processing of the finger domain;
[0010] A regional pixel screening step, selecting a portion of columns in the pixel map, calculating the length of each row of white portion pixels in the portion of columns as the row pixel length, marking the white portion rows whose row pixel lengths are within a specified pixel length range, and calculating the pixel width of each row of the white portion rows as the actual finger width;
[0011] The regional pixel comparison step compares the actual finger width with the finger width threshold of the finger template at the corresponding position in the target detection model, and outputs a misalignment instruction or a normal instruction according to the comparison result.
[0012] Furthermore, the partial columns are 100 columns in the middle part of the pixel image.
[0013] Furthermore, in the regional pixel screening step, the pixel map is drawn into a line graph based on the actual finger width of the white part pixels and the black part pixels, the horizontal coordinate in the line graph reflects the width of the pixel column, the vertical coordinate in the line graph reflects the total pixel value of the pixel row, the vertical coordinate of the black part pixels in the line graph is zero, and the horizontal line segments at the vertices in the line graph reflect the actual finger width.
[0014] Furthermore, in the regional pixel comparison step, a target image is screened in the target detection model according to the finger pattern plate image, the pixel width of each finger of the finger pattern plate exposed in the image is calculated according to the target image, a finger width threshold is set according to the pixel width, and the finger width threshold of each finger is superimposed on the actual finger width in the line graph in the form of a threshold line to obtain the degree of overlap. If the threshold line corresponding to the finger width threshold covers the vertex horizontal line segment, a normal instruction is output, otherwise, a misalignment instruction is output.
[0015] Furthermore, the regional pixel screening step also includes a regional pixel correction sub-step.
[0016] The regional pixel correction sub-step obtains the white portion row, extracts two horizontal boundaries in the white portion row, calculates the slopes of the two horizontal boundaries, and if the slope is non-zero, draws a standard horizontal edge line using a number of outermost points on the horizontal edge as edge points, expands and fills the white portion row according to the standard horizontal edge line to obtain a white portion correction row, and measures the actual finger width according to the white portion correction line.
[0017] Furthermore, the regional pixel comparison step also includes a regional pixel feedback sub-step.
[0018] In the regional pixel feedback sub-step, the pixel width of the black part row between each two adjacent white part correction rows is calculated based on the white part correction row in the pixel image as the gap width, and the gap width is compared with the finger plate gap at the corresponding position in the target detection model, and feedback is given based on the comparison result to verify whether the finger plate is misaligned.
[0019] Furthermore, it also includes the step of constructing a target detection model, segmenting several finger plate images acquired historically to obtain partial images of the retained fingers, annotating the partial images of the retained fingers to form a data set, dividing the data set into a training set, a test set and a validation set in a certain ratio, and training the training set, the test set and the validation set through a deep learning neural network to obtain a target detection model.
[0020] Furthermore, the finger plate image acquisition step acquires a visual image taken obliquely downward after being illuminated by light, calculates the pixel sum of the entire column in each visual image, compares the pixel sum with a preset threshold, selects pixels smaller than the preset threshold and the corresponding visual image as the target image, and selects an image with a partial finger plate for splicing according to the position of the seam between the rail beams in the target image.
[0021] Furthermore, it also includes a finger plate misalignment estimation step, in which a misalignment model of the finger plate is trained based on historical data, wherein the misalignment model includes a misalignment distance and image pixels, and the misalignment distance corresponds to image pixels one-to-one. The pixel map is substituted into the misalignment model to obtain the misalignment distance, and the actual misalignment distance is obtained by subtracting the misalignment distance from the standard distance.
[0022] A finger plate misalignment fault detection system based on machine vision, comprising:
[0023] The finger pattern plate image acquisition module acquires an image with a portion of the finger pattern plate taken obliquely downward after being illuminated by light, and stitches it together to obtain a complete finger pattern plate image;
[0024] A finger pattern plate image processing module searches for a finger domain on the finger pattern plate image through a target detection model, and obtains a pixel image by binarization processing on the finger domain;
[0025] A regional pixel screening module selects a portion of columns in the pixel map, calculates the length of each row of white portion pixels in the portion of columns as the row pixel length, marks the white portion rows whose row pixel lengths are within a specified pixel length range, and calculates the pixel width of each row of the white portion rows as the actual finger width;
[0026] The regional pixel comparison module compares the actual finger width with the finger width threshold of the finger template at the corresponding position in the target detection model, and outputs a misalignment instruction or a normal instruction according to the comparison result.
[0027] The beneficial effects of the present invention are as follows: by performing black and white processing on the image and judging whether the finger plate is misaligned by comparing pixels, compared with the comparison of traditional deep learning models, it can avoid the influence of rust on the finger plate or external light that leads to reduced judgment accuracy. In addition, the intelligent detection method for finger plate misalignment failures on the stabilizing surface and the guiding surface greatly improves and saves labor costs compared with traditional manual detection, greatly improves the fault detection rate, and plays an important role in the maintenance and safe driving of trains. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is the overall flow chart of the present invention;
[0029] Figure 2 is the pixel map in the present invention;
[0030] Figure 3 It is the target detection model construction diagram in the present invention;
[0031] Figure 4 is a line graph in the present invention;
[0032] Figure 5 It is the unstaggered diagram in the present invention;
[0033] Figure 6 It is the staggered diagram in the present invention. DETAILED DESCRIPTION
[0034] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. The same parts are represented by the same reference numerals. It should be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the accompanying drawings, and the words "bottom surface" and "top surface", "inner" and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.
[0035] Since there is not much experience in the operation of straddle-type monorails in China, maintenance work mainly relies on manpower, and there is a lack of intelligent detection experience, especially the automated detection technology for finger plate misalignment is still blank. The existing method only uses a target detection network for judgment, which is completely based on the black box of deep learning, and does not quantitatively analyze the indicators of finger plate misalignment. The result has low credibility, and the network is limited by the production and parameter adjustment of the data set. When the finger plate undergoes a large state change, such as rust, the image imaging undergoes a large change, such as light changes, etc., resulting in the image to be predicted being inconsistent with the image in the data set, the accuracy of the target detection network will be greatly reduced; therefore, the present invention designs this finger plate misalignment fault detection method based on machine vision, which includes the following steps:
[0036] like Figure 3 As shown, the target detection model construction steps are to segment several finger template images obtained historically to obtain partial images of the retained finger, annotate the partial images of the retained finger to form a data set, divide the data set into a training set, a test set and a validation set in a certain ratio, and train the training set, the test set and the validation set through a deep learning neural network to obtain a target detection model;
[0037] The finger-type plate is usually located between adjacent track beams. Since light cannot penetrate the gap between the track beams, the entire gap is closer to black than other parts of the image. The present invention includes a four-way camera, wherein in the pictures taken by the three-way and four-way cameras, by calculating the sum of the pixel values of the entire column of the image, the image where the gap between the track beams is located can be found by finding the part that is less than the set threshold value. If the gap between the beams is on the left side of the image, the finger-type plate is in the image and the previous image; if the gap between the beams is on the right side of the image, the finger-type plate is in the image and the next image. By naming the images, the corresponding two pictures are found in the one-way and two-way cameras, and they are horizontally spliced to obtain an image containing the complete finger-type plate from a top-down angle. The part of the middle finger of the finger-type plate in the image is marked to form a data set, which is put into the yolov8 network for training to obtain a target detection model for detecting fingers.
[0038] like Figure 1 As shown,
[0039] The finger plate image acquisition step obtains a visual image taken obliquely downward after lighting (this image must be an image after lighting, and only after lighting can the finger plate be distinguished, which is convenient for subsequent image processing), calculates the pixel sum of the entire column in the visual image in the image taken by the three-way and four-way cameras, compares the pixel sum with a preset threshold, selects pixels smaller than the preset threshold and the corresponding visual image as the target image, selects the image with part of the finger plate for stitching according to the position of the seam between the track beams in the target image, and specifically, finds the name of the image containing the finger plate in the image taken by the three-way and four-way cameras, finds the corresponding two images in the one-way and two-way cameras, and stitches them horizontally to form a complete image containing the finger plate.
[0040] The steps of processing the finger-pattern plate image are to search the finger domain through the target detection model, and obtain the pixel map through binarization. Specifically, all the pictures containing the complete finger-pattern plate are placed in the images folder, and the pictures in the images folder are placed in the target detection model. The area where the finger is located in each picture is detected, and the txt file of the target detection result is saved in the txts folder. For each finger-pattern plate, the misalignment is judged, and the finger area is found through the original image and the target detection result. Opencv is used for traditional image processing, and median filtering is used for denoising. Then the image after denoising is sharpened, and the image is binarized by adaptive binarization method, in which the upper surface of the exposed finger is white and the rest is black. The binarized image is corroded to eliminate the error pixels caused by the threshold selection of binarization, and then the kernel of the same size is used for expansion to restore the original pixel distribution in the image.
[0041] The regional pixel screening step selects some columns in the pixel map (some columns are 100 columns in the middle part of the pixel map), as follows Figure 2 As shown in the figure, the pixel value of the black part is 0, and the pixel value of the white part is 255. The length of the white part pixels in each row in the partial column is calculated as the row pixel length, and the white part rows whose row pixel length is within the specified pixel length range are marked. That is, when a row is all white, the sum of the pixel values is 25500. The pixel width of the white part row whose pixel sum is 25500 is calculated as the actual finger width, then Figure 2 In the figure, the actual finger widths of the three white rows from top to bottom are 93, 36 and 17.
[0042] like Figure 4As shown, a line graph is drawn based on the actual finger width of the white pixels and the black pixels. The horizontal axis in the line graph reflects the width of the pixel column (i.e., the actual finger width and the width of the black part), and the vertical axis in the line graph reflects the total pixel value of the pixel row. The vertical coordinate of the black pixels in the line graph is zero, and the horizontal line segments at the vertices in the line graph reflect the actual finger width. Recording in the line graph is more conducive to subsequent misalignment comparisons, and for the detection of n finger plates, the line graph is more conducive to recording and preservation. The line graph can more intuitively reflect the data of the actual finger width.
[0043] The regional pixel screening step also includes a regional pixel correction sub-step. The regional pixel correction sub-step can obtain the white part row and extract two horizontal boundaries in the white part row (i.e., the upper boundary line and the lower boundary line of the white part row). Since the image of the finger plate illuminated by light is prone to the boundary between the upper surface of some fingers and the gap being difficult to determine, and when some stains appear on the upper surface of the finger, the brightness of the visual image after light illumination is not bright white, so by calculating the slopes of the two horizontal boundaries, the two horizontal boundaries may exist: a straight line, an oblique line, and an irregular arc. If the slope is non-zero, the horizontal boundary is an oblique line or an irregular arc, and a number of the outermost points on the horizontal boundary are used as boundary points to draw a standard horizontal boundary line (the middle part of a normal finger boundary line is straight), and the white part row is expanded and filled according to the standard horizontal boundary line to obtain a white part correction row (the black part is filled with a white part), and the actual finger width is measured according to the white part correction row. Compared with the uncorrected pixel image, direct measurement is prone to cause errors in the measured finger width data, so the finger width data measured by the corrected pixel image is more reliable;
[0044] In addition, when the horizontal boundary is a slant line or an irregular arc, when drawing the standard horizontal edge line at the boundary point, the number and continuity of the outermost points should be considered. If the continuity is poor or the number is small, it may mean that the white points are actually reflective foreign objects between the gaps.
[0045] The regional pixel comparison step compares the actual finger width with the finger width threshold of the finger plate at the corresponding position in the target detection model, and outputs a misalignment instruction or a normal instruction according to the comparison result. Specifically, the target image is screened in the target detection model according to the finger plate image, and the pixel width of each section of the finger plate exposed in the image is calculated according to the target image. The finger width threshold is set according to the pixel width (the finger width threshold from top to bottom can be 85, 30 and 15), and the finger width threshold of each section of the finger is superimposed on the actual finger width in the line graph in the form of a threshold line to obtain the degree of overlap. For example: the finger width threshold of 85 is converted into a horizontal threshold line of 85, and the starting point of the horizontal threshold line coincides with the starting point of the first segment of the vertex horizontal line in the line graph, and then it is determined whether it is completely overlapped or exceeded. If the threshold line corresponding to the finger width threshold covers the vertex horizontal line segment, a normal instruction is output, otherwise, a misalignment instruction is output. The more serious the misalignment of the finger plate, the larger the width of the white part line.
[0046] The regional pixel comparison step also includes a regional pixel feedback sub-step, whose purpose is to verify the accuracy of the actual finger width of the white part row. Specifically, in the regional pixel feedback sub-step, the pixel width of the black part row between each two adjacent white part correction rows is calculated based on the white part correction behavior in the pixel image as the gap width, and the gap width is compared with the finger plate gap at the corresponding position in the target detection model, and feedback is given based on the comparison result to verify whether the finger plate is misaligned.
[0047] It also includes a finger plate misalignment estimation step, training a finger plate misalignment model based on historical data, the misalignment model includes misalignment distance and image pixels, the misalignment distance corresponds to image pixels one by one, substituting the pixel map into the misalignment model to obtain the misalignment distance, and calculating the difference between the misalignment distance and the standard distance to obtain the actual misalignment distance. Specifically, Figure 5 As shown, it is a schematic diagram of the finger plate at a normal angle without deviation. Figure 6 is a schematic diagram of the finger-type board under misalignment angle, where H is the vertical distance from the camera to the upper surface of the finger-type board, D is the distance from the camera to the outer surface of the finger-type board, d is the visible length of the upper surface of the finger in the image when the finger-type board is in normal position, and h is the distance between the two fingers. When misalignment occurs, the visible length of the upper surface of the finger in the image increases to , staggered distance , according to the visual pixels can be obtained in the staggered model , and then get the misalignment distance.
[0048] The above are only preferred embodiments of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A finger plate misalignment fault detection method based on machine vision, characterized in that: The steps include: The finger pattern plate image acquisition step is to acquire an image with a portion of the finger pattern plate taken obliquely downward after being illuminated by light, and to stitch the image together to obtain a complete finger pattern plate image; The finger pattern plate image processing step is to search the finger domain of the finger pattern plate image through the target detection model, and obtain a pixel image by binarization processing of the finger domain; A regional pixel screening step, selecting a portion of columns in the pixel map, calculating the length of each row of white portion pixels in the portion of columns as the row pixel length, marking the white portion rows whose row pixel lengths are within a specified pixel length range, and calculating the pixel width of each row of the white portion rows as the actual finger width; The regional pixel comparison step compares the actual finger width with the finger width threshold of the finger template at the corresponding position in the target detection model, and outputs a misalignment instruction or a normal instruction according to the comparison result.
2. According to the method for detecting finger plate misalignment based on machine vision according to claim 1, it is characterized by: The partial columns are the 100 columns in the middle portion of the pixel map.
3. According to claim 2, a finger plate misalignment fault detection method based on machine vision is characterized by: The regional pixel screening step draws a line graph of the pixel map based on the actual finger width of the white part pixels and the black part pixels, the horizontal coordinate in the line graph reflects the width of the pixel column, the vertical coordinate in the line graph reflects the total pixel value of the pixel row, the vertical coordinate of the black part pixels in the line graph is zero, and the horizontal line segments at the vertices in the line graph reflect the actual finger width.
4. According to claim 3, a method for detecting finger plate misalignment based on machine vision is characterized in that: The regional pixel comparison step is to screen the target image in the target detection model according to the finger pattern plate image, calculate the pixel width of each finger of the finger pattern plate exposed in the image according to the target image, set the finger width threshold according to the pixel width, and superimpose the finger width threshold of each finger on the actual finger width in the line graph in the form of a threshold line to obtain the degree of overlap. If the threshold line corresponding to the finger width threshold covers the vertex horizontal line segment, a normal instruction is output, otherwise, a misalignment instruction is output.
5. According to claim 4, a finger plate misalignment fault detection method based on machine vision is characterized in that: The regional pixel screening step also includes a regional pixel correction sub-step. The regional pixel correction sub-step obtains the white portion row, extracts two horizontal boundaries in the white portion row, calculates the slopes of the two horizontal boundaries, and if the slope is non-zero, draws a standard horizontal edge line using a number of outermost points on the horizontal edge as edge points, expands and fills the white portion row according to the standard horizontal edge line to obtain a white portion correction row, and measures the actual finger width according to the white portion correction line.
6. According to claim 5, a method for detecting finger plate misalignment based on machine vision is characterized in that: The regional pixel comparison step also includes a regional pixel feedback sub-step. In the regional pixel feedback sub-step, the pixel width of the black part row between each two adjacent white part correction rows is calculated based on the white part correction row in the pixel image as the gap width, and the gap width is compared with the finger plate gap at the corresponding position in the target detection model, and feedback is given based on the comparison result to verify whether the finger plate is misaligned.
7. According to claim 1, a method for detecting finger plate misalignment based on machine vision is characterized in that: The method also includes a target detection model construction step, in which several finger pattern plate images acquired historically are segmented to obtain partial images of the retained fingers, the partial images of the retained fingers are annotated to form a data set, the data set is divided into a training set, a test set and a validation set in a certain ratio, and the training set, the test set and the validation set are trained through a deep learning neural network to obtain a target detection model.
8. According to claim 7, a method for detecting finger plate misalignment based on machine vision is characterized in that: The finger plate image acquisition step acquires a visual image taken obliquely downward after being illuminated by light, calculates the pixel sum of the entire column in each visual image, compares the pixel sum with a preset threshold, selects pixels smaller than the preset threshold and the corresponding visual image as the target image, and selects an image with a portion of the finger plate for splicing according to the position of the seam between the track beams in the target image.
9. The method for detecting finger plate misalignment based on machine vision according to claim 8, characterized in that: It also includes a finger plate misalignment estimation step, in which a misalignment model of the finger plate is trained based on historical data, wherein the misalignment model includes a misalignment distance and image pixels, and the misalignment distance corresponds to image pixels one by one. The pixel map is substituted into the misalignment model to obtain the misalignment distance, and the actual misalignment distance is obtained by subtracting the misalignment distance from the standard distance.
10. A finger plate misalignment fault detection system based on machine vision, characterized in that: include The finger pattern plate image acquisition module acquires an image with a portion of the finger pattern plate taken obliquely downward after being illuminated by light, and stitches it together to obtain a complete finger pattern plate image; A finger pattern plate image processing module searches for a finger domain on the finger pattern plate image through a target detection model, and obtains a pixel image by binarization processing on the finger domain; A regional pixel screening module selects a portion of columns in the pixel map, calculates the length of each row of white portion pixels in the portion of columns as the row pixel length, marks the white portion rows whose row pixel lengths are within a specified pixel length range, and calculates the pixel width of each row of the white portion rows as the actual finger width; The regional pixel comparison module compares the actual finger width with the finger width threshold of the finger template at the corresponding position in the target detection model, and outputs a misalignment instruction or a normal instruction according to the comparison result.
