Railway port freight yard container truck in-out direction judgment method and system

By combining multi-eye stitching and deep learning with Hough transform, the accuracy and stability issues of determining the direction of container trucks entering and exiting the railway port freight yard were resolved, enabling fast and economical direction determination of container trucks and reducing manpower and equipment maintenance costs.

CN120599558APending Publication Date: 2025-09-05CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510776662.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

In the existing technology, the judgment of the entry and exit direction of container trucks in railway port freight yards relies on manual monitoring or traditional sensors, which are inefficient, easily affected by subjective factors, and have poor environmental adaptability. In addition, the existing image processing methods lack detection accuracy and stability in complex environments.

Method used

Multi-frame image fusion is used to form a complete set of truck images using multi-eye stitching technology. The images are then size-standardized using a deep learning model. Hough transform and feature extraction algorithms (such as SIFT and SURF) are used to determine the vehicle's direction. Dynamic object detection and multi-target tracking technology are combined to achieve real-time and accurate direction judgment.

Benefits of technology

It achieves rapid and accurate judgment of the entry and exit directions of container trucks in complex environments, reduces manpower and equipment maintenance costs, adapts to different types of container trucks, supports continuous learning and optimization, and avoids the image blur and feature loss problems of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120599558A_ABST
    Figure CN120599558A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a railway port freight yard container truck in-out direction judgment method and system, and the method comprises the steps: S1, placing a collected image of a container truck passing through a railway port freight yard gate in a rectangular coordinate system, enabling an original point to be located at the upper left corner of the image, enabling an x-axis to be in the right direction, enabling a y-axis to be in the downward direction, and enabling the x-axis to be in the right direction; preprocessing the image, wherein the preprocessing comprises size adjustment, graying and denoising; s2, identifying and positioning the container truck in the image by using a target detection algorithm, and continuously tracking the movement track of the container truck through a multi-target tracking algorithm; s3, when the container truck passes through a gate, triggering an identification algorithm, extracting video frames 10 seconds before and after the container truck passes through, extracting one frame every 1 second, and splicing multiple frames of images into a complete container truck image by using a multi-view splicing technology; s4, performing size standardization on the container truck image based on a deep learning model, and extracting a front windshield and a rearview mirror as characteristic values for direction judgment; s5, detecting the contour of the container truck through Hough transform, and dividing the 1 / 2 part of the image in the width direction into a left part region and a right part region; and S6, according to the distribution positions of the front windshield and the rearview mirror in the left area and the right area, the driving direction of the container truck is judged to be from left to right or from right to left in combination with a preset reference value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for judging the entry and exit directions of container trucks in a railway port freight yard. Background Art

[0002] With the rapid development of international trade and logistics, railway port freight yards, as crucial hubs for cargo transshipment, have a direct impact on overall logistics timeliness through the efficient management of container trucks entering and exiting the port. Existing technologies primarily rely on manual monitoring or traditional sensor equipment, such as geomagnetic and infrared sensors, to determine the direction of container trucks entering and exiting the port. However, these methods have significant drawbacks: manual monitoring is inefficient, susceptible to subjective factors, and difficult to achieve around-the-clock operation; traditional sensor equipment also suffers from high installation and maintenance costs and poor environmental adaptability (e.g., affected by inclement weather, electromagnetic interference, or light fluctuations). In particular, in the complex and ever-changing environment of railway freight yards, their detection accuracy and stability are insufficient to meet practical requirements.

[0003] In recent years, computer vision-based vehicle direction recognition technology has gradually gained application. However, existing image processing methods often rely on single features (such as vehicle head orientation or motion trajectory) for judgment, which can easily lead to misjudgment due to vehicle occlusion, perspective changes, or image noise. For example, traditional edge detection combined with motion tracking methods lack robust feature extraction when the vehicle is partially occluded or when illumination is uneven. Video analysis techniques based on a single camera struggle to capture the complete outline of the vehicle, further limiting the accuracy of judgment.

[0004] Furthermore, existing technologies lack the ability to efficiently process vehicle images in dynamic scenarios. For example, when a vehicle rapidly passes through a cargo yard gate, a single frame of image information is limited and cannot fully capture the vehicle's overall characteristics. Simple multi-frame overlay methods can blur the image due to vehicle motion, hindering subsequent feature extraction. Therefore, using intelligent image processing and deep learning technologies to quickly and accurately determine the entry and exit directions of container trucks in complex environments has become a pressing technical challenge. Summary of the Invention

[0005] The present invention provides a method and system for determining the entry and exit directions of container trucks in a railway port freight yard, so as to solve the problems of low positioning accuracy and poor efficiency in existing entry and exit direction determination methods.

[0006] In order to achieve the above object, the present invention is implemented through the following technical solutions: In a first aspect, the present invention provides a method for determining the entry and exit direction of container trucks in a railway port freight yard, comprising: S1. Place the collected image of a container truck passing through the railway port freight yard gate in a rectangular coordinate system, with the origin at the upper left corner of the image, the x-axis pointing rightward as the positive direction, and the y-axis pointing downward as the positive direction; perform image preprocessing, including resizing, grayscale conversion, and denoising. S2, using the target detection algorithm to identify and locate the container truck in the image, and continuously tracking its trajectory using the multi-target tracking algorithm; S3. When a container truck passes through the gate, the recognition algorithm is triggered to extract 10 seconds of video frames before and after its passage, extracting one frame every 1 second, and using multi-frame stitching technology to stitch multiple frames into a complete set of truck images; S4. Based on the deep learning model, the size of the truck images is standardized and the front windshield and rearview mirror are extracted as feature values ​​for direction judgment; S5. Detect the truck outline using Hough transform and split the image into left and right regions at half the width. S6. Based on the distribution positions of the front windshield and the rearview mirror in the left and right areas and in combination with a preset reference value, determine whether the truck is traveling from left to right or from right to left.

[0007] Optionally, the target detection algorithm in S2 is YOLO or Faster R-CNN algorithm.

[0008] Optionally, the multi-eye stitching technology in S3 is implemented by the image stitching module in OpenCV; The start time of the video frame extraction in S3 is triggered by the dynamic object detection algorithm.

[0009] Optionally, the error range of the size normalization in S4 does not exceed 200 pixel scale points.

[0010] Optionally, the feature extraction in S4 adopts SIFT, SURF or HOG algorithm.

[0011] Optionally, the preset reference value in S6 is a position threshold of the front windshield and the rearview mirror relative to the dividing line in the image.

[0012] Optionally, in S6 , the comprehensive feature vector is classified by training a classifier, where the comprehensive feature vector includes position information of the front windshield and the rearview mirror.

[0013] Optionally, the classifier is a support vector machine or a random forest.

[0014] Optionally, the Hough transform in S5 is used to detect straight edge features of the truck outline.

[0015] In a second aspect, an embodiment of the present application provides a system for determining the entry and exit direction of container trucks in a railway port freight yard, including a processor and a memory; Memory for storing computer programs; The processor is configured to implement any one of the method steps described in the first aspect when executing a program stored in the memory.

[0016] Beneficial effects: The method for judging the direction of container trucks entering and exiting a railway port freight yard provided by the present invention fuses multiple frames of images into a complete set of truck images through multi-eye stitching technology, and standardizes the vehicle size in combination with a deep learning model, effectively overcoming the problems of limited information in a single-frame image, partial occlusion of the vehicle, or uneven lighting. In the feature extraction stage, the position information of the windshield and rearview mirror is integrated, and the Hough transform is used to accurately divide the area, which significantly improves the accuracy of direction judgment. It can still maintain stable detection in complex environments (such as rainy and snowy weather, strong light interference), and at the same time triggers video frame extraction based on dynamic object detection algorithms (such as YOLO, FasterR-CNN), and combines multi-target tracking technology to capture the vehicle's motion trajectory in real time, which can quickly respond to the instantaneous behavior of the vehicle entering and exiting the gate. By splicing 10 seconds of video frames before and after, the vehicle's passage process is completely restored, avoiding the image blur or feature loss problems caused by vehicle displacement in traditional methods; It is also worth noting that the present invention uses AI algorithms to process image data throughout the entire process, without relying on manual monitoring or physical sensors, which greatly reduces labor costs and equipment maintenance costs. The collaborative application of feature extraction and classifiers (such as SVM and random forest) can achieve real-time judgment at the millisecond level, meeting the high-frequency and high-throughput operational requirements of railway freight yards. By defining a standardized size with an error of no more than 200 pixels and combining feature extraction algorithms such as SIFT and SURF, the system can adapt to the diverse appearance features of different models of container trucks. In addition, the model supports continuous learning and optimization, and can dynamically adjust classifier parameters based on new data to adapt to future technology upgrades or scene changes. At the same time, the non-contact detection solution based entirely on visual data does not require the installation of geomagnetic sensors or infrared equipment, reducing the need for modification of freight yard infrastructure and avoiding maintenance problems caused by electromagnetic interference or physical wear, with significant economic benefits and environmental value. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of a method for determining the entry and exit direction of container trucks at a railway port freight yard according to a preferred embodiment of the present invention; Figure 2 A schematic diagram of coordinate system construction for a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0018] The following is a clear and complete description of the technical solutions of the present invention. It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.

[0019] Unless otherwise defined, the technical or scientific terms used in the present invention shall have the usual meanings understood by persons of ordinary skill in the field to which the present invention belongs. The words "first", "second" and similar terms used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "a" do not indicate a quantity limitation, but rather indicate the existence of at least one. Words such as "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.

[0020] See Figure 1-2 The embodiment of the present application provides a method for determining the entry and exit direction of container trucks in a railway port freight yard, comprising: S1. Place the collected image of a container truck passing through the railway port freight yard gate in a rectangular coordinate system, with the origin at the upper left corner of the image, the x-axis pointing rightward as the positive direction, and the y-axis pointing downward as the positive direction; perform image preprocessing, including resizing, grayscale conversion, and denoising. S2, using the target detection algorithm to identify and locate the container truck in the image, and continuously tracking its trajectory using the multi-target tracking algorithm; S3. When a container truck passes through the gate, the recognition algorithm is triggered to extract 10 seconds of video frames before and after its passage, extracting one frame every 1 second, and using multi-frame stitching technology to stitch multiple frames into a complete set of truck images; S4. Based on the deep learning model, the size of the truck images is standardized and the front windshield and rearview mirror are extracted as feature values ​​for direction judgment; S5. Detect the truck outline using Hough transform and split the image into left and right regions at half the width. S6. Based on the distribution positions of the front windshield and the rearview mirror in the left and right areas and in combination with a preset reference value, determine whether the truck is traveling from left to right or from right to left.

[0021] In the above embodiment, each step of the present invention can be broken down into the following schemes: 1. Coordinate system establishment and image preprocessing: First, place the image in a rectangular coordinate system, where the origin (0, 0) is located in the upper left corner of the image, the x-axis is in the right direction, and the y-axis is in the downward direction.

[0022] For video streams, we need to preprocess each frame, such as resizing, converting to grayscale (if applicable), denoising, etc.

[0023] 2. Dynamic object detection and tracking: Use object detection algorithms (such as YOLO, Faster R-CNN, etc.) to identify and locate container trucks.

[0024] Apply multi-target tracking algorithms (such as SORT, DeepSORT) to keep continuous tracking of the truck and record its movement trajectory.

[0025] 3. Video frame extraction and multi-view stitching: Based on the time when the truck passes through the gate, frames of 10 seconds before and after are extracted from the video, with one frame extracted every one second.

[0026] Use multi-frame stitching technology (such as the stitching module in OpenCV) to stitch these frames into a complete truck image.

[0027] 4. Size standardization and feature extraction: Collect a large amount of images of trucks passing through the gate and use a deep learning model (such as a convolutional neural network (CNN)) to train it to estimate the standard size of the trucks (length X pixels, width Y pixels).

[0028] Extract the windshield and rearview mirror as features. You can use feature detection methods (such as SIFT, SURF or HOG).

[0029] 5. Hough transform and region division: Apply a Hough transform or other edge detection algorithm to highlight line features in the image, which helps define the outline of the card set.

[0030] The card collection image is divided into two parts along the center line, that is, 1 / 2 of the image width is used as the dividing line.

[0031] 6. Driving direction judgment: Based on the positions of the windshield and rearview mirrors, combined with their relative positions in the image, the orientation of the truck can be inferred.

[0032] If the windshield appears on the left side of the image and the rearview mirror is on the right, the truck is moving from left to right, and vice versa.

[0033] 7. Comprehensive eigenvalue construction and optimization: A comprehensive feature vector containing the windshield and rearview mirror position information is constructed to more accurately determine the direction of the truck.

[0034] Use this feature vector to train a classifier (such as support vector machine SVM or random forest RF) to automatically determine the driving direction of the truck.

[0035] The embodiment of the present application also provides a system for determining the entry and exit direction of container trucks in a railway port freight yard, comprising a processor and a memory; Memory for storing computer programs; The processor is used to implement any one of the method steps in the method for determining the entry and exit direction of container trucks in a railway port freight yard when executing the program stored in the memory.

[0036] The above-mentioned railway port freight yard container truck entry and exit direction judgment system can implement the various embodiments of the above-mentioned railway port freight yard container truck entry and exit direction judgment method, and can achieve the same beneficial effects, which will not be described here.

[0037] The above describes in detail the preferred embodiments of the present invention. It should be understood that those skilled in the art can make numerous modifications and variations based on the concepts of the present invention without inventive effort. Therefore, any technical solutions that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined by the claims.

Claims

1. A method for determining the entry and exit direction of container trucks in a railway port freight yard, characterized in that: include: S1. Place the collected image of a container truck passing through the railway port freight yard gate in a rectangular coordinate system, with the origin at the upper left corner of the image, the x-axis pointing rightward as the positive direction, and the y-axis pointing downward as the positive direction, and perform image preprocessing, including resizing, grayscale conversion, and denoising. S2, using the target detection algorithm to identify and locate the container truck in the image, and continuously tracking its trajectory using the multi-target tracking algorithm; S3. When a container truck passes through the gate, the recognition algorithm is triggered to extract 10 seconds of video frames before and after its passage, extracting one frame every 1 second, and using multi-frame stitching technology to stitch multiple frames into a complete set of truck images; S4. Based on the deep learning model, the size of the truck images is standardized and the front windshield and rearview mirror are extracted as feature values ​​for direction judgment; S5. Detect the truck outline using Hough transform and split the image into left and right regions at half the width. S6. Based on the distribution positions of the front windshield and the rearview mirror in the left and right areas and in combination with a preset reference value, determine whether the truck is traveling from left to right or from right to left.

2. The method for determining the entry and exit direction of container trucks at a railway port freight yard according to claim 1, characterized in that: The target detection algorithm described in S2 is YOLO or Faster R-CNN algorithm.

3. The method for determining the ingress and egress directions of container trucks at a railway port freight yard according to claim 1, characterized in that: The multi-eye stitching technology described in S3 is implemented by the image stitching module in OpenCV; The start time of the video frame extraction in S3 is triggered by the dynamic object detection algorithm.

4. The method for determining the entry and exit direction of container trucks in a railway port freight yard according to claim 1, characterized in that: The error range of the size normalization described in S4 does not exceed 200 pixel scale points.

5. The method for determining the in and out direction of container trucks at a railway port freight yard according to claim 1, characterized in that: The feature extraction in S4 uses SIFT, SURF or HOG algorithm.

6. The method for determining the entry and exit direction of container trucks in a railway port freight yard according to claim 1, characterized in that: In S6 , the preset reference value is a position threshold of the front windshield and the rearview mirror relative to the dividing line in the image.

7. The method for determining the entry and exit direction of container trucks in a railway port freight yard according to claim 1, characterized in that: In S6 , the integrated feature vector is classified by training a classifier, where the integrated feature vector includes position information of the front windshield and the rearview mirror.

8. The method for determining the in and out direction of container trucks at a railway port freight yard according to claim 7, characterized in that: The classifier is a support vector machine or a random forest.

9. The method for determining the ingress and egress directions of container trucks at a railway port freight yard according to claim 1, characterized in that: In S5, the Hough transform is used to detect straight edge features of the truck outline.

10. A railway port freight yard container truck entry and exit direction judgment system, characterized in that: Including processor and memory; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 9 when executing a program stored in a memory.