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. |
|
12th January 2008, 13:25 | #1 | Link |
Registered User
Join Date: Aug 2006
Posts: 29
|
New Logo Removal Plugin
Hi everybody,
finally I completed my logo removal plugin. This is the abstract from the help file: Image Inpainting is the art of restoring destroied parts of an image by using information of valid parts of the image in a way, so that the human eye does not recognize the damaged areas (at least not at a first sight). In video processing image inpainting is often applied to videos in order to remove TV station logos. This plugin comes with the intention to provide a suit for the removal of logos, whether opaque or transparent. It provides algorithms for these tasks:The logo detection and deblending are (more or less) what you (might) know from Karel Suhajda's DeLogo filter for VirtualDub (but extended to YUV color spaces). The inpainting method is the implementation of a pretty new algorithm which produces much less blurring than the DeLogo filter. As I coded everything in pure C (without CPU optimizations) you shouldn't expect real-time performance. This mathematics and algorithms (concerning inpainting) behind this plugin are still under heavy development and the effects of the various parameters are not fully understood yet. If you have some experiences with this plugin and some ideas which settings produce good results in which situations, please post them here so the authors can learn from it. Please do not contact any of the authors (WB, FB, TM) directly. Also I should note that this algorithm has originally been developed for inpainting pictures, not movies, so you might observe strong discontinuities in time. The plugin is attached to this thread as zip-file, including source code, a help file, and a demo script. Everything is licensed under the GNU GPL 2. See files AVSInpaint.htm and GNUGPLv2.txt for details. Have fun! Regards, AMSS Edit: Added version 2008.02.23 as announced here. AMSS Last edited by AMSS0815; 23rd February 2008 at 15:41. Reason: added version 2008.02.23 |
12th January 2008, 15:46 | #2 | Link |
Registered User
Join Date: Sep 2006
Location: UK
Posts: 416
|
Sweet. I use the Delogo filter alot, but I only use the alpha deblending. There's maybe a better way of just applying an alpha mask, but that's how I do it.
With Delogo, I just find a blackest possible background the logo and the make my own masks in photoshop. So I will test this out later. |
12th January 2008, 17:09 | #3 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 4,926
|
Inpainting goes Avisynth nice work AMSS0815
i think this here is interesting in those regards http://portal.acm.org/citation.cfm?id=1291237 it also seems a nice way for denoise/graining see http://www.mine.tku.edu.tw/advisors/...s/default.aspx Super-Resolution Inpainting http://www.mine.tku.edu.tw/demo/inpainting/default.aspx
__________________
all my compares are riddles so please try to decipher them yourselves :) It is about Time Join the Revolution NOW before it is to Late ! http://forum.doom9.org/showthread.php?t=168004 Last edited by CruNcher; 12th January 2008 at 17:21. |
13th January 2008, 00:53 | #4 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
will look to AVSInPaint!
Surpisingly, I prepare (almost finished, some doc need) two more avisynth impainting plugins (different algos) I partially interested in hole filling in motion stabilization and compensation, may be interpolation. Last edited by Fizick; 13th January 2008 at 09:45. |
13th January 2008, 03:35 | #5 | Link |
Registered User
Join Date: Sep 2002
Location: Germany
Posts: 352
|
Hey, this is great!
I was just looking for an inpainting solution for avisynth and bang - the same day you release your plugin! Just your demo.avs - it's too much for me (it's really late now where i live) Could you just please provide a simple(!) realworld example. maybe a small clip; a logo file and a small avs? I guess this would really help people to really understand what's needed to use your plugins! Thanky a lot, greetings, Malcolm |
13th January 2008, 23:54 | #6 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
AMSS0815, why you do not use stdcall calling convention instead C? It is now default in avisynth, and extra avisynth_c.dll is not needed
Your plugin is not very slow! GreyCstoration method in new GreyC plugin is probably slower: http://forum.doom9.org/showthread.php?t=123081
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
19th January 2008, 14:54 | #7 | Link | |||
Registered User
Join Date: Aug 2006
Posts: 29
|
Hi there,
Quote:
Quote:
Quote:
Please ignore lines 1-130: They only provide the test clip with the logo and a framework to arrange the nice output clip.There is also a small example in the help file (just put in your movie and try)... That's something I tried a lot about a year ago, but I failed. At the moment I'm using AviSynth_C.{dll|lib|h} in AviSynth_C-0.15.zip. When replacing AviSynth_C.{lib|h} by those in AviSynth_C-StdCall.zip (and recompiling and removing AviSynth_C.dll and the corresponding line in the avs-file), AviSynth 2.57 (build: Dec 31 2006) replies Unableto load C Plugin: AVSInpaint.dll. When replacing LoadCPlugin with LoadPlugin in the avs-file, I get LoadPlugin: unable to load "AVSInpaint.dll". I'd appreciate any help in getting rid of this dll-file. very much! Good to hear this. Andfor all the comments so far!! Regards, AMSS |
|||
19th January 2008, 19:21 | #8 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
AMSS0815,
avisynth_c from Kevin has known typo bug with ACSC_USE_STDCALL instead of AVSC_USE_STDCALL. Fixed version is distributed with Avisynth 2.5.7 setup: avisynth_c.h is with FilterSDK option (and folder) and avisynth.lib is with Extras option (and folder). See also Yadif plugin package.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
26th January 2008, 16:54 | #9 | Link | |
Registered User
Join Date: Aug 2006
Posts: 29
|
Hi Fizick,
Quote:
Code:
AVSInpaint.obj(.text+0x6e1):AVSInpaint.c: undefined reference to `_imp__avs_release_video_frame@4' AVSInpaint.obj(.text+0x1ec7):AVSInpaint.c: undefined reference to `_imp__avs_release_clip@4' ..... I uncompressed it, and running make resulted in similar error messages (but not so much). I wonder if my compiler is improperly configured . By the way: It's gcc 4.2.1 (compiled with some older gcc), and linker is GNU ld 2.15.91 (delivered with MinGW). AMSS |
|
26th January 2008, 22:31 | #10 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
my first attempt to build avsinpaint failled. - i replace only one avisynth_c.lib to avisynth.lib in make file and missed second entry
Error was similar to reported But now avsinpaint (and yadif) build fine. My config: gcc version 4.0.4 from http://forum.doom9.org/showthread.php?t=108215 GNU ld version 2.17.50 20070129 Seems, it is important! get new binutils 2.17.50 I do not use mingw directly, but with minsys or with Codeblock.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
30th January 2008, 07:33 | #11 | Link |
Registered User
Join Date: Feb 2007
Posts: 65
|
I've wrote a function for AVSInpaint. I hope it will help peoples who have difficulties to use this sympathic plugin. Since it's my first function I ask for leniency.
Code:
#____________________________________________________________________________________ # _____ _ _ ______ # |_ _| (_) | | | ____| # | | _ __ _ __ __ _ _ _ __ | |_| |__ _ _ _ __ ___ # | | | '_ \| '_ \ / _` | | '_ \| __| __| | | | '_ \ / __| # _| |_| | | | |_) | (_| | | | | | |_| | | |_| | | | | (__ # |_____|_| |_| .__/ \__,_|_|_| |_|\__|_| \__,_|_| |_|\___| # | | # |_| #_____________________________________________________________________________________ # InpaintFunc is a new delogo function using AVSInpaint.dll an AviSynth C plugin developed by AMSS. #See thread : http://forum.doom9.org/showthread.php?t=133682 to download this plugin and get #more information about it. Just an advertise : AVSInpaint plugin is rather slow so be patient ;-) #_______________________________________________________________________________________ # # History : #_______________________________________________________________________________________ # Actual revision : InpaintFunc v1.13 # Author : Reuf Toc # Requirement : AVSInpaint.dll # Changes : #Rev 1.00 : First release 2008/01/30 #Rev 1.01 : Add debug for "mode". Removed two useless operations. #Rev 1.02 : Added "Speed" parameter. #Rev 1.03 : Fixed bug in PAR calculation. Fixed bug with non-RGB32 mask. #Rev 1.10 : Fixed bug due to overlay. Added post-processing + a lot of things. #Rev 1.11 : Added Show parameter and InpaintAssist function. Process in RGB24 instead of RGB32. #Rev 1.12 : Fixed bug in "loc" calculation #Rev 1.13 : Fixed bug for .ebmp creation (did not happen in several cases) Last edited by Reuf Toc; 17th September 2010 at 14:40. Reason: Function updated |
17th February 2008, 06:21 | #14 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,699
|
@ Reuf Toc
I have added your function to the Avisynth wiki. Here: http://avisynth.org/mediawiki/InpaintFunc Feel free to edit and update your function on there when ever you feel like it. (Plus, it makes the function easier to find and maintain.) |
21st February 2008, 08:09 | #15 | Link | |
Registered User
Join Date: Feb 2007
Posts: 65
|
Function updated (here and on the Wiki)
The two majors changes are a correction of a bug caused by overlay and the addition of a basic post-processing feature. Quote:
|
|
23rd February 2008, 15:40 | #16 | Link |
Registered User
Join Date: Aug 2006
Posts: 29
|
Update to 2008.02.23
Hi everybody,
I updated AVSInpaint to version 2008.02.23. Main change is the removal of AviSynth_C.dll. Thanks to Fizick, this file isn't necessary anymore (Plugin is still loaded with LoadCPlugin). Further (minor) changes are listed in the help file. The file is attached to the original post of this thread. Nice work, Reuf Toc. I really have to admitt, I didn't spend to much time on making this thing user friendly. Have fun, AMSS |
3rd February 2010, 11:37 | #17 | Link |
Useless idea generator
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
|
I have a question to InPaincFunc about manual setting of crop area to localize logo ( loc "x1,y1,-x2,-y2" ).
Should I set it to logo quite tightly (with some border) to speed up the things ? Or, is it a trade off between speed if tight and quality if large enough to have more out-of-logo info ?r Or it does not matter and "TL" is enough ?
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 / focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC] |
5th February 2010, 13:39 | #18 | Link |
Registered User
Join Date: Feb 2007
Posts: 65
|
I don't know exactly how AVSInpaint works internally but from what I understood, the number of pixels computed to restore the damaged area is defined by "radius" parameter.
So the minimum border around the logo should be at least equal to the radius. If this condition is fulfilled, setting an larger area does not increase quality but only time computation. So I recommend to use your own loc parameter, especially if your source is HD |
1st July 2010, 18:23 | #19 | Link |
Registered User
Join Date: Jun 2009
Location: UK
Posts: 263
|
Hi! I'm trying to use AVSinpaint via the InPaintFunc script, as follows:
<code> LoadCPlugin ("C:\Program Files\AviSynth 2.5\C_plugins\AVSInPaint.dll") AVISource("GP1.TESTCLIP.avi") Trim(0,10) InpaintFunc(mask="G:\GP\Logo_1280x720.bmp", loc="48,48,152,52", speed=20, mode="both", show=false) </code> AVSInPaint keeps failing with the error "mask is full". Can anyone explain what that message means? I've searched the docs provided, and the forums, and tried Googling for ' AVSInPaint "mask is full" ' - No luck. (Except for a thread on a Chinese forum, where, if I'm correctly interpreting the machine translation, they don't know what it means either!) N.B. I'm using the older version of AVSInPaint because I couldn't persuade the newer one to load. (Tried every combination I could think of, using loadplugin/loadCplugin, putting the .dll file in plugins/c_plugins folder, etc. - again, no joy.) If this is a known prob that's fixed in a newer version, could someone point me to it and clarify how it has to be loaded? Thanks. |
1st July 2010, 19:20 | #20 | Link | ||
Registered User
Join Date: Feb 2007
Posts: 65
|
Quote:
If you post a screenshot of your source and your mask, I can take a look. Quote:
|
||
Thread Tools | Search this Thread |
Display Modes | |
|
|