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 > Capturing Video

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th May 2005, 21:14   #1  |  Link
ppera2
Registered User
 
ppera2's Avatar
 
Join Date: Oct 2001
Location: Lands of confusion
Posts: 1,217
Yet another unlogo script - simple usage

It is based on Dekafka AVS script. I changed it, so no need to colorspace conversion to RGB32 by usual YUY2 capture.
There is no need to make mask bitmap too. Blurring is dropped out,
because it makes some green artifacts at right edge, and no really need for it, because bilinear upsize blurs well.

Plus: Works with YUY2 colorspace, no conversion to RGB
Fast
No need to make mask

Minus: It covers bigger area than masked delogo solutions

However, by covering original logo with reactangle it is totally masked, so hard to guess what whas there, what may be good in some cases.


Here is function, and example how to call it:



function delogo(clip)
{

#TV BBC15, Res 576x560 (crop top & bot. by 8) - memo, optional

#Position & size & Opacity - enter here values by logo position and size

Xp = 488
Yp = 18
X = 48 #Must be dividable by 4
Y = 66
Op = 255

#By need:
#clip = clip.ConvertToYUY2()

top = clip.Crop(Xp, Yp-2, X, 2)
bot = clip.Crop(Xp, Yp+Y, X, 2)
left = clip.Crop(Xp-4, Yp, 4, Y)
right = clip.Crop(Xp+X, Yp, 4, Y)

logoh = StackVertical(top, bot).BilinearResize(X, Y)
logov = StackHorizontal(left, right).BilinearResize(X, Y)
logob = Layer(logoh, logov, "fast" )
clip = clip.Layer(logob, "add", Op, Xp, Yp)
return clip
}

# SOURCE
clip=SegmentedAvisource("J:\Capture1.avi",pixel_type="yuy2")

#Crop by need...

clip=clip.delogo()

#Resize, filters....
clip=clip.BilinearResize(Width,Height)

return clip




Btw: when use blur in AVS with narrow clips, it results with some green artefacts at right side. Is it because of small dimensions or general bug? It is best viewable by B/W clips.
__________________
Informational value of an advert is in inverted proportion to beauty of playing model(s)/actress(es)
ppera2 is offline   Reply With Quote
Old 20th May 2005, 14:24   #2  |  Link
ppera2
Registered User
 
ppera2's Avatar
 
Join Date: Oct 2001
Location: Lands of confusion
Posts: 1,217
Script with masking

Here is a new version, with masking. It uses new AVS function overlay (from Ver 2.54), where masking with
YUV colorspaces is also possible. It's almost same as delogo script, just uses B/W mask for blending only area where logo is, by any shape. Mask preparation is same as by DeKafka, but it is best to save it as 1 frame long, YUY2 AVI.
Use Mpeg2dec.dll (and 'old' DVD2AVI)instead DGDecode if want right YUY2 from Mpeg2...


Plus: No conversion to RGB, works with YUY2
Fast

Minus: ???


The script:


function delogom(clip, masklogo)
{

#Position & size & Opacity - ENTER HERE values by logo position and size

#BBC18 , Logo right, res 720x576

Xp = 560
Yp = 24
X = 122 #must be dividable by 4
Y = 82
Op = 1 # 0 - 1 ! (Overlay of AVS)

#By need:
clip = clip.ConvertToYUY2()

top = clip.Crop(Xp, Yp-2, X, 2)
bot = clip.Crop(Xp, Yp+Y, X, 2)
left = clip.Crop(Xp-4, Yp, 4, Y)
right = clip.Crop(Xp+X, Yp, 4, Y)

logoh = StackVertical(top, bot).BilinearResize(X, Y )
logov = StackHorizontal(left, right).BilinearResize(X, Y)
logob = Layer(logoh, logov, "fast" )

#Only when clip is resized...
#masklogo = masklogo.BilinearResize(X, Y)

clip = Overlay(clip, logob, mode = "blend", opacity = Op, x = Xp, y = Yp, mask = masklogo)
return clip
}

# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")

# SOURCE
clip=mpeg2source("E:\Mex.d2v")

masklogo=AVISource("E:\PM720.avi")

# CROPPING
clip=clip.crop(14,2,704,572)

clip=clip.delogom(masklogo)

# RESIZING
#clip=clip.BilinearResize(544,400)

return clip


I will try blurring with UnFilter later...
__________________
Informational value of an advert is in inverted proportion to beauty of playing model(s)/actress(es)
ppera2 is offline   Reply With Quote
Old 24th May 2005, 18:49   #3  |  Link
ppera2
Registered User
 
ppera2's Avatar
 
Join Date: Oct 2001
Location: Lands of confusion
Posts: 1,217
Here is how 'blur bug' looks:

http://piters.tripod.com/pics/
__________________
Informational value of an advert is in inverted proportion to beauty of playing model(s)/actress(es)

Last edited by ppera2; 25th May 2005 at 11:57.
ppera2 is offline   Reply With Quote
Reply

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 15:37.


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