This invention discloses a target trajectory background modeling method and
system based on bidirectional difference and
grayscale correction, belonging to the field of image
data processing technology. The method includes: S1, periodically acquiring basic image trajectory data and performing preprocessing on the acquired data; S2, constructing a frame index sequence, generating a frame
pairing table and a
grayscale coefficient table, performing
grayscale correction and bidirectional difference calculation on the paired
frame sequence to obtain the candidate motion
mask for the current frame; S3, obtaining the initial background region of the current frame, evaluating the background confidence level of each pixel, and generating an effective background region; S4, comprehensively evaluating the stability level and fluctuation constraint capability of the background, dividing the stable and weak background regions, and outputting the frame-level motion
mask to complete the background closed-loop output. This solves the problem that traditional background modeling methods directly use arithmetic mean modeling in a few-frame sequences, leading to the background grayscale being lowered by high-contrast moving pixels, thus generating
motion artifacts and causing weak target detection failure.