View Full Version : InpaintDelogo - advanced logo removal & hardcoded subtitles extraction
StainlessS
8th November 2020, 05:53
but how in the hell top/right corner mask is red, feathered and "12" visible when it goes through Greyscale.Levels(127,1,128,0,255)...
Dont see why it should make it red, however should for YUV use
Greyscale.Levels(127,1,128,0,255,coring=false)...
VoodooFX
8th November 2020, 18:50
Dont see why it should make it red, however should for YUV use
Greyscale.Levels(127,1,128,0,255,coring=false)...
It's random/non-reproducible bugs, when using Prefetch(4). Masking and Levels(127,1,128,0,255) happens in RGB32.
WriteFileIf with a runtime function expression like lumadifference . But there was some bugs in avs+ 3.x with this. It works in 2.6 classic. There was some discussion about this somewhere IIRC. Not sure what changed or what the exact syntax change was
Something like this works in avs+ 2.6 classic
Subtract(clip1,clip2)
WriteFileIf (last, "log.log", "LumaDifference(clip1, clip2)>0", "current_frame", """ ":" """, "AverageLuma")
Thanks mate, that works perfectly. I edited it a bit so I can copy/paste log to SelectEvery:
Subtract(clip1,clip2)
WriteFileIf (last, "log.log", "LumaDifference(clip1, clip2)>0", "current_frame", """ ", \" """)
AvS 2.60(2.6.0.6) & AvS+ 3.5 (r3106) produced identical logs, AvS+ was 20% faster.
I run comparison on stacked output with 4 steps (like in screenshot in the previous page), so, Prefetch(4) vs no Prefetch:
Detected discrepancies in 157 frames from 134237 frames, almost all of them in the top/right mask, in 18 frames those mask are ok but discrepancies are in the final step(bottom/left, but no visible differences).
Here is some examples of the bugged masks (it should be B/W with white numbers, last two digits shouldn't be visible), stacked original clip & one mask:
https://images2.imgbox.com/ca/ad/n9FYMKWk_o.png https://images2.imgbox.com/af/3b/p7sw5uLL_o.png https://images2.imgbox.com/a1/3d/2JNsCOBa_o.png
https://images2.imgbox.com/59/c5/xyjen4Kz_o.png https://images2.imgbox.com/49/53/DG2zockZ_o.png https://images2.imgbox.com/e7/0f/V30pe7R5_o.png
https://images2.imgbox.com/0a/aa/6JUDcQif_o.png https://images2.imgbox.com/25/d6/pRWl1UjQ_o.png https://images2.imgbox.com/9c/56/P6bjRjvx_o.png
https://images2.imgbox.com/85/6f/IXiTWaN8_o.png https://images2.imgbox.com/6e/ba/EB1gupeN_o.png
Now I need to run more tests to isolate the problem.
poisondeathray
8th November 2020, 20:20
What format was source video ? Did you try threads=1 for LSmash ? Or other source filters to rule out some issue upstream ?
To be clear, was the issue only with Prefetch(4) ? Is no prefetch ok ? Or other values ?
I recall some discussion about source filter threads and seeking accuracy issues vs. host CPU threads , but I think that was for ffms2
VoodooFX
9th November 2020, 13:28
Like I suspected it's something with Overlay, tested and same on AvS+ 3.4, 3.5.1, 3.6.0, 3.6.1.
Here is minimized and ready to run test scripts (extract to C:\) or preview included test results https://anonfiles.com/F7E0hdo2p0 or https://we.tl/t-J95N1CsfUz (7 days)
What format was source video ? Did you try threads=1 for LSmash ? Or other source filters to rule out some issue upstream ?
To be clear, was the issue only with Prefetch(4) ? Is no prefetch ok ?
Isn't "threads=1" parameter for ffms2!? No-Prefetch is ok. I dunno working alternatives for LSMASH, and whatever source filter outputs it shouldn't bypass binarization of the frames.
pinterf
11th November 2020, 19:03
Like I suspected it's something with Overlay, tested and same on AvS+ 3.4, 3.5.1, 3.6.0, 3.6.1.
Here is minimized and ready to run test scripts (extract to C:\) or preview included test results https://anonfiles.com/F7E0hdo2p0
"Bad gateway", expired perhaps?
StainlessS
11th November 2020, 19:10
Same here, 502 Bad gateway. nginx.
Maybe that nginx thing is the block on your location for download, (cant remember what its called).
Can anybody launch successful download ?
EDIT: The Bad Gateway page is showing as Sweden in FlagFox. [dont know if relevant]
VoodooFX
11th November 2020, 19:48
"Bad gateway", expired perhaps?
Still works on my side. Here is another link: https://we.tl/t-J95N1CsfUz
poisondeathray
11th November 2020, 20:08
Isn't "threads=1" parameter for ffms2!? No-Prefetch is ok. I dunno working alternatives for LSMASH, and whatever source filter outputs it shouldn't bypass binarization of the frames.
LSmash has threads=blah parameter too. But non frame accurate runs will account for differences between repeated tests, when prefetch is used
I repeated test with x64 version - I think the problem is lsmash threads=auto vs. threads=1 for x64. I think it' s similar to the aforementioned ffms2 threads bug with prefetch
EDIT - multiple consec runs can result in different results, even with source filter threads=1 . One run can show PSNR inf, but another something lower. Something else is going on...
It even occurs when source is encoded to I-frame UTVideo, and using AVISource instead; multiple runs can show different results when prefetch is used. So not source filter related
VoodooFX
11th November 2020, 20:46
I repeated test with x64 version - I think the problem is lsmash threads=auto vs. threads=1 for x64.
I tested threads=1 like you did, only with 32bit and got one frame bugged, so bug is there with threads=1 too. It makes less chance for bug to occur, 5mins is too short test for this condition.
Looking at those bugged masks I think it's something with buffer/memory, just a guess, I'm not into lower level programming.
poisondeathray
11th November 2020, 20:48
I tested threads=1 like you did, only with 32bit and got one frame bugged, so bug is there with threads=1 too.
Yes, it's almost "random", see my edits above . One run can be perfect, but the next a few frames off, the next perfect again. It's not source filter related
poisondeathray
11th November 2020, 21:05
If you change the script to use mt_merge (and full range YUV masks , PC matrix if converting from RGB), 10/10 runs are the same with prefetch=4. So that suggests it is something with overlay and prefetch
pinterf
11th November 2020, 21:51
Yes, it's almost "random", see my edits above . One run can be perfect, but the next a few frames off, the next perfect again. It's not source filter related
Here is my minimalized script.
# Load VirtualDub, Press F2, go to frame 2-3-4 and back, refresh, step between frames left and right
# suddenly a garbage is seen
DynamicMask = BlankClip(1000, 128, 128, pixel_type="RGB32")
WhiteClip = BlankClip(DynamicMask,color=$FFFFFF)
BlackClip = BlankClip(DynamicMask,color=$000000)
BlackClip.Overlay(WhiteClip, Mask=BlackClip)
Prefetch(4)
Thank you for giving me the opportunity to work on it :)
VoodooFX
12th November 2020, 11:09
Here is my minimalized script.
Thank you for giving me the opportunity to work on it :)
Yep, Vdub2 reveals this bug on the first frames. Have fun with it. ;)
pinterf
12th November 2020, 12:24
Please check a (hopefully) fixed Avisynth build (https://forum.doom9.org/showthread.php?p=1928109#post1928109)
VoodooFX
26th November 2020, 18:43
There is some bug with high resolutions like 1920x1080 and AvsInpaint, if a mask is close to the left/right side then AvsInpaint hangs at start (no error).
Here is the bug simulator:
x=BlankClip(length=1000, width=1920, height=1080, color=$000000, pixel_type="YV12")
mask = BlankClip(x, length=1).Subtitle("Sample", text_color=$FFFFFF, x=8).Levels(180,1,181,0,255, coring=false)
# mask = BlankClip(x, length=1).Subtitle("Sample", text_color=$FFFFFF, x=519).Levels(180,1,181,0,255, coring=false) # Working position, moving the mask 1px to left("x=518") - hangs.
# x.InpaintLogo(mask, PreBlurSize=0.9, PostBlurSize=0.9) # Droping the blur kernels to 0.9 - no hangs.
x.InpaintLogo(mask)
EDIT:
Bug should be fixed in AvsInpaint v1.3
VoodooFX
28th November 2020, 18:05
New version released (updated the first post):
# Version 1.11 : 2019/08/31. First public release.
# Version 1.12 : 2019/09/06. Various tweaks. New parameters. "Inflate" and "Deep" changed.
# Version 1.13 : 2019/12/08. Allow -ve LogoX,LogoY, and +ve LogoW,LogoH in Loc string (by StainlessS).
# Version 1.14 : [non public] "Fr1"/"Fr2" are renamed to "FrB"/"FrW". "GrainPP" is off by default.
# Version 1.15 : [non public] New mode for "InterpM", (-1) takes mask from new "iTune" parameter.
# Version 1.16 : [non public] New "diPP" & "diPPm" parameters.
# Version 1.17 : [non public] New "iTinflate" & "oTinflate" parameters. Interp/iTune mask to "mShow".
# Version 1.18 : [non public] New "EdgePP", "EdgePos" & "EdgeWide" parameters. EdgeMask to "mShow".
# Version 1.19 : [non public] New "IntSpd" parameter for "Interp" & the slow modes for "EdgePP".
# Version 1.20 : [non public] "Turbo" presets moved from soft to hard. iTune & Edge masks to "Show".
# Version 1.21 : [non public] Added support for the mask clips and a dynamic mask.
# Added basic auto generation of a dynamic mask (aka "DynMask=2").
# New parameters: "DynMask", "DynInflate", "DynTune", "KillNoise", "maskPatch".
# Version 1.22 : [non public] Optimized speed for a dynamic mask, MaskTools2 required.
# Version 1.23 : [non public] Added auto generation of a dynamic mask with ClipBlend (aka "DynMask=3").
# New parameters: "Dyn3Seq", "ClpBlend", "DynPostTune", "Dyn3buffer".
# Version 1.24 : 2020/11/28. Various tweaks. "Show" 3 & 4. Updated the manual with the new stuff.
One example of the dynamic logo/delogo is in the thread there -> Detect Position of Watermark in movie and remove with logo inpaint (https://forum.doom9.org/showthread.php?p=1929302#post1929302)
maybe your script will help if it work with mask clip :)
Check if it helps anything.
real.finder
28th November 2020, 18:34
New version released (updated the first post)
Check if it helps anything.
thanks! but it's still in "Attachments Pending Approval", can you upload it else where?
VoodooFX
28th November 2020, 19:53
Here are screens for another dynamic logo removal:
https://thumbs2.imgbox.com/2a/9b/7aj4bVy8_t.jpg (https://imgbox.com/7aj4bVy8) https://thumbs2.imgbox.com/a4/0e/8mbBUL3z_t.jpg (https://imgbox.com/8mbBUL3z)
12s GIF sample (stacked: original, dynamic mask, delogo output):
https://i.imgur.com/hq0JbO2.gif
manono
28th November 2020, 22:11
It's approved now. As I don't read every post in every forum, if you have something needing approval, you can PM me if you like.
StainlessS
29th November 2020, 01:47
In your [@ VoodooFX] post #118 attachment [12s GIF sample], I earlier saw a white flash in bottom image part, it is now gone.
[maybe at end of repeated loop]
EDIT: attachment update, ? EDIT: your shit, is "The Shit" (well good man) :)
VoodooFX
29th November 2020, 04:03
Maybe some flashback. :)
Nothing changed, just removed a pastebin link when manono approved the attachment on the first post.
manolito
29th November 2020, 07:35
Thanks for the new version... :thanks:
I have been very happy with the previous version, using only limited capabilities of the plugin. Only Inpaint mode and Analyze=4 for mask creation. Blew everything else out of the water for me.
Out of curiosity I used the new version for a few test conversions. I am not interested in the Dynamic Mask stuff, I just want to know if some of the "Various Tweaks" make a difference for me. The change which sticks out is that GrainPP is now OFF by default. I already made two conversions using the new version, and they looked beautiful. But then again the sources were not noisy at all, need to test it with grainy sources, too.
Thanks again, Cheers
manolito
real.finder
29th November 2020, 13:30
Check if it helps anything.
it did better in some cases and worse in some others, anyway I will add it in stab3
VoodooFX
29th November 2020, 14:03
it's did better in some cases and worse in some others, anyway I will add it in stab3
If you compare both script and plain plugin with defaults then script has better tuned defaults. Should be compared when running video result at normal fps, not looking at the static frames.
But those are optimized for normal logos, in your case you have only one side to interpolate, I'm sure that for this special case you can find better settings.
I am not interested in the Dynamic Mask stuff, I just want to know if some of the "Various Tweaks" make a difference for me. The change which sticks out is that GrainPP is now OFF by default.
Shouldn't be any visible changes to the old stuff, I encountered very few sources where "GrainPP" helps, so it's off by default as it's slow filter and can make artifacts standout a bit more for no reason.
"Various Tweaks" - just some "bug" catch asserts or speedup for the new stuff here and there, like at the last minute I added a conversion to Y8 for ClipBlend as it runs much faster without chroma present.
SkyBlue19
1st January 2021, 10:35
Hi All,
Happy New Year to you. I've been playing around with Inpaint Delogo, following the guide in the avsi file, the breakdown by manolito and this thread.
Here is before:
https://i.imgur.com/QynBHHz.png
Here is after:
https://i.imgur.com/Y1O9T94.png
As you can see it is mostly gone but there is a red smudge remaining. Can anyone suggest what I can do to remove that red smudge - if anything? I appreciate it is going into the black bar at the top but that isn't an issue for me as I am doing some color correction afterwards and will re-black it then.
Here is the first part of my script to generate the mask:
InpaintDelogo(mask="C:\Desktop\xxx.bmp",Automask=1, aMix=0, Loc="1150,10,-78,-652",Mode="Inpaint",Analyze=3, FrB=38604, FrW=132193, FrS=0)
And here is the second part for the logo removal:
Loc="1150,10,-78,-652"
InpaintDelogo(mask="C:\Desktop\xxx.bmp", Loc=Loc, Mode="Inpaint", Turbo=0)
Can anyone suggest anything? Or indeed anything to further improve the logo removal, not just the red smudge?
Many thanks
PS - I am a very basic avisynth user :)
VoodooFX
1st January 2021, 16:46
You asked me same yesterday by pm. :)
Cut black bars before doing anything, edit mask to cover that red bleed, maybe that bleed can be deblended in "both" mode.
https://i.imgur.com/3bEnoZV.png
SkyBlue19
3rd January 2021, 00:02
Ah different name and different site - small world :) I tried to expand the loc coordinates but that didn't seem to make much difference so I edited the bmp produced in stage one and drew some extra white pixels at the bottom, which has now got rid of the red smudge. Unfortunately "both" made it look at lot worse but I am happy now, looks great. Thanks again
katzenjoghurt
28th April 2021, 23:59
I played around with this super-promising script for some days now.
I wasn't happy with the result... my inprinted region always had some nasty "embossing" effect. The regions were very alive and with enough motion you could even read the text of the logo.
The result got better when cranking up post-blur and/or the radius... but it was never really great and the encoding times got unbearable.
Only now I realized that the script (or its defaults) don't like UHD resolution too much but it performs really well in FHD.
I guess that's due to the fact its parameters work with absolute pixels and maybe some internal values do so too.
So here is what I got:
https://i.imgur.com/50uBKuq.png
Both were encoded with the same default parameters:
InpaintDelogo(mask="V:\Logos\Test\Pack\ABC-Testlogo-Mask-FullHD.bmp",Automask=0,Loc="1370,32,-58,-982", Mode="Inpaint")
InpaintDelogo(mask="V:\Logos\Test\Pack\ABC-Testlogo-Mask-4k.bmp",Automask=0,Loc="2750,72,-126,-1966", Mode="Inpaint")
FullHD Source: https://youtu.be/KkX9Paq_LeA
FullHD with Logo: https://youtu.be/MfCvNclkj_o
FullHD Inpaint: https://youtu.be/YM1ouZyGDV8
UHD Source: https://youtu.be/GgE79UaAH2E
UHD with Logo: https://youtu.be/C-aLEDI65MM
UHD Inpaint: https://youtu.be/Pmo-TNh45q8
The clip is anything but perfect to show the problem but it gets most noticeable in the last 4secs of the UHD Inpaint clip.
edit:
Added a second example:
FullHD with Logo: https://youtu.be/8BLaVDqtuPA
FullHD Inpaint: https://youtu.be/vPNMzbtpaoA
UHD Inpaint: https://youtu.be/JEDn6bGiaGg
Attachments:
Masks (converted to PNGs due to size) and Overlays used to bake into videos.
VoodooFX
29th April 2021, 08:11
If with defaults you could cover every video source and logos, then parameters wouldn't be needed at all.
Your examples shows that problem is: 1) Not using parameters. 2) Upscaling is a bad thing. :)
On your 2x upscale you need to increase these at least, to get somewhat similar results to results on original:
inflate=2
radius=16
PS
Do you have real UHD with logo example, or you are just playing around with the synthetic tests!?
katzenjoghurt
29th April 2021, 09:21
Hi VoodooFX.
Of course I originally tried to delogo some UHD material and the result always came with that „emboss“ like effect you see in the comparison table I started playing around.
In fact the effect is even much more distracting there than I could simulate it with my iPad’s FHD camera and the upscales. But it was still visible and the very same problem.
It‘s not just visible in my synthetic tests. :)
But it would make sense to increase radius and inflate for UHD, yes. Just... as I mentioned the encoding times become pretty unbearable when cranking up radius/Post-Blur which lead to a better result for me. Didn‘t try inflate though yet.
What I do when programming computer games and working with blur shaders is doing the blur on a lower resolution to save performance. But no clue if that would work here without getting noticeable jaggies.
I‘ll do some more tests and look for some copyright-free real UHD clips.
VoodooFX
30th April 2021, 09:41
You can share short examples from copyrighted clips too, legally it's called "fair use".
From my side I could only increase max radius on 'mPPo', but I think smoothing 7 pixels around edges should be enough for UHD too.
loonvf
15th July 2021, 07:45
Hi All,
I'm trying to see if InpaintDelogo can solve my video problem too.
However I'm not successfull finding AVSInpaint.dll anywhere.
Any idea where to get the 32 and 64 bit versions of this dll
Thanks in advance,
loonvf
kedautinh12
15th July 2021, 07:49
Here:
https://github.com/pinterf/AvsInpaint/releases
kedautinh12
15th July 2021, 07:50
Avswiki if you find other plugins
http://avisynth.nl/index.php/External_filters
VoodooFX
15th July 2021, 16:07
However I'm not successfull finding AVSInpaint.dll anywhere.
All links are in the script, that is where you should look when you are trying any script, just open it with any text reader.
GMJCZP
26th July 2021, 16:49
Hello, where is the logo database located? These days I saw him but I no longer remember where he is.
VoodooFX
27th July 2021, 01:30
Hello, where is the logo database located? These days I saw him but I no longer remember where he is.
I don't know anything about the logo database.
GMJCZP
27th July 2021, 02:54
I don't know anything about the logo database.
Sorry, a link to a page with a database of logos from various television channels was published in another Doom9 post, but since I can't remember which one it is, I've made the comment here. I am so sorry.
StainlessS
27th July 2021, 12:36
database of logos
Maybe first few posts of this thread [EDIT: MeteorRain, DelogoHD]
is what you're lookin' for:- https://forum.doom9.org/showthread.php?t=176658
If not then google
"logo" NEAR "database" site:forum.doom9.org
given link is top of the link list of the google search.
GMJCZP
28th July 2021, 12:22
Effectively, it's DelogoHD, is here:
https://down.7086.in/lgd/
Thank you very much Mr. StainlessS aka TinMan!
kedautinh12
28th July 2021, 12:53
This link deprived SSTV and SSTV+
VoodooFX
28th July 2021, 22:58
Database can be build for InpaintDelogo too, here are the logo deblending masks for Arsenal VODs:
https://images2.imgbox.com/4a/14/Vn5mOtFB_o.png
Arsenal (not perfect analysis, but it's pretty good) (https://drive.google.com/file/d/1a0ufZ1KhqtB5AdIhEDB8KJZdBEByR8cR/view?usp=sharing)
Example how filename corresponds to settings:
Filename - "arsenal_4-3.bmp_InpaintDelogo_1500-56-334-936_A3_1-2-3.ebmp".
Notice naming rule - "Basemask_InpaintDelogo_Loc coordinates_Analyze_FrB-FrW-FrS".
If InpaintDelogo finds ebmp file corresponding to the settings then it won't do analyze/generate the masks, it would just use the masks from that file.
This command would find the logo deblending masks named as the example above:
InpaintDelogo( mask="D:\arsenal_4-3.bmp", Loc="1500,56,-334,-936", Mode="Deblend", Analyze=3, FrB=1, FrW=2, FrS=3, Deep=0)
VoodooFX
14th August 2021, 02:52
New v1.30, tuned to remove subtitles.
Relevant thread: https://forum.doom9.org/showthread.php?p=1949702
To remove subtitles in this case used:
InpaintDelogo(Loc="50,600,-50,-14", DynMask=3, DynTune=-4, DynInflate=4, Dyn3Seq=13, ClpBlend=11, Show=5)
Before:
https://i.imgur.com/qcVEKHU.jpg
After:
https://i.imgur.com/hrvr0ZI.jpeg
StainlessS
14th August 2021, 16:18
Thats quite amazing VX,
is it necessary for InPaintDeLogo call for each and every text sub, yes ?
Or can you just supply a mask same len as whole clip with detected logo in 'fine red' [255,0,0],
or can you also supply in planar Y channel, and as same size as input frame, or as entire subs
target locate area, where all subs live over entire clip.
[cant remember how InpaintDelogo works]
johnmeyer
14th August 2021, 19:56
That is a pretty amazing result.
GMJCZP
15th August 2021, 03:30
It is simply amazing!
VoodooFX has lived up to its name to "killing" subtitles, awesome! If I had this tool at my fingertips a few years ago I wouldn't have had to place a solid box on hardsubs of some series that I translated.
Is there a tutorial to apply this?
Edit: The jewel in the crown would be to extract these subtitles to an SRT file.
VoodooFX
15th August 2021, 08:48
It is simply amazing!
VoodooFX has lived up to its name to "killing" subtitles, awesome! If I had this tool at my fingertips a few years ago I wouldn't have had to place a solid box on hardsubs of some series that I translated.
Actually it's not good on sources like this anime, because video is too static, levels are above TV range, fansubs don't follow standards like minimum 1 second duration nor minimum 1 frame between subs... and I don't see point in bothering with them, better to join fansubs community and get unsubbed source there.
StainlessS' "DetectSub_MI" method should be much better for this case (but script is not finished for the end use).
You could use ssa subtitles, there is option to add soft black box.
Is there a tutorial to apply this?
There is help about parameters in the script.
The jewel in the crown would be to extract these subtitles to an SRT file.
This is what I'm mostly interested in, and it greatly helped in the process to convert hardsubs to softsubs, maybe one day I'll write tutorial how to do it.
VoodooFX
15th August 2021, 09:19
Thats quite amazing VX,
is it necessary for InPaintDeLogo call for each and every text sub, yes ?
Or can you just supply a mask same len as whole clip with detected logo in 'fine red' [255,0,0],
or can you also supply in planar Y channel, and as same size as input frame, or as entire subs
target locate area, where all subs live over entire clip.
[cant remember how InpaintDelogo works]
No, you can supply whole mask clip (B/W), full range YV12 is expected, I think "mask=maskClip" should do it, resolution must be same as "Loc" area/setting (it can be full frame).
What you want to do?
Btw, I'm interested in detection method you done in "DetectSub_MI", would it be possible to detect subs in a mask and extract them to images? One image per sub with time range in the filename, for example like "0_00_56_958__0_00_57_957.tiff".
GMJCZP
15th August 2021, 15:03
Actually it's not good on sources like this anime, because video is too static, levels are above TV range, fansubs don't follow standards like minimum 1 second duration nor minimum 1 frame between subs... and I don't see point in bothering with them, better to join fansubs community and get unsubbed source there.
StainlessS' "DetectSub_MI" method should be much better for this case (but script is not finished for the end use).
You could use ssa subtitles, there is option to add soft black box.
There is help about parameters in the script.
This is what I'm mostly interested in, and it greatly helped in the process to convert hardsubs to softsubs, maybe one day I'll write tutorial how to do it.
Thanks for your answers.
In regards to extracting hardsubs here are some links:
https://www.videoconverterfactory.com/tips/extract-hardcoded-subtitles.html
http://redonesubs.blogspot.com/p/extracting-hardsubs.html?m=1
Long ago I used Subrip but the time to teach the program is somewhat high.
StainlessS
15th August 2021, 16:06
No, you can supply whole mask clip (B/W), full range YV12 is expected, I think "mask=maskClip" should do it, resolution must be same as "Loc" area/setting (it can be full frame).
Thanks.
What you want to do?
Dont know, just wantin' to know what is required at the moment.
I'm interested in detection method you done in "DetectSub_MI",
From here [about an earlier version of the script, but mostly same] :- https://forum.doom9.org/showthread.php?p=1780125#post1780125
The script basically extracts from RGB color value eg $FEFEFE, the individual R,G,B components of both Text and Halo, then calculates the range limits for
each channel using CHANVAR (just saves user from specifying min and max for each color channel individually for both text and halo).
The ShowRed, etc lines isolate pixels that fall within the acceptable ranges for all 3 channels for text, and then AND's them together so result is pixels where all 3 channels are in acceptable range. Same is then done for HALO.
The for next loop, Expands (swells) the text [edit: by halo HALO_W,HALO_H] so as to swell into the halo region (both horizontally and vertically), and then expands the halo to swell into the text region [edit: by TEXT_W,TEXT_H]. (These are two swelled frames shown in diagnostic as TEXT and HALO frames).
Finally, the expanded/swelled frames are AND'ed together for the diagnostic shown DETECT frame.
This detect frame therefore contains white pixels where text/halo were valid colors, and because of the AND'ed swellings, it also shows where both
text and halo swelled 'into' each other ie where they were adjacent to each other (allows to ignore randomly positioned pixels which just happen to be the
sort after colors).
The FindSub routine just checks the scan area using RT_YInRangeLocate() to see if there is a suspect area of white(good) pixels of sufficient 'bulk'.
would it be possible to detect subs in a mask and extract them to images? One image per sub with time range in the filename, for example like "0_00_56_958__0_00_57_957.tiff".
thinkin' bout it.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.