![]() |
|
[BUG] Mask binarize error - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html) +--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html) +--- Thread: [BUG] Mask binarize error (/thread-3989.html) |
Mask binarize error - dsiomnainc - 27.01.2025 Good day! When I try to use the "Binarize" item, I get an error on all algorithms except "Retinax", can you tell me what this might be related to? RE: Mask binarize error - Selur - 27.01.2025 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## 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 vsLevelsProblem i that instead of: clipMask = core.std.ShufflePlanes(clips=[clipMask], planes=[0], colorfamily=vs.GRAY)clipMask = core.std.ShufflePlanes(clips=[clipMask], planes=[0], colorfamily=vs.GRAY16)=> I'll try to look at it in the next few days. Cu Selur RE: Mask binarize error - Selur - 27.01.2025 Correction: using GRAY16 is wrong. ![]() Problem is Hybrid assumes that the output is GRAY16, but it's Gray10, which I didn't even know that it existed. ![]() Cu Selur RE: Mask binarize error - Selur - 27.01.2025 Uploaded a new dev version, which should fix the problem. Going to bed now. In case it is not fixed and a missed something, create and share a debug output, so that I can look at it tomorrow after work. Cu Selur RE: Mask binarize error - dsiomnainc - 28.01.2025 Yes, now it works without error. Thanks! |