Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the stabilized video? #2

Open
GuoPingPan opened this issue Nov 10, 2022 · 3 comments
Open

How to get the stabilized video? #2

GuoPingPan opened this issue Nov 10, 2022 · 3 comments

Comments

@GuoPingPan
Copy link

Great Work!
Hi, I want to ask how to get the stablized video, if just save m_frames, it just the original video.

@pedro-emp
Copy link

Great Work! Hi, I want to ask how to get the stablized video, if just save m_frames, it just the original video.

have you figure out how to get the stabilized video?

@lyxyuren
Copy link

lyxyuren commented Dec 25, 2023

I think that we need to make a new function for Class Meshflow, like this:
void MeshFlow::GetWarpedSource(cv::Mat& src, cv::Mat& dst, cv::Mat& mapX, cv::Mat& mapY) { meshWarpRemap(src, dst, mapX, mapY, *m_mesh, *m_warpedmesh); }
and get the stablized video like this (just a fragment of the code) :
cv::namedWindow("MeshFlow"); int fourcc = cv::VideoWriter::fourcc('X', 'V', 'I', 'D'); double fps = 30.0; cv::Size frameSize(m_frames[0].cols, m_frames[0].rows); cv::VideoWriter videoWriter("output_video.mp4", fourcc, fps, frameSize, true); for (int i = 1; i < m_frameNum; i++) { cv::Mat stabilizedFrame; meshflow.GetWarpedSource(m_frames[i - 1], stabilizedFrame, map_X[i - 1], map_Y[i - 1]); videoWriter.write(stabilizedFrame); cv::imshow("MeshFlow", stabilizedFrame); cv::waitKey(1); } videoWriter.release();

@fkjkey
Copy link

fkjkey commented Jul 23, 2024

@GuoPingPan Excuse me, have you found a way to generate stabilize videos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants