For animated sources, is it possible to sharpen the entire video, yet leave black lines looking a bit softer?
Every time I try to sharpen a video, when I get it up high enough to look nice and crisp, it appears oversharpened or the black lines become very intense looking.
I love the really sharp image, but I hate how it appears oversharpened with strong and sometimes aliased black lines.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 26 of 26
Thread
-
-
You could create an edge mask, then overlay the sharpened image with the original image using that mask. The trick is getting the mask just right. An edge mask will include edges as well as black lines. You might be able to further limit that with a brightness mask. An example using your recent transformers clip with just an edge mask (no cleanup):
Code:LWLibavVideoSource("transformers.mkv") sharp = Sharpen(1.0) # just something sharper emask = mt_edge().mt_expand().Blur(1.5).GreyScale().Invert() # mask of edges sharper = Overlay(last, sharp, mask=emask) Interleave(last, sharper, emask)
Last edited by jagabo; 21st Oct 2017 at 10:07.
-
-
Use an brightness mask to separate dark areas from bright areas. Something along the lines of
Code:Overlay(deband_filter(), last, mask=Tweak(bright=-16, coring=false).Tweak(cont=4.0, coring=false))
Here you can see the effect:
Code:function GreyRamp() { black = BlankClip(color=$000000, width=1, height=256) white = BlankClip(color=$ffffff, width=1, height=256) StackHorizontal(black,white) BilinearResize(512, 256) Crop(128,0,-128,-0) } GreyRamp().ConvertToYV12(matrix="PC.601") PointResize(width*4, height) Overlay(AddGrain(50), last, mask=Tweak(bright=-16, coring=false).Tweak(cont=4.0, coring=false)) TurnRight().Histogram().TurnLeft()
-
-
Like in the first post (sharpening everything except dark lines) Use an brightness/edge mask to overlay the denoised image with the non-denoised image. Something along the lines of:
Code:WhateverSource() denoised = WhateverDenoiser() edgemask = mt_edge().mt_expand().Blur(1.5).GreyScale().Invert() # mask of edges Overlay(last, denoised, mask=edgemask)
-
it would be possible to copy this script to avisynth since it is written in Vapoursynth, or you could also understand the function and create a similar one in Avisynth, it is very interesting if you can read it friend, a lot of people look for a mask like this one and a good debanding only in black(darks) areas where you can notice more.
https://kageru.moe/article.php?p=edgemasks
https://kageru.moe/article.php?p=adaptivegrain -
Here's his kirsh function (I had to find and fix a bug -- he had a couple numbers transposed in one of his matrices) using AviSynth GeneralConvolution() and Overlay():
Code:####################################################################### # # Kirsch edge detection algorithm. Requires RGB32 input, outputs RGB32 # ####################################################################### function Kirsch(clip c) { c e0 = GeneralConvolution(matrix=" 5, 5, 5, -3, 0, -3, -3, -3, -3") e1 = GeneralConvolution(matrix="-3, 5, 5, 5, 0, -3, -3, -3, -3") e2 = GeneralConvolution(matrix="-3, -3, 5, 5, 0, 5, -3, -3, -3") e3 = GeneralConvolution(matrix="-3, -3, -3, 5, 0, 5, 5, -3, -3") e4 = GeneralConvolution(matrix="-3, -3, -3, -3, 0, 5, 5, 5, -3") e5 = GeneralConvolution(matrix="-3, -3, -3, -3, 0, -3, 5, 5, 5") e6 = GeneralConvolution(matrix=" 5, -3, -3, -3, 0, -3, -3, 5, 5") e7 = GeneralConvolution(matrix=" 5, 5, -3, -3, 0, -3, -3, -3, 5") e01 = Overlay(e0, e1, mode="lighten") e23 = Overlay(e2, e3, mode="lighten") e45 = Overlay(e4, e5, mode="lighten") e67 = Overlay(e6, e7, mode="lighten") e0123 = Overlay(e01, e23, mode="lighten") e4567 = Overlay(e45, e67, mode="lighten") Overlay(e0123, e4567, mode="lighten") } #######################################################################
-
Thanks so much , is possible with YUV colors ?
How can you use this more detailed mask to clean the image of the banding and also apply some filter cleaning such as Dfttest, etc?
Code:# Quick overview of all scripts described in this article: ################################################################ # Use retinex to greatly improve the accuracy of the edge detection in dark scenes. # draft=True is a lot faster, albeit less accurate def retinex_edgemask(src: vs.VideoNode, sigma=1, draft=False) -> vs.VideoNode: core = vs.get_core() src = mvf.Depth(src, 16) luma = mvf.GetPlane(src, 0) if draft: ret = core.std.Expr(luma, 'x 65535 / sqrt 65535 *') else: ret = core.retinex.MSRCP(luma, sigma=[50, 200, 350], upper_thr=0.005) mask = core.std.Expr([kirsch(luma), ret.tcanny.TCanny(mode=1, sigma=sigma).std.Minimum( coordinates=[1, 0, 1, 0, 0, 1, 0, 1])], 'x y +') return mask # Kirsch edge detection. This uses 8 directions, so it's slower but better than Sobel (4 directions). # more information: https://ddl.kageru.moe/konOJ.pdf def kirsch(src: vs.VideoNode) -> vs.VideoNode: core = vs.get_core() w = [5]*3 + [-3]*5 weights = [w[-i:] + w[:-i] for i in range(4)] c = [core.std.Convolution(src, (w[:4]+[0]+w[4:]), saturate=False) for w in weights] return core.std.Expr(c, 'x y max z max a max') # should behave similar to std.Sobel() but faster since it has no additional high-/lowpass or gain. # the internal filter is also a little brighter def fast_sobel(src: vs.VideoNode) -> vs.VideoNode: core = vs.get_core() sx = src.std.Convolution([-1, -2, -1, 0, 0, 0, 1, 2, 1], saturate=False) sy = src.std.Convolution([-1, 0, 1, -2, 0, 2, -1, 0, 1], saturate=False) return core.std.Expr([sx, sy], 'x y max') # a weird kind of edgemask that draws around the edges. probably needs more tweaking/testing # maybe useful for edge cleaning? def bloated_edgemask(src: vs.VideoNode) -> vs.VideoNode: return src.std.Convolution(matrix=[1, 2, 4, 2, 1, 2, -3, -6, -3, 2, 4, -6, 0, -6, 4, 2, -3, -6, -3, 2, 1, 2, 4, 2, 1], saturate=False)
Last edited by frank_zappa; 29th Oct 2017 at 15:14.
-
-
-
-
For example, you might want to eliminate noise and low contrast edges:
WhateverSource()
denoised = WhateverDenoiser()
edgemask = ConvertToRGB32().Kirsch().ConvertToYV12(matrix="pc .601")
edgemask = edgemask.mt_binarize(120).Blur(1.0).Blur(1.0)
Overlay(denoised, last, mask=edgemask)
Original image:
Result form just Kirsch:
Result after adding mt_binarize and blur:
-
-
thanks so much !
it is possible a little help with "Macross" the other video I sent you
https://mega.nz/#!VGYgyBDA!gS6xU7ybR7-qOyv33-eMaj88gTaFwr6yJfqBIL1HYh4
is very complicated: (Last edited by frank_zappa; 29th Oct 2017 at 23:38.
-
Code:
denoised = MCTD(settings="HIGH", AA=false, protect=true, edgeclean=true, stabilize=true, enhance=true) edgemask = ConvertToRGB32().Kirsch().ConvertToYV12(matrix="pc.601") edgemask = edgemask.mt_binarize(120).Blur(1.0).Blur(1.0) Overlay(denoised, last, mask=edgemask)
any help please -
-
-
Use standard debugging procedure to determine which filter is causing the problem -- replace or eliminate filters one at at time. But I suspect you are running out of memory with MCTD.
-
my friend a huge favor this feature only applies banding to black areas would be possible to migrate the script to avisynth please
https://kageru.moe/article.php?p=adaptivegrain
Vapoursynth script
https://kageru.moe/blog/adaptivegrain.py
a lot of people fight against banding, I hope you can help us , thanks so so much
Similar Threads
-
Black lines appearing on all video playback
By ross2017 in forum MediaReplies: 3Last Post: 12th Oct 2017, 17:00 -
[SOLVED] FFmpeg: Removing Black lines from Video
By VidElp in forum Video ConversionReplies: 3Last Post: 23rd Aug 2015, 13:32 -
black thin lines in the video
By sevost in forum RestorationReplies: 2Last Post: 29th Jun 2015, 07:15 -
Thin black lines in a video
By sevost in forum RestorationReplies: 1Last Post: 31st May 2015, 06:11 -
Black/Outer lines look blurry/fuzzy
By darkdream787 in forum RestorationReplies: 8Last Post: 16th Dec 2013, 23:06