27.03.2024, 20:01
Hello Selur,
I found a way to mitigate the problem of gray frames in AverageFrames.
As you know I developed a filter which try to stabilize the colors of a clip using color temporal stabilizer.
The stabilization is performed by averaging past/future frames.
Since the non matched areas of past/future frames are gray because is missing in the past/future the color information, the new version of the filter will try to mitigate this issue, by filling the gray areas with the pixels of current frames (eventually de-saturated with the parameter "sat").
The image restored in this way is blended with the non restored image using the parameter "weight" (if =0 no blending is applied).
The gray areas are selected by the threshold parameter "tht". All the pixels in the HSV color space with "S" < "tht" will be considered gray. If "tht=0" no color frame restore is applied.
Here an example of asking to Vapoursynth to provide the image of the past 2 frames.
the gray areas are the pixel not available in the current frame, which is the following
It is possible identify the gray areas in the HSV color space, and selecting the pixels with the plane "S" below a given threshold.
Here an example of mask with threshold = 50:
And here with threshold = 100
I think that a threshold = 80, could be a good compromise.
He the gray image restored with this method, using a threshold=80 and a blending weight=50%
Using a blending=0 it will be possible to obtain a more colored picture but in this way it will be lost the stabilization effect of the Average.
Dan
I found a way to mitigate the problem of gray frames in AverageFrames.
As you know I developed a filter which try to stabilize the colors of a clip using color temporal stabilizer.
The stabilization is performed by averaging past/future frames.
Since the non matched areas of past/future frames are gray because is missing in the past/future the color information, the new version of the filter will try to mitigate this issue, by filling the gray areas with the pixels of current frames (eventually de-saturated with the parameter "sat").
The image restored in this way is blended with the non restored image using the parameter "weight" (if =0 no blending is applied).
The gray areas are selected by the threshold parameter "tht". All the pixels in the HSV color space with "S" < "tht" will be considered gray. If "tht=0" no color frame restore is applied.
Here an example of asking to Vapoursynth to provide the image of the past 2 frames.
the gray areas are the pixel not available in the current frame, which is the following
It is possible identify the gray areas in the HSV color space, and selecting the pixels with the plane "S" below a given threshold.
Here an example of mask with threshold = 50:
And here with threshold = 100
I think that a threshold = 80, could be a good compromise.
He the gray image restored with this method, using a threshold=80 and a blending weight=50%
Using a blending=0 it will be possible to obtain a more colored picture but in this way it will be lost the stabilization effect of the Average.
Dan