Search code examples
c++opencvmotion-blur

How to combine many successive image to simulate a realistic motion blurring?


I want to simulate realistic motion blurring. I do not want to have the blurring effect in the whole image but only on the moving objects. I know that I can use filters, but the blurring effect will be spread in the whole image. I thought to use optical flow but I am not sure that it will work because the result depends a lot on the extracted features.

My main idea is to combine successive frame in order to generate motion blur.

Thanks


Solution

  • Not so easy.

    You can indeed try with optical flow. Estimate the flows between every pair of frames. Blur the frames in the direction of motion (for instance anisotropic Gaussian), with a filter extent equivalent to the displacement. Finally, blend the blurred images and the background by forming a weighted average where every frame gets more weight where it moves more.