This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[BUG] Mask binarize error
#2
Hybrid assumes it is applying BinarizeMask to a 10bit source.
For RGB content:
## Starting applying 'EdgeMask (Sobel)' masked filtering for vsLevels
clipMask = clip
clipMask = core.resize.Bicubic(clip=clipMask, format=vs.RGB30, matrix_in_s="470bg", range_s="limited")
clipMask = core.std.Sobel(clip=clipMask)
clipMask = core.resize.Bicubic(clip=clipMask, format=vs.GRAY16, matrix_s="470bg", range_s="limited")
clipFiltered = clip
# adjusting color space from YUV420P10 to RGB30 for vsLevels
clipFiltered = core.resize.Bicubic(clip=clipFiltered, format=vs.RGB30, matrix_in_s="470bg", range_s="limited")
# adjusting color using Levels on RGB30 (10 bit)
clipFiltered = core.std.Levels(clip=clipFiltered, min_in=64, max_in=940, min_out=64, max_out=940)
clipMask = core.std.BinarizeMask(clip=clipMask,threshold=30080)
clip = core.resize.Bicubic(clip=clip, format=vs.RGB30, matrix_in_s="470bg", range_s="limited")
clipMask = core.resize.Bicubic(clip=clipMask, format=vs.RGB30, range_s="limited", dither_type="error_diffusion")
clip = core.std.MaskedMerge(clip, clipFiltered, clipMask) # SobelEdgeMask
it works fine, but fails for YUV content:
## Starting applying 'EdgeMask (Sobel)' masked filtering for vsLevels
clipMask = clip
clipMask = core.std.Sobel(clip=clipMask)
clipMask = core.std.ShufflePlanes(clips=[clipMask], planes=[0], colorfamily=vs.GRAY)
clipFiltered = clip
# adjusting color using Levels on YUV420P10 (10 bit)
clipFiltered = core.std.Levels(clip=clipFiltered, min_in=64, max_in=940, min_out=64, max_out=940, planes=[0])
clipMask = core.std.BinarizeMask(clip=clipMask,threshold=30080)
clipMask = core.resize.Bicubic(clip=clipMask, format=vs.YUV420P10, range_s="limited", dither_type="error_diffusion")
clip = core.std.MaskedMerge(clip, clipFiltered, clipMask) # SobelEdgeMask
## Finished applying 'SobelEdgeMask' masked filtering for vsLevels

Problem i that instead of:
clipMask = core.std.ShufflePlanes(clips=[clipMask], planes=[0], colorfamily=vs.GRAY)
Hybrid should use:
clipMask = core.std.ShufflePlanes(clips=[clipMask], planes=[0], colorfamily=vs.GRAY16)
but some more code will have to be adjusted for that.

=> I'll try to look at it in the next few days.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Messages In This Thread
Mask binarize error - by dsiomnainc - 27.01.2025, 20:15
RE: Mask binarize error - by Selur - 27.01.2025, 20:37
RE: Mask binarize error - by Selur - 27.01.2025, 21:05
RE: Mask binarize error - by Selur - 27.01.2025, 21:42
RE: Mask binarize error - by dsiomnainc - 28.01.2025, 04:32

Forum Jump:


Users browsing this thread: 1 Guest(s)