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

I put different pictures together into a video and then ran v2e. There will be flickering during the transition. Is there any way to remove it? #69

Open
108360215 opened this issue Jul 18, 2024 · 8 comments

Comments

@108360215
Copy link

No description provided.

@108360215
Copy link
Author

image

@duguyue100
Copy link
Collaborator

v2e doesn't do any video smoothing given a video. Maybe do some post-processing before you produce the video? Use some kind of smoothing or stabilization from a video editor?

@tobidelbruck
Copy link
Collaborator

tobidelbruck commented Jul 18, 2024 via email

@108360215
Copy link
Author

image
I use like these non-continuous picture to combine the video, and this is my command :python v2e.py -i "D:\Downloads\VisDrone2019-VID-train\sequences\uav0000020_00406_v_output_video.avi" -o "D:\Downloads\VisDrone2019-VID-train\sequences\uav0000020_00406_v" --overwrite --unique_output_folder false --davis_output --dvs_h5 "events2.h5" --dvs_aedat2 "None" --dvs_text "None" --no_preview --input_frame_rate 24 --input_slowmotion_factor 1 --disable_slomo --auto_timestamp_resolution true --pos_thres 0.4 --neg_thres 0.4 --sigma_thres 0.03 --cutoff_hz 200 --leak_rate_hz 5.18 --shot_noise_rate_hz 2.716 --output_height=480 --output_width=640 --dvs_exposure duration .033 --dvs_params clean

and this is the code I use to combine the picture to video: import cv2
import os

def images_to_video(image_folder, video_path, fps=1):
images = [img for img in os.listdir(image_folder) if img.endswith(".jpg")]
images.sort() # 確保圖片按照順序合併

# 獲取第一張圖片的尺寸
frame = cv2.imread(os.path.join(image_folder, images[0]))
height, width, layers = frame.shape

# 初始化影片寫入器
video = cv2.VideoWriter(video_path, cv2.VideoWriter_fourcc(*'DIVX'), fps, (width, height))

for image in images:
    img_path = os.path.join(image_folder, image)
    frame = cv2.imread(img_path)
    video.write(frame)

cv2.destroyAllWindows()
video.release()

使用範例

image_folder = 'D:\UAV-Vehicle-Detection-Dataset\train\test'
video_path = 'D:\UAV-Vehicle-Detection-Dataset\train\output_video2.avi'
images_to_video(image_folder, video_path, fps=1) # fps 可以根據需要調整

and I already choose some fps like1,5,24,30 on the v2e and images_to_video , they all will be like the previous picture(noise), so what do you guys think about. Thanks to help me solve this problem!!

@duguyue100
Copy link
Collaborator

Do you know the original frame rate of these video frames? If it's a super low rate, the displacement between frames could be very large. In this case, you might want to remove the --disable-slomo option from the command to allow the SloMo model to interpolate some frames in between, otherwise, you will always get this kind of effect as the changes between pixels are very big.

@108360215
Copy link
Author

original frame rate depend what I set up, I tried to set up 30 before but still noise, I can try to use this --disable-slomo, but what do you think my output fps should be? also 30? And you say I can interpolate some frames in between, you mean when I combine the non continuous picture to video?

@tobidelbruck
Copy link
Collaborator

tobidelbruck commented Jul 19, 2024 via email

@108360215
Copy link
Author

So I'm curious if there's a way to merge these different types of images into a video and then convert it to event data. Otherwise, I can only find continuous images to convert, which significantly limits the size of my dataset.
What do you guys think about

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

3 participants