21.03.2024, 23:00
Another good news.
I was finally able to properly calculate the average of frame using Vapoursynth, with this code
I calculated the images using 4 frames, this average should be equivalent to a "left" average using 7 frames.
Here the comparison: https://imgsli.com/MjQ5MTQ2
The average improved.
Dan
I was finally able to properly calculate the average of frame using Vapoursynth, with this code
def clip_color_stabilizer(clip: vs.VideoNode = None, nframes: int = 5, smooth_type: int = 0) -> vs.VideoNode:
max_frames = max(1, min(nframes, 31))
def smooth_frame(n, f, clip_base: vs.VideoNode = None, max_frames: int = 3):
f_out = f.copy()
if n < max_frames:
return f_out
img_f = list()
img_f.append(frame_to_image(f))
for i in range(1, max_frames):
img_f.append(frame_to_image(clip_base.get_frame(n-i)))
img_m = color_temporal_stabilizer(img_f, max_frames)
return image_to_frame(img_m, f_out)
clip = clip.std.ModifyFrame(clips=[clip], selector=partial(smooth_frame, clip_base=clip, max_frames=max_frames))
return clip
I calculated the images using 4 frames, this average should be equivalent to a "left" average using 7 frames.
Here the comparison: https://imgsli.com/MjQ5MTQ2
The average improved.
Dan