Wanting to remove logos and/or text from some videos. The resulting processed videos should ideally have no artefacts whatsoever left over from where the logos/texts were. So that there is absolutely no indication that there were logos/texts within the videos to begin with.
Enclosed is a test video. The task is to remove the BBC logo from the clip completely. For the videos I have, the logos/texts are in a fixed position on top of moving background similar to this test video clip.
I have tried a couple of (paid) programs to remove the logo from the test clip, but the results were not too good with some blurring and/or smearing appearing where the logo was.
How to completely remove the logo from the test video clip, please?
https://u.pcloud.link/publink/show?code=XZXVvGVZ4ADkXNGUCzXL5Hnn7c1hVQJuz6ak
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 30 of 47
Thread
-
-
In general, you can't perfectly remove an opaque logo because there's no way of knowing exactly what was behind it. But with this particular video I took advantage of the fact that the area just below the logo is pretty much the same as the area covered by the logo. I just copied that area over the logo.
-
Some of the delogo filters are pretty good, but you will never get even close to perfect removal, for the reasons jagabo stated. This is especially true if there is a lot of movement and also if there is a lot of "structure" in the image surrounding the logo. For instance, imagine panning across a half-filled stadium with people wearing different colors, with empty seats between many of them. There is no way to know what should be put into the logo area because there is no way, as jagabo said, to know what comes next.
However, when you have a relatively static background, and there is not a lot of movement, like some stage shots, the removal can indeed be near-perfect. -
Possible only with the transparent logos and good source, sometimes opaque logos can be removed without a trace too but conditions must be right, like a logo must be in non-detailed area or when background is static.
If you want same "paid" effect for free - use DoomDelogo.
If "paid" effect is not good then use InpaintDelogo: -
Many thanks for the constructive comments!
Yes, I thought the removal of the test logo might be difficult due to changing imagery beneath the logo.
I was aware that it may be possible to to sample "clean" areas of the video that are similar to or the same in appearance to the area beneath the logo, so that the sample can be used to fill or cover the logo. Unfortunately, for most of my other videos, this procedure probably will not work owing to almost constant changing/moving imagery beneath the logos/texts, so it would be impossible to sample clean areas to use as fills.
Another possibility is to crop videos so that the logos/texts are removed. Again, unfortunately, this is not an option due to most of my other videos having foreground imagery taking up most of the frame. By cropping these videos, it would mean the loss of (important) imagery. So cropping is not really an option.
I'll have a look at the VirtualDub/AviSynth logo removal scripts when I have the time to reinstall of the associated programs and associated scripts. -
OK. I have installed VirtualDub2 and AviSynth+, as well as all of the required plugins and scripts for running InPaintDeLogo.
Now, I'm still a beginner, so I have very little idea of what script to create to actually run InPaintDeLogo?
Script starting by changing colorspace?
Then load video clip to be processed?
Then load any plugins/scripts?
Then load parameters/settings for the any or all of the plugins?
Anything else that has to be entered into the script?
Can anyone please provide a sample script for running the InPaintDeLogo script/plugin and for running the required plugins/scripts as well (if necessary)?
Thank you. -
I don't use InPaintDelogo but here's a simple infill function that uses only the filters built in to AviSynth+:
Code:########################################################################## # # Infill a rectagular block # # x,y: coordinates of top left corner of block # w,h: width and height of the block # o: the opacity of the overlay (normally 1.0, 100 percent) # ########################################################################## function InFillBlock(clip v, int x, int y, int w, int h, float "opacity") { opacity = default(opacity, 1.0) v24 = ConvertToYV24(v) # allow for odd values # interpolate pixels across the height of the block top = v24.Crop(x, y-1, w, 1) bot = v24.Crop(x, y+h, w, 1) ypatch = StackVertical(top,bot).BilinearResize(w, h) # interpolate pixels across the width of the block left = v24.Crop(x-1, y, 1, h) right = v24.Crop(x+w, y, 1, h) xpatch = StackHorizontal(left, right).BilinearResize(w, h) # overlay the "least" interpolated block Overlay(v, w > h ? ypatch : xpatch, x=x, y=y, opacity=opacity) } ########################################################################## LWLibavVideoSource("Test_Video_2.mp4") InFillBlock(30, 30, 150, 50) # BBC InFillBlock(1416, 34, 464, 44) # Antiques Roadshow (1999)
The first part of the script creates a filter called InFillBlock(). The second part of the script opens the source video and uses InFillBlock() to erase the logos. It's not as "clean" as InPaintDeLogo(). Sample attached.Last edited by jagabo; 28th Sep 2023 at 11:34. Reason: added sample video
-
-
Thanks for the scripts!
I'll look into thïs shortly.
EDIT: How do you determine the (pixel) "coordinates" of masks (or whatever else) to place where the logos and texts to be removed are?Last edited by meeshu; 29th Sep 2023 at 05:26. Reason: How to find coordinates/location of masks(?)
-
I've gotten pretty good at just estimating the location and using a Crop() to see. Then I fine tune to get the exact area I need. But you can use a visual tool like the crop feature in VirtualDub+.
-
Another question.
What is this "mask.bmp" ? Is this something that you have to create first before running the script? If so, how to create this mask this please?
[Attachment 74098 - Click to enlarge] -
-
-
-
Temporal inpainting can be beneficial in situations where the missing data (the area/objects obscured by the logo / or objects you want to remove) is contained in other frames.
If there is no camera movement, and no BG object motion - then it's actually worse - because you never "see" the textures/objects "behind" the logo in nearby frames - then it becomes more like spatial inpainting using single frames, and you cannot benefit from the additional data contained in other frames.
Modern machine learning temporal inpainting algorithms attempt to track objects and correct for depth, perspective, parallax and use optical flow or similar techniques to make an educated "guess" about the object motions using the data from other frames. They compensate and adjust/distort the repair to match the current frame - it's not just copy/paste from other frames and "2D" PSR (position, scaling, rotation) anymore - warped 3D corrections can be involved
Temporal inpainting algorithms are far from perfect, and if you have lots of missing source data (not found in other frames) - they have to completely guess too. But they can be useful for some sources, and complement some workflows (you can improve and refine the results with other tools before using preprocessing and after using postprocessing)
They tend to be difficult to use (no GUI's all python based), and generally require lots of GPU memory for ideal results (more reference frames , iterations, higher precision), but some "AI" removal tools are trickling into consumer ware now - you should see many in the near future
The newest one is probably currently the best overall, and has the most options - ProPainter. The BasicVSR++ author is one of the co-authors.
These use publicly available, generically trained inpainting models. You should be able to improve results if you train your own models on similar source material
https://github.com/sczhou/ProPainter
https://github.com/MCG-NKU/E2FGVI
https://github.com/nbei/Deep-Flow-Guided-Video-Inpainting
https://github.com/hitachinsk/FGT
https://github.com/seoungwugoh/opn-demo
Test_Video_2_ProPainter.mp4 is not processed except for cropping to the region of interest, the BBC logo, and the Antiques Roadshow (1999) logo . Cropping to reduce the memory consumption. There is some noise where there wasn't valid data (camera didn't move enough) , and around the logo mask area in the source from compression artifacts - you could probably clean it up a bit pre and/or post. -
-
-
-
Running test scripts for removing the logo and text from the test video clip.
Problem is that Virtualdub seems to show the only the output video within both the input and output panes. The input video is not being displayed within the input pane (on the left).
Both input and output panes had already been enabled within Virtualdub.
Why isn't the input (unprocessed) video not being shown within the input pane?
Screenshot shows output (processed) video within both panes.
[Attachment 74144 - Click to enlarge] -
Because input is output of AviSynth.
-
OK.
Then is it at all possible to get the input unprocessed video to display within the input pane while the processed output video is displayed within the output pane? -
The output pane is just for further VirtualDub filtering. However, you can use StackHorizontal() (or StackVertical()) within AviSynth to get both the original and processed video in the same frame for comparison purposes.
-
Thank you!
After experimenting with trial and error, I got both input and output clips being displayed simultaneously using this script -
Code:########################################################################## # # Infill a rectagular block # # x,y: coordinates of top left corner of block # w,h: width and height of the block # o: the opacity of the overlay (normally 1.0, 100 percent) # ########################################################################## function InFillBlock(clip v, int x, int y, int w, int h, float "opacity") { opacity = default(opacity, 1.0) v24 = ConvertToYV24(v) # allow for odd values # interpolate pixels across the height of the block top = v24.Crop(x, y-1, w, 1) bot = v24.Crop(x, y+h, w, 1) ypatch = StackVertical(top,bot).BilinearResize(w, h) # interpolate pixels across the width of the block left = v24.Crop(x-1, y, 1, h) right = v24.Crop(x+w, y, 1, h) xpatch = StackHorizontal(left, right).BilinearResize(w, h) # overlay the "least" interpolated block Overlay(v, w > h ? ypatch : xpatch, x=x, y=y, opacity=opacity) } ########################################################################## LWLibavVideoSource("G:Test_Video_2.mp4") A=last InFillBlock(30, 30, 150, 50) # BBC InFillBlock(1416, 34, 464, 44) # Antiques Roadshow (1999) B=last StackHorizontal(A, B)
-
Sometimes it's helpful to see two videos interleaved frame by frame rather than stacked, eg, replace your StackHorizontal(A, B) with Interleave(A, B). With that you can flip back and forth between the same frame of the two videos using the right and left arrow keys in VirtualDub. You will be able to see minute difference between two videos. Especially if you combine it with a screen magnifier.
Similar Threads
-
I need your help in creating this type of text in videos
By shando in forum Newbie / General discussionsReplies: 0Last Post: 19th Apr 2023, 14:16 -
Removing text from a video
By magnu in forum EditingReplies: 2Last Post: 8th Feb 2023, 09:00 -
Removing announcer voice from sports videos?
By rowjekto in forum Newbie / General discussionsReplies: 1Last Post: 1st Mar 2020, 02:54 -
removing border from logo with transparent
By vanhoa in forum EditingReplies: 0Last Post: 12th Oct 2019, 10:26 -
I have a problem removing transparent logo in avisynth using "delogo"
By TeNSoR in forum Newbie / General discussionsReplies: 11Last Post: 8th Jan 2019, 17:30