Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th September 2019, 13:43   #41  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,099
Quote:
Originally Posted by manolito View Post
Mani, where did you get above info ?

Might try doing UGlarm thing, and add to s_ExLogo2()

EDIT: I presume that 'distance' is by Pythagoras.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is online now   Reply With Quote
Old 11th September 2019, 14:24   #42  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 2,612
It comes from here:
https://www.sendspace.com/file/odmobw

It is for version 3.01 (the latest plugin version is 4.01), but this is the last help version I could find...
manolito is offline   Reply With Quote
Old 11th September 2019, 15:04   #43  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,099
Thanks Mani, was in plugin docs eh, I was trying to find webpage.

Bout 25% done now, will initially be for SOME avs standard colorspaces only, I will though want avs+ eventually. [will also supply v2.58 plug + x64]

Doin' it summick like this,

Code:
Function Uglarm(clip c,                                                     [* Avs v2.58 & v2.60 std supports YV12/YUY2/RGB32/RGB24 : Avs+ r2915+ also YV16, YV12, YV24, Y8 *]
        \ int LogoX,int LogoY,Int LogoW,Int LogoH,                          [* ALL coords can be -ve, where RHS/BOT relative, LogoW & LogoH can additionally be 0 where RHS/BOT relative*]
        \ int "ClipX"=0,int "ClipY"=0,Int "ClipW"=0,Int "ClipH"=0,          [* ClipW, and ClipH coords can be zero or -ve, where RHS/BOT relative (but ClipX:ClipY cannot be -ve) *]
        \ float "SAR"=1.0,                                                  [* Sample (Pixel) Aspect Ratio (x/y)*]
        \ float "BlurPower"=1.0,                                            [* 1.0 -> ??? *]
        \ Int "ShowMode"=0                                                  [* 0=Overlay Logo Patch(Clipped Logo), 1=Overlay Logo Patch(Clipped) & Border, 2=DeLogo *]
        \ Bool "Blank"=false                                                [* Where ShowMode==2 and Blank==True then Blank to Black any border area (border is outside of Clip args) *]
        \ )
EDITED:

EDIT: I'm not taking any pixel Aspect Ratio into account for distance, dont think it worth the (small) effort. [EDIT: See SAR above]

EDIT: ShowMode = 1 Example showing Patch Area (after clipping, in Yellowish), Clipped out area (In Reddish), and border Area in Purplish.
Yellowish + Reddish is original non clipped Logo Coords.
Code:
Avisource(".\Parade.avi")
Crop(0,0,Width/4*4,height/4*4)      # Make Mod 4

ConvertToRGB24     # Internally Converted to RGB32 and back to RGB24 again [Layer() requirement, supports only YUY2 & RGB32].

LogoX    = -100    # Can be -ve, Width  relative
LogoY    = -100    # Can be -ve, Heigth relative
LogoW    =  -20    # Can be 0 or -ve, Width  relative
LogoH    =  -20    # Can be 0 or -ve, Height relative

                   # Clipping Coords (inside is valid graphic, outside of it is border/Letterbox)
ClipX    =    0    # Black border area, +ve ONLY
ClipY    =    0    #   ditto
ClipW    =  -50    #   Can be 0 or -ve, Width  relative
ClipH    =  -50    #   Can be 0 or -ve, Height relative

BLURPOWER=  1.0
SHOWMODE =    1
BLANK    = False

Uglarm(LogoX,LogoY,LogoW,LogoH,ClipX,ClipY,ClipW,ClipH,BlurPower,ShowMode,BLANK)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 12th September 2019 at 21:18.
StainlessS is online now   Reply With Quote
Old 12th September 2019, 15:29   #44  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,115
@VoodooFX

Thank you for this script. I tried it out and I was very pleased with the results.
Reel.Deel is offline   Reply With Quote
Old 12th September 2019, 20:23   #45  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,099
Function prototype in post #43 updated.

Got the Uglam overlay stuff working fine, but the delogo part was well slow (and did not quite work on initial attempts).
Did some searching and found this source patch file for ffmpeg, cant say it made a lot of sense to me (at first, never used SubVersioning stuff before),
but managed to figure it out a bit but probably a little more time till working OK. Is a fast way to precalc tables for UGLARM interpolation,
unfortunately, they use coords for logo which include the border pixels, and I exclude them, so need a bit of a redo, but getting there.
[also seems to expect valid perimeter pixels all around the logo, whereas I allow for letterbox border overlap of logo, so more changes there too].

Here the patch source code thing that I found on UGLARM search:- https://patchwork.ffmpeg.org/patch/11585/
probably will not make much sense, presume that you are supposed to use some kind of dedicated patch code reader software to be able to understand it.
anyways, I mostly got it figured out [and dropped some dross that was either dormant or did not work].

Anyways, I then (just now) found original source of the Uglarm tables code from ffdshow:- https://sourceforge.net/p/ffdshow-tr...erLogoaway.cpp
ffdshow stuff makes a lot more sense than the ffmpeg patch file I was working with. Relevant table creation stuff is in TimgFilterLogoaway.cpp functions,

Code:
void TimgFilterLogoaway::Tplane::calcUweWeightTable(int w, int h, int power)

void TimgFilterLogoaway::Tplane::uwe(const TlogoawaySettings *cfg)
I've still gotta convert from their definition of logo coords to mine, but at least easier to read.

Leaving this here so I can more easily find it again (ffdshow link), maybe of interest to some others too [incl VDX].
[Also wanna keep record of where I got source from so that I can point to it as per GPL requirements].

Also, here on-line version of Manolito linked LogoAways docs:- http://vander.wojdon.net/virtualdub/.../logoaway.html
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 12th September 2019 at 20:30.
StainlessS is online now   Reply With Quote
Old 13th September 2019, 15:20   #46  |  Link
VoodooFX
Registered User
 
Join Date: Sep 2008
Posts: 78
Quote:
Originally Posted by StainlessS View Post
I'm not taking any pixel Aspect Ratio into account for distance, dont think it worth the (small) effort. [EDIT: See SAR above]
I don't see any practical effect of that, or even theoretical... unless to make a parameters list longer. Thats would be same as adding SAR parameter to Blur() or any other function, or I miss something here!?
VoodooFX is offline   Reply With Quote
Old 13th September 2019, 18:39   #47  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,099
I obviously wanted to make the parameter list longer, so as to seem more complicookered, me likes that.

Still not got the damn thing working properley, on last try (using more like the original patch code), it was prodcuing something quite akin
to the mandelbrot stuff, looks well weird. Maybe I see when working, if SAR stuff makes any difference, eliminate if not.
[SAR affects distance calcs for uglarm, so for chroma of eg YUY2 or YV16, should make a fair bit of difference, maybe. SAR auto modified for chroma of YUY2 and YV16].
Although, when I've ever used any delogo thing in eg Vdub, I never bothered with SAR.

EDIT:




EDIT: If there had been a logo in above images, they would certainly have been eliminated.
Had I done above patterns deliberately, I would have been quite proud if it.
I bet you mathematicians out there can tell what I'm doin' wrong just by lookin' at it.
EDIT: Gone t' pub.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 13th September 2019 at 19:02.
StainlessS is online now   Reply With Quote
Old 17th September 2019, 03:33   #48  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,099
Uglarm v0.0 Logo Interpolator now posted, Guinea pigs required, Here:- https://forum.doom9.org/showthread.php?t=176891

No idea how it compares to others tested in this thread.

EDIT: Seems a bit slow on YV12 UT_Video FullHD 192x192 logo, bout 11.8 FPS on my crap Core Duo Quad 2.8GHz m/c. [23% CPU usage, x64 version, bout 9FPS x86]

Mani, as you seem to like Uglarm Method, hows bout give it a whirl, with comparison times etc.
(Likely some bugs to iron out, tis still a baby).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 17th September 2019 at 04:42.
StainlessS is online now   Reply With Quote
Old 29th September 2019, 02:00   #49  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,099
Hi VDX, can I request a feature update.
I like to be able to use -ve width and height as in crop, but not quite so keen on being forced to only use -ve values,
so how bout making +ve width and height possible in your loc string thing ?

Below should do it in both your InpaintLoc(), and InpaintDelogo() functions.

InpaintLoc() mod in BLUE
Code:
    a           = int(value(leftstr(loc,posvirg1-1)))
    b           = int(value(leftstr(rightstr(loc,long-posvirg1),posvirg2-posvirg1-1)))
    c           = int(value(leftstr(rightstr(loc,long-posvirg2),posvirg3-posvirg2-1)))
    d           = int(value(rightstr(loc,long-posvirg3)))

    c           = (c > 0 ) ? a+c-x: c         # Added, convert +ve width  to -ve width
    d           = (d > 0 ) ? b+d-y: d         # Added, convert +ve height to -ve height

    hightlight  = blankclip(width=x-a+c,height=y-b+d,color=$96ff2d).converttoRGB32    # EDIT: This depends upon -ve crop values, may do elsewhere in script too.
InpaintDelogo() mod in BLUE
Code:
    a           = int(value(leftstr(loc,posvirg1-1)))
    b           = int(value(leftstr(rightstr(loc,long-posvirg1),posvirg2-posvirg1-1)))
    c           = int(value(leftstr(rightstr(loc,long-posvirg2),posvirg3-posvirg2-1)))
    d           = int(value(rightstr(loc,long-posvirg3)))

    c           = (c > 0 ) ? a+c-x: c         # Added, convert +ve width  to -ve width
    d           = (d > 0 ) ? b+d-y: d         # Added, convert +ve height to -ve height


    inYV12      = clp.Crop(a,b,c,d).ConvertToYV12
    inRGB24     = clp.Crop(a,b,c,d).ConvertToRGB24
    inRGB32     = clp.Crop(a,b,c,d).ConvertToRGB32
Instead of converting -ve values to +ve values, I've converted +ve values to your -ve style values, just in case your logic depends upon -ve crop values.


Thankyou in advance.

EDIT:
I now see that you updated since the version script I was using,
Here mod for InpaintLoc() my mod in BLUE, you addition in v1.12 in DarkOrchid [ do similar for InpaintDelogo() ]
Code:
    a           = int(value(leftstr(loc,posvirg1-1)))
    b           = int(value(leftstr(rightstr(loc,long-posvirg1),posvirg2-posvirg1-1)))
    c           = int(value(leftstr(rightstr(loc,long-posvirg2),posvirg3-posvirg2-1)))
    d           = int(value(rightstr(loc,long-posvirg3)))

    c           = (c > 0 ) ? a+c-x: c         # Added, convert +ve width  to -ve width
    d           = (d > 0 ) ? b+d-y: d         # Added, convert +ve height to -ve height

    Assert (c   <= 0 && d <= 0,"""Incorrect "Loc".""")
	Assert (a   >= 0 && b >= 0,"""Incorrect "Loc".""")
	Assert (a%2 == 0 && b%2 == 0 && c%2 == 0 && d%2 == 0,"""Use even numbers for "Loc".""")

    hightlight  = blankclip(width=x-a+c,height=y-b+d,color=$96ff2d).converttoRGB32
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 29th September 2019 at 02:41.
StainlessS is online now   Reply With Quote
Reply

Tags
avsinpaint, delogo, inpaint, remove, watermark

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.