I have 3 bluish vertical lines that exist in certain scenes. No idea why.
How do I remove it. Currently the bluish is the only colour, the rest of the scenes are blackish, brownish, greyish, therefore i was thinking of a way to remove blue and somewhat blend in the lines with nearest pixel from both sides.
I have a vid sample, 2 seconds.
cheers
+ Reply to Thread
Results 1 to 24 of 24
-
-
I think it will be tough to remove these without creating a blur artifact that will be more obnoxious than the blue line. However, if you want to try, since the lines appear to be perfectly static, you could try the Delogo filter. Here is a tutorial I created, showing how to use it to remove a small sensor dust spot:
https://www.youtube.com/watch?v=Z12TutFSg8c -
The latest is i have been making headway but 3/4 pixels width of white lines remains.
What i am looking for, dunno if it can work, it a simple replace bad pixel type plugin. The way i see it would work like this.
Instruct start hor pixel(say 300) and end hor pixel (305) and full vert length - like masking and only work in this area and nowhere else.
Pixel 300 to 305 are considered bad.
Lets focus on 5 main colours. BWRGb. | = start and end mask boundary.
Small example
Good bad good
pixels pixels pixels
BBBB|WbbbWW|BBBB
BBBB|WWbbbW|BBBB
GGGG|WWbbbW|RRRR
GGGG|WbbbWW|RRRR
would become by using previous good hor pixel(299) and hor pixel(306) on both side alternately to overwrite the bad pixels
BBBB|BBBBBB|BBBB
BBBB|BBBBBB|BBBB
GGGG|GGGRRR|RRRR
GGGG|GGGRRR|RRRR
The above looks simple enough to me. No blurring, no band lines, no random guessing based on fancy algorithms, etc.
How hard can it be? -
Dekafka() in AviSynth does something like what you're asking for:
Code:LWLibavVideoSource("SH_2_secs.avi") ConvertToYV24() # must be YV24 or RGB to crop on odd pixel boundaries dekafka(last, 363, 2, 4, height-4, 256) # X, Y, W, H, strength (0=none, 256=full) dekafka(last, 578, 2, 4, height-4, 256) dekafka(last, 792, 2, 4, height-4, 256)
-
jagabo
How do i get it to work. There's no plugin.
All i get is "there no function named dekafka"
What does last mean?
363 means start?
4 means number of pixel to replace?
where does dekafka get the pixel from to infill? -
Copy/paste from http://avisynth.nl/index.php/DeKafka
The video you want to process.
The x position of top right of the area you want to process.
The width of the area you want to process.
The area immediately outside the area you specify. -
How do i specify the pixel outside the area?
OK this is what i did.
Open vdub2
tools -> script editor
paste
Code:function dekafka(clip clip, int Xstart, int Ystart, int X, int Y, int Amount) { ytop = Ystart ybot = Ystart + Y xleft = Xstart xright = Xstart + X topline = clip.Crop(Xstart, ytop-2, X, 2) bottomline = clip.Crop(Xstart, ybot, X, 2) leftline = clip.Crop(xleft-2, ytop, 2, Y) rightline = clip.Crop(xright, ytop, 2, Y) logosrc_hor = StackVertical(topline, bottomline).Blur(0, 1.58).BilinearResize(X, Y) logosrc_ver = StackHorizontal(leftline, rightline).Blur(1.58, 0).BilinearResize(X, Y) Amount2 = (Y>=2*X) ? 255 : 128*Y/X # Amount2 is small if X >> Y => logoscr_hor is dominant logosrc = Layer(logosrc_hor, logosrc_ver, "add", Amount2) clip = clip.Layer(logosrc, "add", Amount, Xstart, Ystart) return clip } FFVideoSource("E:\currser\BABYLON5\new\SH_2_secs.avi") ConvertToYV24() # must be YV24 or RGB to crop on odd pixel boundaries dekafka(last, 361, 2, 6, height-4, 256) # X, Y, W, H, strength (0=none, 256=full) dekafka(last, 576, 2, 6, height-4, 256) dekafka(last, 794, 2, 6, height-4, 256)
run analysis pass
nothing happen.Last edited by coolgit; 27th Jul 2021 at 08:54.
-
You changed the starting Y position from 2 to 4. So you need to reduce the height of the block. Change height-4 to height-6.
-
I had realised that and turned it back to 2.
Still nothing happened.
In logical order what exactly does this do? -
What do you mean by "nothing happen"? Why are you using run analysis pass? That just runs through the entire script as fast as possible (only useful for 2-pass filters and benchmarking). If you just scrub through the video in VirtualDub you should see the vertical lines are cleaned up. You may need to fine tune the parameters until you're happy with the result. Then save the result.
-
Previously when i mod, the original viewer (left vdub) stays the same and the processed viewer changes and therefore i can see the differences. For some reason your code changes both viewers and therefore both looked the same, despite the fact it worked, but gave me the impression that nothing was working.
However this doesn't remotely take outside pixel to replace 'bad' pixel. It just blur the 'bad' pixels thus making it worse. my post no. 4 did say no blurring.
A simple question. Does avisynth have the code ability to copy a specific pixel and paste it in a specific place to replace another pixel? No blurring, no band lines, no random guessing based on fancy algorithms, etc. -
Jagabo.
The file in the above examples was the source file. However i used photoshop to remove the bluish colour with some other fixes and was left with thin white lines, 2/3 pixel width. Last week i tried descratch on it and while it did find the thin white lines it also went rampant in other areas of the frames, when debug mode was on. So i scrapped that idea.
I was thinking is it possible to use descratch in your example by replace Blur(0, 1.58) etc. Surely this would prevent descratch from touching the rest of the frames. -
I guess you figured this out but... The output pane in VirtualDub reflects the changes made by VirtualDub's filtering system. When you use AviSynth all the changes happen before VirtualDub gets the video. So the input and output panes in VirtualDub are identical. You can use VirtualDub's filtering in addition to AviSynth.
Copying the edge pixels inward usually looks worse than the bilinear fill that dekafka is performing. I made a filter called InCopy444() that does a simple copy like you asked for:
Code:function InCopy444(clip v, int X, int Y, int W, int H, float alpha) { hzfill = StackHorizontal(v.Crop(X-1, Y, 1, H), v.Crop(X+W, Y, 1, H)).PointResize(W, H) vtfill = StackVertical(v.Crop(X, Y-1, W, 1), v.Crop(X, Y+H, W, 1)).PointResize(W, H) H > W ? Overlay(v, hzfill, X, Y, opacity=alpha) : Overlay(v, vtfill, X, Y, opacity=alpha) } FFVideoSource("SH_2_secs.avi") ConvertToYV24() # must be YV24 or RGB to crop on odd pixel boundaries InCopy444(last, 362, 2, 6, height-4, 1.0) # X, Y, W, H, strength (0=none, 1.0=full) InCopy444(last, 577, 2, 6, height-4, 1.0) InCopy444(last, 791, 2, 6, height-4, 1.0)
-
*In general you want to use the original DVD source and resolution for most types of filters, not an AR corrected "square pixel" resize - because you are scale the defect(s) larger thus making your job more difficult...
You can create a PS batch action to clone/heal/fill/inpaint - but all those variations on PS batch methods generally leave some slight flicker between frames because they are single image spatial repairs, not temporal video repairs. Often you need to follow up with some temporal smoothing over the area with a mask +/- regrain/renoise the area to match if it was blurred
If I understand your description, that should create vertical band artifacts if you alternate lines.
It sounds like you want to taking vertical column in x position 299 and alternating with vertical column in x position 306 to replace the defect area from the same frame ?
ie. Instead of vertical column in x pos = 299,300,301,302,303,304,305,306, where 300-305 are "bad", you get 299,306,299,306,299,306,299,306 . Those will generate displaced stripe artifacts
When you load an avs script, that output of the avs script is the input into vdub, so left preview is the result of the avs script . The right is if you apply vdub filters afterwards
You can compare origina/filtered with an interleave script , where each frame switches back and fort when you advance .
interleave(original,filtered)
Or you can use avspmod to compare scripts in tabs. The number keys hot swap versions and there is a shared timeline. If you advance to frame 30, all versions will snap to 30, so it's easy to compare different versions of scripts
A simple question. Does avisynth have the code ability to copy a specific pixel and paste it in a specific place to replace another pixel? No blurring, no band lines, no random guessing based on fancy algorithms, etc.
A crude way is crop, stackhorizontal and/or stackvertical
Other options -
There are dedicated wire removal tools, or scratch removal in restoration programs, FX programs you might try
And there are other inpainting / logo removal tools similar to what John suggested that you can try. There are neural net/GAN inpainting methods available too -
Interesting. The first thing i did was deinterlaced and then resize to correct anamorphic 1024x576 using staxrip. I do without resize in the next episode.
You can create a PS batch action to clone/heal/fill/inpaint - but all those variations on PS batch methods generally leave some slight flicker between frames because they are single image spatial repairs, not temporal video repairs. Often you need to follow up with some temporal smoothing over the area with a mask +/- regrain/renoise the area to match if it was blurred
If I understand your description, that should create vertical band artifacts if you alternate lines.
It sounds like you want to taking vertical column in x position 299 and alternating with vertical column in x position 306 to replace the defect area from the same frame ?
ie. Instead of vertical column in x pos = 299,300,301,302,303,304,305,306, where 300-305 are "bad", you get 299,306,299,306,299,306,299,306 . Those will generate displaced stripe artifacts
A simple question. Does avisynth have the code ability to copy a specific pixel and paste it in a specific place to replace another pixel? No blurring, no band lines, no random guessing based on fancy algorithms, etc.x,y , or x column ?
A crude way is crop, stackhorizontal and/or stackvertical
Other options -
There are dedicated wire removal tools, or scratch removal in restoration programs, FX programs you might try
And there are other inpainting / logo removal tools similar to what John suggested that you can try. There are neural net/GAN inpainting methods available too
I have tried some of them but when I watched some videos of how it done, the background is either green screen or nice clear same colour areas without any other objects in the way making removal easy. In my clip, not so.
During video editing i will use temporal smoothing to smooth out the faint bands and hope i get an acceptable result. So far its looking good. -
But it does exactly what you asked for. It infills by copying pixels from the left and right toward the center.
No. But you can start with:
http://avisynth.nl/index.php/Main_Page
http://avisynth.nl/index.php/Category:Internal_filters
http://avisynth.nl/index.php/External_filters
Because I just created it to show you that your requested method would not look good. -
It does but the colour isn't right. Target colour became lighter, not replace. Like copy red to replace green and get light green instead of red. Is it necessary to do stackvertical, it looks the reason colours are lighter.
No. But you can start with:
http://avisynth.nl/index.php/Main_Page
http://avisynth.nl/index.php/Category:Internal_filters
http://avisynth.nl/index.php/External_filters
Because I just created it to show you that your requested method would not look good. -
The color is exaclty right. What you don't understand is that there is a lot of noise and discoloration in your source. When you copy an individual pixel to several adjacent columns those discolored pixels become much more visible. And edges become badly aliased. Here's a synthetic image that shows clearly what's happening:
Code:StackHorizontal(BlankClip(width=32, height=64, color=$404040), BlankClip(width=32, height=64, color=$c0c0c0)) StackHorizontaL(last, last) StackHorizontaL(last, last) StackHorizontaL(last, last) StackHorizontaL(last, last) hzbar = last StackVertical(last, hzbar.RGBAdjust(b=0.0)) StackVertical(last, hzbar.RGBAdjust(r=0.0)) StackVertical(last, hzbar.RGBAdjust(g=0.0)) StackVertical(last, hzbar.RGBAdjust(r=0.0, b=0.0)) StackVertical(last, hzbar.RGBAdjust(b=0.0, g=0.0)) StackVertical(last, hzbar.RGBAdjust(r=0.0, g=0.0)) ConvertToYV24() Rotate(23.0) InCopy444(last, 362, 2, 6, height-4, 1.0) # X, Y, W, H, strength (0=none, 256=full) InCopy444(last, 577, 2, 6, height-4, 1.0) InCopy444(last, 791, 2, 6, height-4, 1.0)
[Attachment 60088 - Click to enlarge] -
@jagabo: Nice, catch with Dekafka.
I used:
Code:ClearAutoloadDirs() # disable auto-loading SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE) # enable multi-threading LoadPlugin("I:\Hybrid\32bit\AVISYN~1\LSMASHSource.dll") # http://avisynth.nl/index.php/LSMASHSource LoadPlugin("I:\Hybrid\32bit\AVISYN~1\AGC.dll") # http://avisynth.nl/index.php/HDRAGC # loading source: C:\Users\Selur\Desktop\SH_2_secs.avi # color sampling YV12@8, matrix: bt709, scantyp: progressive, luminance scale: limited clip = LWLibavVideoSource("C:\Users\Selur\Desktop\SH_2_S~1.AVI",cache=false,dr=true,format="YUV420P8", prefer_hw=0) # current resolution: 1024x576 # color modifications to better see the blue line clip = clip.HDRAGC() org = clip # copy current state to 'org' # filtering clip = clip.ConvertToYV24(interlaced=false) clip = clip.dekafka(363, 2, 8, clip.height-4, 256) # X, Y, W, H, strength (0=none, 256=full) clip = clip.dekafka(578, 2, 8, clip.height-4, 256) clip = clip.dekafka(792, 2, 8, clip.height-4, 256) clip = clip.ConvertToYV12(interlaced=false) # add label to clips org = org.Subtitle("original") clip = clip.Subtitle("dekafka") Interleave(org, clip) # Interleave clips PreFetch(16) # set threads to use http://avisynth.nl/index.php/SetFilterMTMode # setting output fps to 25.000fps AssumeFPS(25,1) # output: color sampling YV12@8bit, matrix: bt709, scantyp: progressive, luminance scale: limited return last # custom functions function dekafka(clip clip, int Xstart, int Ystart, int X, int Y, int Amount) { ytop = Ystart ybot = Ystart + Y xleft = Xstart xright = Xstart + X topline = clip.Crop(Xstart, ytop-2, X, 2) bottomline = clip.Crop(Xstart, ybot, X, 2) leftline = clip.Crop(xleft-2, ytop, 2, Y) rightline = clip.Crop(xright, ytop, 2, Y) logosrc_hor = StackVertical(topline, bottomline).Blur(0, 1.58).BilinearResize(X, Y) logosrc_ver = StackHorizontal(leftline, rightline).Blur(1.58, 0).BilinearResize(X, Y) Amount2 = (Y>=2*X) ? 255 : 128*Y/X # Amount2 is small if X >> Y => logoscr_hor is dominant logosrc = Layer(logosrc_hor, logosrc_ver, "add", Amount2) clip = clip.Layer(logosrc, "add", Amount, Xstart, Ystart) return clip }
Dekafka really does a nice job on that clip.
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
-
You may need to adjust the location and width of the infills. These values work better than the earlier script:
Code:InCopy444(last, 362, 2, 6, height-4, 1.0) # X, Y, W, H, strength (0=none, 256=full) InCopy444(last, 578, 2, 6, height-4, 1.0) InCopy444(last, 791, 2, 6, height-4, 1.0)
Last edited by jagabo; 28th Jul 2021 at 17:00.
-
Tried the above on another file with similar problem and worked well.
The original source file we tried on had banding which made difficult. Without the banding it worked better.
However i'd discovered a roundabout way on another clip, camera fixed position, no motion and white to grey background with one ghastly line. Thankfully the line is on its own, no other objects. Found a way to use photoshop action by going into camera raw section, spot removal, mask line, change from heal to clone, to clone another area similar to the defect area, change back to heal - photoshop then removed the line and use heal from another area as guide. Not perfect but the whole scene didn't move thus no flickering, did 300 frames in one go and new heal section looked part of the background. Watching it on tv looks natural.
Similar Threads
-
VHS Purple Vertical Lines
By danchan in forum RestorationReplies: 11Last Post: 10th Nov 2020, 14:49 -
Vertical Film Lines removal
By goodiesguy in forum RestorationReplies: 2Last Post: 21st Oct 2020, 10:44 -
vhs with vertical lines
By spiritgumm in forum Video ConversionReplies: 29Last Post: 22nd Aug 2019, 09:17 -
VHS to DVD Vertical White Lines
By mocarob in forum Video ConversionReplies: 1Last Post: 21st Jun 2018, 22:46 -
VideoGrabber vertical lines
By Anelito in forum Capturing and VCRReplies: 0Last Post: 5th Sep 2017, 02:49