The invention provides a subway lightweight video positioning method based on a sparse
optical flow algorithm, and the method comprises the steps: collecting a front image in a subway driving process, and carrying out the ROI region segmentation of the image; carrying out gray
processing on the ROI image and carrying out
angular point identification; performing
optical flow tracking on the identified
angular point by using an L-K
optical flow identification
algorithm based on an image
pyramid, and estimating a new position of the
angular point in the current frame according to the
pixel intensity change in the local window; the target points are screened,
noise is filtered, effective displacement tracks of the target points are screened, and confidence coefficient assignment is carried out on the effective target points; converting the pixel coordinate
system into a three-dimensional world coordinate
system to obtain a three-dimensional coordinate of the target point; solving the real displacement and
instantaneous speed of each target point between adjacent frames; weighting and solving the actual displacement and the real-time speed of the whole vehicle; the actual distance between the stations of the
subway line is obtained, and whether the subway arrives at the
station is judged according to the running distance and the real-time speed between the subway stations. According to the method, metro positioning is achieved only through the vehicle head camera and the vehicle-mounted computer, a large amount of trackside equipment is reduced, light weight of metro positioning is achieved, and the equipment maintenance cost is reduced.