A LiDAR frame is millions of returns, and almost all of them are the ground, the ballast, the rails and the scenery. The safety question is a single bit — is something in the train’s path — so the pipeline’s first job is subtraction. Ground-plane segmentation levels the scene and removes the track bed, and because a trackside unit vibrates and settles, that calibration has to run continuously rather than once at install.
What is left is still not an alarm. The system detects the rail lines and builds a dynamic area of interest — the track corridor plus a small margin either side — so that a person standing safely beside the line does not trigger the train alert while the same person between the rails does. The area of interest moves as the geometry changes, which is why it is computed live rather than drawn once on a map.
Only inside that corridor do classification and tracking matter. Objects are separated by size and density so a small animal or a scrap of debris is not treated as a person, and each object is tracked for pose and velocity so the system knows whether it is moving onto the track or away from it. The number that decides whether any of this is worth doing is the detection-to-alert latency: an alert that arrives after the braking distance has closed is not a safety system, and a false alarm that stops a train has a real cost of its own, so the threshold is a balance, not a maximum.