View Full Version : InpaintDelogo - advanced logo removal & hardcoded subtitles extraction
katzenjoghurt
30th December 2021, 15:33
But since your last post there is nothing changed in Inpaint mode that would visually impact it. Can you post comparison examples what is "better" now?
Then maybe I'm just lucky. I just don't see that "emboss" like effect anymore when inpainting logos in UHD clips that was plagueing me here (https://forum.doom9.org/showthread.php?p=1941684#post1941684).
I'd need to recheck with those clips I posted.
Without samples of video and script I can't help you. Maybe video is overcompressed + logo is hardly transparent, maybe you are doing something wrong.
You should analyze whole video where logo is, not some parts.
Ok... here's a test video.
https://1drv.ms/v/s!ArUJrXgYajLogqYAv7D7TBrryU1Ivw?e=mF1wgP
Area I chose for the mask:
https://i.ibb.co/gRy9kbj/Bild-2021-12-30-151421.png (https://imgbb.com/)
Logo mask (only cropped the relevant upper right part here for this post)
https://i.ibb.co/Lx6HXkC/Bild-2021-12-30-151559.png (https://imgbb.com/)
Result:
https://i.ibb.co/DRP7SHj/Bild-2021-12-30-153035.png (https://imgbb.com/)
https://i.ibb.co/pQHtt4F/Bild-2021-12-30-152957.png (https://imgbb.com/)
https://i.ibb.co/Bgc1JSD/Bild-2021-12-30-152522.png (https://imgbb.com/)
https://i.ibb.co/ng2q3ZX/Bild-2021-12-30-152600.png (https://imgbb.com/)
https://i.ibb.co/k6VPynT/Bild-2021-12-30-152634.png (https://imgbb.com/)
https://i.ibb.co/FXTfjWD/Bild-2021-12-30-152703.png (https://imgbb.com/)
Invoked with no additional params.
1) Create Mask:
InpaintDelogo(mask="V:\Logos\UHD-Test.bmp", Loc="3366,50,-110,-1934", Mode="Deblend", Automask=1)
2) Deblend:
InpaintDelogo(mask="V:\Logos\UHD-Test.bmp", Loc="3366,50,-110,-1934", Mode="Deblend", Automask=0)
Analyze when you create the base mask [with Automask=1] and Analyze for actual delogo with Deblend does the two different things, for Deblend it creates Alpha/Color masks.
Analyze=2 is default, no need to add it to a script then.
Btw, Analyze options are the different frame selection methods, and if you ran same option before with Automask=1 then the frame selection result is reused when Analyze runs again for Alpha/Color masks.
Analyze=1 should be more precise, but usually you won't see a difference, in some rare cases it can be helpful.
Ahhh.
Okay... so Analyze = 1 may be used for the (first) deblend run then. Thx!
VoodooFX
30th December 2021, 17:53
Your video has color matrix BT.709 instead of BT.2020, maybe it has to do something with the problem, I dunno, maybe original blending is just damaged here.
EDIT:
Your sample looks like re-encode, share only original video.
Danette
6th January 2022, 17:03
Is there any chance of getting the 2.x versions to work with Avisynth+ 3.7.0? Not only am I concerned about the previously reported MeGUI problem with 2.x, but the 2.x versions do not seem to work in AvsPmod (probably due to the use of 3.7.0). AvsPmod also no longer functions when using Prefetch with most Avisynth+ 3.7.1 versions, which is another reason for me to not use Avisynth+ above 3.7.0.
VoodooFX
6th January 2022, 18:53
What MeGUI problem?
Try older AvsPmod till it is fixed, or 32bit one.
Danette
6th January 2022, 19:18
Looks like that MeGUI problem was assigned to the portable Avisynth+ version, which I don't use. However, I installed Avisynth+ 3.7.1, after reading that post, and that's when I ran into the InpaintDelogo/Prefetch AvsPmod problem. I think I will have to wait for the AvsPmod problem to be fixed (if it is), as I am already using an older 32-bit version of it (2.7.0.0). In the meantime, InpaintDelogo 1.48 is certainly fully acceptable, from my perspective.
puregreen
8th February 2022, 04:27
Trying to deblend a logo with my manually created mask using the following command:
InpaintDelogo( mask="C:\path\to\LogoMask3840x2160pBW.bmp", Automask=0, Loc="0,0,-0,-0", Analyze=3, Mode="Deblend")
but the result is rather weird:
https://i.ibb.co/NxFWNc3/Screenshot-1.png (https://imgbb.com/)
What parameters should I adjust?
Source video: https://filetransfer.io/data-package/jcs1FMaL#link
Mask: https://filetransfer.io/data-package/EUIMIWSJ#link
VoodooFX
8th February 2022, 11:00
That video is just 12 seconds of static scene where logo is not in solid background. There is nothing to build a deblending mask from.
You need at least one frame with logo in dark solid background and one frame with logo in bright solid background.
Or you need much longer video than this to try anything.
EDIT:
Actually, "Analyze=-4" can create the deblend masks from one frame with logo in dark solid background.
VoodooFX
8th February 2022, 11:25
Inpaint doesn't look bad, if you can find good inpainting settings for that big "A" at the left.
Downscaled example:
https://i.imgur.com/Rp8DkkQ.jpeg
https://i.imgur.com/K8MWNXz.jpeg
puregreen
9th February 2022, 01:18
That video is just 12 seconds of static scene where logo is not in solid background. There is nothing to build a deblending mask from.
You need at least one frame with logo in dark solid background and one frame with logo in bright solid background.
Or you need much longer video than this to try anything.
I thought all I need is a black and white (logo in white) mask and then it can be used for all other videos of the same frame size. That's why I made that mask (https://filetransfer.io/data-package/EUIMIWSJ#link) from another video where the logo was on solid black background. So... I was completely wrong? I guess I just don't quite understand how deblending works then :(
VoodooFX
9th February 2022, 06:52
I thought all I need is a black and white (logo in white) mask and then it can be used for all other videos of the same frame size. That's why I made that mask (https://filetransfer.io/data-package/EUIMIWSJ#link) from another video where the logo was on solid black background. So... I was completely wrong? I guess I just don't quite understand how deblending works then :(
Black and white mask is just a basemask, when you have it then "Analyze" runs to create Alpha/Color deblend masks, and that A/C masks filename would look like this:
"LogoMask3840x2160pBW.bmp_InpaintDelogo2_1010-900-990-900_A3.ebmp".
Basemask and deblend masks can be reused on other videos with same logo.
Basemask is enough only for "Inpaint" mode.
VoodooFX
9th February 2022, 07:48
from another video where the logo was on solid black background.
You can try old Deblend 'manual' method[s] on that "another video", those methods produce lower quality deblend but don't need many frames to analyze, actually "Analyze=-4" can create the deblend masks from one frame.
Try this [replace '000' with proper frame number]:
InpaintDelogo( mask="C:\LogoMask3840x2160pBW.bmp", Loc="1010,900,-990,-900", Analyze=-4, FrB=000, Mode="Deblend")
And for the example above you can finetune these parameters [here with defaults]:
Interp=2, dPP=3, Inflate=1 [These are like postprocess effects]
FrS=0, Deep=3 [These influence the deblend masks creation]
If you want to compare the deblend masks/methods or see a pure deblend effect, then turn off "Interp" and "dPP".
PS:
Another possibility is to join hundreds of those videos in Avisynth and create the deblend masks from that. :)
puregreen
10th February 2022, 02:44
Basemask and deblend masks can be reused on other videos of the same frame size and same logo.
How to re-use them? If I set Analyze to 0, I get the "File 'Script.avs' does not have a video stream" error... Or if the files are present, it won't re-analyze anything even if analyze parameters are set?
puregreen
10th February 2022, 03:30
You can try old Deblend 'manual' method[s] on that "another video", those methods produce lower quality deblend but don't need many frames to analyze, actually "Analyze=-4" can create the deblend masks from one frame.
Try this [replace '000' with proper frame number]:
InpaintDelogo( mask="C:\LogoMask3840x2160pBW.bmp", Loc="1010,900,-990,-900", Analyze=-4, FrB=000, Mode="Deblend")
And for the example above you can finetune these parameters [here with defaults]:
Interp=2, dPP=3, Inflate=1 [These are like postprocess effects]
FrS=0, Deep=3 [These influence the deblend masks creation]
If you want to compare the deblend masks/methods or see a pure deblend effect, then turn off "Interp" and "dPP".
PS:
Another possibility is to join hundreds of those videos in Avisynth and create the deblend masks from that. :)
Ohh... Looks like the logo has shadows :scared: At least it's visible on a solid white background but more likely it's there on a dark one too, it's just hard to notice it.
Here's a video with both black (frame 001) and white (frame 055) background: https://filetransfer.io/data-package/wHl0HYcU#link
VoodooFX
10th February 2022, 04:26
How to re-use them? If I set Analyze to 0, I get the "File 'Script.avs' does not have a video stream" error... Or if the files are present, it won't re-analyze anything even if analyze parameters are set?
Just change video to another in script and thats it.
There is no Analyze=0 option for user to select, looks like that after v2.00 I forgot to add error on it [EDIT: I didn't forgot, the error assert is there], but from the manual it should be clear.
Why you need to re-analyze if you want re-use same masks?
PS
And you are selecting non existent "0" option to "not-analyze" when you want to analyze? I'm a bit confused. :)
VoodooFX
10th February 2022, 18:48
Ohh... Looks like the logo has shadows :scared: At least it's visible on a solid white background but more likely it's there on a dark one too, it's just hard to notice it.
Here's a video with both black (frame 001) and white (frame 055) background: https://filetransfer.io/data-package/wHl0HYcU#link
Didn't had time to look at it in the morning.
I see there are good white frames, so use Analyze=-3 method.
I've removed logos with such faint shadows before, and there are bunch of settings to deal with them. Most likely that Automask won't pick up very transparent parts like this shadow, so you need to create a base mask in photoshop including that shadow too.
PS:
Maybe later this evening I'll give this video a try.
puregreen
11th February 2022, 01:50
And you are selecting non existent "0" option to "not-analyze" when you want to analyze? I'm a bit confused. :)
No, I thought setting it to "0" would protect the existing ebmp files from re-analyzing but turned out it's not needed because it doesn't re-analyze if the files already exist :-)
I'm getting pretty good results after generating a deblending mask from the black frames. The only thing left is dealing with the shadow somehow...
VoodooFX
11th February 2022, 02:24
I'm getting pretty good results after generating a deblending mask from the black frames. The only thing left is dealing with the shadow somehow...
I've no idea what you are doing there, post your script and basemask.
I wrote one post above yours what to do...
puregreen
11th February 2022, 03:23
I've no idea what you are doing there, post your script and basemask.
I wrote one post above yours what to do...
I did this:
InpaintDelogo( mask="C:\LogoMask3840x2160pBW.bmp", Loc="1010,900,-990,-900", Analyze=-4, FrB=001, Mode="Deblend")
It works fine on the parts where the shadow is not visible.
I tried making a base mask with the shadow: https://filetransfer.io/data-package/3kaMyxIQ#link
...and tried using it with the script:
InpaintDelogo( mask="C:\LogoMask3840x2160pShadow.bmp", Loc="1010,900,-990,-900", Analyze=-3, FrB=001, FrW=055, Mode="Deblend")
...but it doesn't help with the shadow.
VoodooFX
11th February 2022, 03:34
I tried making a base mask with the shadow: https://filetransfer.io/data-package/3kaMyxIQ#link
It's not a black/white mask. Whole logo must be white.
EDIT:
FrB=001, FrW=055.
You don't need to add zeros in front of numbers.
VoodooFX
11th February 2022, 14:39
Did you re-encoded those videos in your posts?
Btw, there is the error assert for "Analyze=0", probably because of soft you use you don't see Avisynth errors.
Here I tried to delogo, shadow is perfectly deblended, good result, no need for any PP:
InpaintDelogo( mask="D:\Mask.bmp", Loc="920,810,-910,-820", Analyze=-3, FrB=0, FrW=51, FrS=1, Deep=1, Interp=0, dPP=0, Mode="Deblend")
Mask:
https://thumbs2.imgbox.com/c7/34/Tb5LH429_t.png (https://imgbox.com/Tb5LH429)
Before:
https://thumbs2.imgbox.com/04/f8/wQqocM2G_t.png (https://imgbox.com/wQqocM2G)
After:
https://thumbs2.imgbox.com/2b/c8/ekZgd6MQ_t.png (https://imgbox.com/ekZgd6MQ)
Before:
https://thumbs2.imgbox.com/62/30/nIJPsB9K_t.jpg (https://imgbox.com/nIJPsB9K)
After:
https://thumbs2.imgbox.com/01/4b/7EH2W8R9_t.jpg (https://imgbox.com/7EH2W8R9)
EDIT:
I was about to test Makki's delogo, but I remembered that there you can't create lgd from few frames...
puregreen
12th February 2022, 02:14
Wow, that's perfect :eek: Thank you!
Did you re-encoded those videos in your posts?
No, they are untouched.
puregreen
12th February 2022, 04:05
What if I created a deblending mask and want to use it on a video where the logo is the same but shifted a little bit?
For example, here's my base mask: https://filetransfer.io/data-package/QxGcwH8N#link
Here's a video I used to generate deblending mask from: https://filetransfer.io/data-package/mjjRj0qE#link
InpaintDelogo( mask="C:\LogoMask596x336p.png", Loc="136,194,-136,-88", Analyze=3, FrB=120, FrW=0, FrS=1, Deep=1, Interp=0, dPP=0, Mode="Deblend")
And let's say I want to use it on this video: https://filetransfer.io/data-package/dzWZCyxL#link
But the logo here is shifted by about 6 px down so the same deblending mask doesn't quite work... Is there a way to make it work? Or the only way is to make a deblending mask from a video where the logo is located at the exact same position?
VoodooFX
12th February 2022, 18:10
What if I created a deblending mask and want to use it on a video where the logo is the same but shifted...
1) What is this mask, and it doesn't even fit in your selected Loc, read in the manual about Loc parameter:
https://i.imgur.com/XY4dqnR.png
2) "Analyze=3, FrB=120, FrW=0, FrS=1" <- manual frame selection doesn't work with positive Analyze.
So, select proper Loc for this Shutterstock, create proper basemask and deblend masks with 1053334574 clip:
InpaintDelogo( mask="C:\1053334574.bmp", Loc="114,174,-112,-68", Analyze=-3, FrB=76, FrW=227, FrS=3, Deep=1, Mode="Deblend", Automask=1, aMix=0)
https://i.imgur.com/tt2czTJ.png
In 1053531500 clip the logo is shifted exactly 4 pixels up, so edit the basemask file with Photoshop and move logo up.
A/C deblend masks in ebmp are not stored in full frame dimension, only Loc area, so if you keep dimensions of the Loc area the same then deblend masks fit (they are 'moving' when you change Loc).
[If logo shifted by non-mod2 distance, then you would need to shift that one pixel inside ebmp]
About Loc. You can use "StainlessS"s coords, they are easier to grasp when you are 'moving' area inside frame.
"114,174,-112,-68" would be "114,174,370,94".
So changing "114,174,370,94" -> "114,170,370,94" would move area 4 pixels up.
Remember that "StainlessS"s coords in ebmp filename are converted back to "VoodooFX" coords format [actually they are "VDub" coords]
A/C deblend masks ebmp file is seen and reused if filename corresponds to the parameters in use.
If you don't get idea behind how ebmp file is named just by looking at it then maybe this will help:
https://forum.doom9.org/showthread.php?p=1948676#post1948676
RESULTS:
InpaintDelogo( mask="C:\1053334574.bmp", Loc="114,174,-112,-68", Analyze=-3, FrB=76, FrW=227, FrS=3, Deep=1, Interp=0, dPP=0, Mode="Deblend")
Before:
https://i.imgur.com/H3b7U8L.png
After:
https://i.imgur.com/TEBYmc3.png
InpaintDelogo( mask="C:\1053531500.bmp", Loc="114,170,370,94", Analyze=-3, FrB=76, FrW=227, FrS=3, Deep=1, Interp=0, dPP=0, Mode="Deblend")
Before:
https://i.imgur.com/NIKhoAq.png
After:
https://i.imgur.com/Px3zMHO.png
In 1053531500 clip the logo is damaged by compression on some frames and some remnants of logo are there, you can try "dPP" and "Interp" parameters, they are for hiding artifacts, but they have their own side effects.
VoodooFX
4th April 2022, 23:21
Thanks to the new feature in Masktools2 v2.2.30 by @pinterf there is no more glitches with "DynMask=4" on SD videos.
# Version 2.05 : 2022/04/04. Masktools2 v2.2.30 or later is required.
# Tweaked: "DynMask=4" and positive "DynMaskUp", should be a bit faster and no more glitches.
# New: "DynLocUp" [Experimental WIP parameter for tests].
Guilbert
30th April 2022, 17:11
Hi,
I can't find the correct settings to get proper subtitles with this video: https://mega.nz/file/sgMDyThQ#B0l4VOlDIR4HKW-5a5hFv03wHTUYK3ZcLWmgWBQElpQ (sample)
For now, my script looks like that:
LWLibavVideoSource("")
InpaintDelogo(Loc="200,570,-200,-60", Show=4, DynMask=3, DynTune=218, DynMask4H=200, DynMaskUp=2, Extract=1, ImgDir="")
BTW, I use the latest version of InpaintDelogo (2.09).
Thank you for your help!
VoodooFX
30th April 2022, 17:29
Hi,
I can't find the correct settings to get proper subtitles with this video: https://mega.nz/file/sgMDyThQ#B0l4VOlDIR4HKW-5a5hFv03wHTUYK3ZcLWmgWBQElpQ (sample)
Is your sample a record/re-encode of original video? If yes then cut a sample from original video, and longer, maybe ~15 mins.
manono
1st May 2022, 08:26
Hi,
What is the last version for AviSynth 2.60? Is it Version 1.48? And where can I get it?
VoodooFX
1st May 2022, 09:00
Hi,
What is the last version for AviSynth 2.60? Is it Version 1.48? And where can I get it?
Last compatible with AvS 2.6 is v1.48 (would need to be imported with GImport), GImport not needed for v1.33, but "Show=1" is broken there.
Actually, if you just want to inpaint some logo then all versions are good enough.
You can download from GitHub, press "InpaintDelogo.avsi" there, then "History", you'll see different versions, a second button from the right side opens 'that' version.
VoodooFX
2nd May 2022, 15:26
# Version 2.10 : 2022/05/02. Added auto generation of the dynamic mask by color (aka "DynMask=5"/"DynColor").
# New: "DynColor", "DynColorTol", "DynColorInf", "Show=10".
# This dynamic mask by color can pre-patch video for other "DynMask" methods.
Thread that prompted this update, and video samples: Remove timestamp (https://forum.videohelp.com/threads/405550-Remove-timestamp#post2655547).
Few screens for comparisons:
1) Original
2) DynMask2
3) DynMask3 [Actually, DynMask3 could generate an accurate mask, except for the last digit, read in the link above]
4) DynMask5
5) DynMask2 pre-patched with DynMask5
6) DynMask3 pre-patched with DynMask5
7) Result of the mask from 6th row.
https://i.imgur.com/q8dFIYi.png https://i.imgur.com/89L5aCI.png
v=LWLibAvVideoSource("D:\Pachacamac E.MP4")
x=v.crop(4,990,-1380,-4)
o1=v.InpaintDelogo(Loc="4,990,-1380,-4", Show=4, DynMask=2, DynTune=150)
o2=v.InpaintDelogo(Loc="4,990,-1380,-4", Show=4, DynMask=3, DynTune=150, Dyn3Seq=54)
o3=v.InpaintDelogo(Loc="4,990,-1380,-4", Show=4, DynMask=5, DynColor=$FFB900)
o4=v.InpaintDelogo(Loc="4,990,-1380,-4", Show=4, DynMask=2, DynTune=150, DynColor=$FFB900)
o5=v.InpaintDelogo(Loc="4,990,-1380,-4", Show=4, DynMask=3, DynTune=150, DynColor=$FFB900, Dyn3Seq=54)
o6=v.InpaintDelogo(Loc="4,990,-1380,-4", Show=0, DynMask=3, DynTune=150, DynColor=$FFB900, Dyn3Seq=54, DynInflate=2).crop(4,990,-1380,-4)
Stackvertical(
\ x,
\ o1.ConvertToYV12().AddBorders(0,2,0,0,$F0F080),
\ o2.ConvertToYV12().AddBorders(0,2,0,0,$F0F080),
\ o3.ConvertToYV12().AddBorders(0,2,0,0,$F0F080),
\ o4.ConvertToYV12().AddBorders(0,2,0,0,$F0F080),
\ o5.ConvertToYV12().AddBorders(0,2,0,0,$F0F080),
\ o6.ConvertToYV12().AddBorders(0,2,0,0,$F0F080))
PS:
@Guilbert, I didn't forgot you. I'll check your video today.
Nice. (this and missing a stable RemoveDirt are the only real reasons I sill have Avisynth on my system didn't switch completely to Vapoursynth)
VoodooFX
2nd May 2022, 22:53
Hi,
I can't find the correct settings to get proper subtitles with this video: https://mega.nz/file/sgMDyThQ#B0l4VOlDIR4HKW-5a5hFv03wHTUYK3ZcLWmgWBQElpQ (sample)
For now, my script looks like that:
InpaintDelogo(Loc="200,570,-200,-60", Show=4, DynMask=3, DynTune=218, DynMask4H=200, DynMaskUp=2, Extract=1, ImgDir="")
I don't see much problems in your sample sequence, just lower DynTune to 190 to make extracted subs better. ;)
But I see problems at other places .
About your parameters:
[I]DynMask4H is only for DynMask=4, so it does nothing here.
DynMaskUp was meant for HD videos and DynMask=4, for SD videos or small subs use DynLocUp.
Halo around subs is too faint to make it useful, later I'll check if anything can be done about it.
By looking at sequence you shared, I came up with these parameters [dunno if it's worse or better at other places, let me know how it's]:
InpaintDelogo(Loc="300,560,-300,-50", Show=4, DynMask=3, DynTune=190, Dyn3Seq=25, KillBlobs=5, KillNoise=5, RePass=1, DynLocUp=2)
Subs extractor defaults are tuned for a good mask, where mask doesn't have so many artifacts.
If mask has many artifacts then you can:
Lower CorrTh, to ~0.65 - 0.75 [would be less wrong splits]
Lower SubTune, to 200 - 220.
Lower SubMinDur [so wrong splits would be extracted]
Use SubSuspect.
EDIT:
I tried VSF for comparison, sadly it fails, so no incentive to do better, maybe ~perfect mask is not possible from these subs...
On your sample sequence (38265 - 38861) VSF fails a lot, where InpaintDelogo has no problems. One extracted sub for example:
VSF:
https://i.imgur.com/PkNNarp.png
InpaintDelogo :
https://i.imgur.com/c61oscH.png
On where I spotted "problems at other places" (6752 - 7269) both fails a lot. One extracted sub for example:
VSF:
https://i.imgur.com/NW2qRaE.png
InpaintDelogo :
https://i.imgur.com/q2oHCHP.png
manono
4th May 2022, 04:00
You can download from GitHub, press "InpaintDelogo.avsi" there, then "History", you'll see different versions, a second button from the right side opens 'that' version.
Thanks a lot! I tried some of the more recent versions first but couldn't get them going. Then I downloaded V. 1.48 and set it up. I used "Inpaint" Mode to get rid of the logo but, of course, it left behind the blurs during moving backgrounds.
Then, based on your tips further up the page, I decided to try to get the "Both" Mode going as the logo wasn't completely opaque. And ... it worked! No sign at all of the logo any longer. I'm very pleased and have you to thank for it, VoodooFX.
VoodooFX
4th May 2022, 06:33
Thanks a lot! I tried some of the more recent versions first but couldn't get them going. Then I downloaded V. 1.48 and set it up. I used "Inpaint" Mode to get rid of the logo but, of course, it left behind the blurs during moving backgrounds.
Then, based on your tips further up the page, I decided to try to get the "Both" Mode going as the logo wasn't completely opaque. And ... it worked! No sign at all of the logo any longer. I'm very pleased and have you to thank for it, VoodooFX.
Finally you moved to proper logo deblending from simple inpaintings. [or was it some other guy?] :)
So it wasn't AvS+ issue? Why didn't you ask for help then?
For not Inpaint mode you definitely want to use latest version, other modes progressed (https://forum.doom9.org/showthread.php?p=1958556#post1958556) a lot.
You should use Deblend for non-opaque logos, Both is meant for other things and can have unpredictable side effects if you use it instead of Deblend.
Post issues you had, full avs script, frame sample from video and we'll solve it.
Guilbert
5th May 2022, 10:13
Thanks a lot, VoodooFX!
(I'll test these parameters next weekend and keep you in touch.)
VoodooFX
5th May 2022, 22:41
Thanks a lot, VoodooFX!
(I'll test these parameters next week-end and keep you in touch.)
I quick looked what can be done with tcanny edge masking, I think it can replace positive KillBlobs and RePass, and it's faster.
KillBlobs and RePass:
https://i.imgur.com/q2oHCHP.png
new tcanny stuff:
https://i.imgur.com/RcUolOT.png
And in general there are less bad splits and less some other artifacts with tcanny.
EDIT:
Need to investigate what Dogway's masks are doing...
Maybe someone knows magic already how to isolate letters inside this halo precisely [from the sample below]?
https://i.imgur.com/goxj4KB.png
VoodooFX
7th May 2022, 16:41
...
Masking with "new tcanny stuff": 204 FPS
Masking with KillBlobs/RePass: 91 FPS
Dunno when I'll have time to release a new version, so here is the mask: https://we.tl/t-MjgKuwhWWn
Used Dyn3Seq=24, [I checked and found shortest sub is 24 frames]
Took ~7 mins to encode the mask, and ~3 mins to extract images with: SubsMask2Img(ImgDir="D:\test", SubMinDur=6, SubSuspect=23)
https://i.imgur.com/OGDHlPl.png
Guilbert
8th May 2022, 13:17
Wow, that's a nice improvement!
I use these parameters for this show, now:
InpaintDelogo(Loc="300,560,-300,-50", Show=4, DynMask=3, DynTune=190, Dyn3Seq=24, KillBlobs=5, KillNoise=5, RePass=1, DynLocUp=2, CorrTh=0.75, SubTune=220)
It took me only 15-20 minutes to OCR and edit with Tesseract 5.0.1. Can't wait to test the next release with the "new tcanny stuff", then. :)
:thanks:
VoodooFX
14th May 2022, 22:53
# Version 2.12 : 2022/05/14. Added generation of the dynamic mask by gradient magnitude map (aka "DynMask=7"/"DynTEdge").
# New: "DynTEdge", "DynTEdgeThY", "DynTEdgeInf", "DynTuneInf", Show=10, Show=11.
# vsTEdgeMask plugin is required.
# Version 2.11 : 2022/05/13. Rewrite: "DynColor" ~30%-300% faster. New: "DynMask=6/"DynTune". Removed: "Show=10".
@Guilbert
I used these parameters to get the mask in my previous post:
InpaintDelogo(Loc="300,560,-300,-50", Show=4, DynMask=3, Dyn3Seq=24, DynTune=190, DynTEdge=1, DynTEdgeThY=20, DynTEdgeInf=2, DynLocUp=2)
VoodooFX
21st May 2022, 14:12
Improved subs extraction: ~90% reduction of non-sub images.
# Version 2.13 : 2022/05/21. SubsMask2Img: Added average luma check to catch non-sub images.
# New: "SubMinLuma", "SubSusLuma".
# Renamed: "SubSuspect" to "SubSusDur".
VoodooFX
23rd May 2022, 02:11
# Version 2.14 : 2022/05/22. SubsMask2Img: New option to extract raw non-binarized images.
# Enabled by "Extract=2" in InpaintDelogo() or "Raw" in SubsMask2Img().
# New: "Raw", "RawAvr".
Should be better than VSF's raw images, as I added averaging for raw images, that should increase OCR accuracy [it's enabled by default].
For example averaged raw sub image:
https://i.imgur.com/A6GfTob.png
Not averaged raw sub image:
https://i.imgur.com/mk7suu9.png
The feature request:
Chinese-like characters are not well supported by tesseract or any other softwares. It would be nice to use paid Baidu OCR api on those languages. Since it's an enterprise solution, they can handle hardsub detection a lot better than custom masks, more often than not, raw image will yield better results.
He sent me few examples of Baidu OCR:
Sub image: https://i.imgur.com/goxj4KB.png
https://i.imgur.com/bvloEeS.png
Sub image: https://i.imgur.com/u3nzosV.png [not raw, just to check how it's better than Tesseract]
https://i.imgur.com/DUgthMw.png
Note: Google Cloud Vision OCR should be something similar to Baidu OCR.
VoodooFX
30th May 2022, 06:01
# Version 2.15 : 2022/05/29. Spaces are allowed in "Loc".
The feature request:
It would be nice if you could specify loc as "60, 500, -60, -40" for example.
VoodooFX
12th June 2022, 16:35
# Version 2.16 : 2022/06/12. Higher quality and faster "DynColor" mask when used with "DynLocUp".
# Faster "DynColor" alternative if parameter is string, and it supports multiple colors.
# TColorMask plugin is required.
VoodooFX
13th June 2022, 17:29
# Version 2.17 : 2022/06/13. Option for ranged luma mask with DynMask6.
Helps when "logo" is not so bright:
https://i.imgur.com/EbavHqF.png
Activated by string: DynTune="140 - 200"
Eserissen
20th July 2022, 20:24
I don't understand those who remove the logo from images and videos.
Espinosa
21st July 2022, 08:15
I need help to remove the semi-transparent logo in the upper right corner of this video (neglect those black bars, they will be removed anyway). I used InpaintDelogo before to remove letters from logos in "Inpaint" mode and it usually gave good results, but this time I couldn't do anything in "Deblend" mode.
https://www.mediafire.com/file/kzzerp0fk93zhe5/sample.mkv/file
VoodooFX
21st July 2022, 15:53
I need help to remove the semi-transparent logo in the upper right corner of this video (neglect those black bars, they will be removed anyway). I used InpaintDelogo before to remove letters from logos in "Inpaint" mode and it usually gave good results, but this time I couldn't do anything in "Deblend" mode.
https://www.mediafire.com/file/kzzerp0fk93zhe5/sample.mkv/file
First, deinterlace and crop video, encode it to lossless:
QTGMC(Preset="Medium", Sharpness=0.2)
Crop(264,6,-258,-2)
Then run InpaintDelogo on that lossless file:
InpaintDelogo( mask="D:\mask.bmp", Loc="1170,44,-0,-950", Mode="Both", Analyze=3, dPP=4, oTune=-5)
Spline36Resize(752,576)
Probably on this video "Analyze=3" is most suitable. Basemask can be easily done with Photoshop.
Actual footage is upscaled so we downscale it back to "sd" res.
"Both" because those black letters are not transparent.
With logo:
https://i.imgur.com/UpolKsf.jpeg
Logo gone:
https://i.imgur.com/tBT10pN.jpeg
PS:
Something is wrong with FPS, got 100fps and twice shorter clip, maybe it's issue with sample...
Espinosa
21st July 2022, 21:35
Of course I tried this but got this error:
https://i.ibb.co/wM0W8Hw/image.png
My mask has a black background with a white rectangle at Loc position. I'm going to update the core files and plugins and then run the script again.
VoodooFX
21st July 2022, 21:56
Update InpaintDelogo.
Espinosa
21st July 2022, 22:25
Now this:
https://i.ibb.co/VtswCwK/image.png
VoodooFX
21st July 2022, 22:52
"AviSynth+ v3.7.1 or later", check Avisynth version with Version().
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.