how4rd / meshflow

An implementation of the MeshFlow video stabilization algorithm by S. Liu et al.
31 stars 8 forks source link

Question about perspectiveTranform #4

Closed Lwy-1998 closed 2 years ago

Lwy-1998 commented 2 years ago

Hello!

I was trying to reimplement your code into a c++ version.But I met a problem! Maybe you can help me!

At the synthesizing stabilized frames stage,when I try warp the stabilized_mask(for every cell, e.g. the first cell is (0,0) to (40,23)) using warpPerspective function, the result is quite different from python version,.C++ version stabilized mask only preserve Integer (255), and mask didn't show in right stabilized locations.I am sure the stabilized motion mesh is correct and well smoothed, the homography is well estimated.

So I doubt that there is something wrong with my definition of stabilized_mask (which I define it as Mat::zeros(Size(frame_width,frmae_height),CV_64FC1), using loops to initialized to 255.0)

Here is one frame result, I am not sure which part is incorrect.

image
Lwy-1998 commented 2 years ago

Oh after hours of woking, I solved it.

it seems like something wrong with stabilized_mask value initializing.

how4rd commented 2 years ago

Glad you were able to resolve the issue. Good luck with your implementation!