The invention discloses a panoramic imaging method and device, equipment and a medium, and relates to the technical field of automatic driving, and the method comprises the steps: carrying out the projection transformation of an original image collected by a vehicle camera, and generating an aerial view; determining the size of an adaptive target window according to the distance from each pixel to a central pixel in the aerial view, and performing
optical flow estimation on each pixel in two adjacent frames of aerial views in the size of the target window based on vehicle motion information measured by an
inertial measurement unit to obtain a dense
optical flow field; extracting inner points from the dense
optical flow field by using a preset improved RANSAC
algorithm, and estimating global motion parameters based on an extracted inner
point set; fusing the global motion parameters and motion parameters measured by the
inertial measurement unit and the
positioning system by using a Kalman filtering method to obtain fused motion parameters; and projecting the historical panoramic image to an aerial view coordinate
system by using a
homography matrix calculated based on fusion motion parameters, and splicing the historical panoramic image with the current aerial view to generate a new panoramic image.