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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#82 | Link |
|
Registered User
Join Date: Oct 2011
Location: Germany
Posts: 39
|
I found that the input for Corr2D CCF should have a least an area of 100 px height and 200 px width (better 400 px). Then we could cut the line with the right half of the CCF from the resulting output area. With smaller resolutions the output pixels of ccf are scaled down which results in avaraging with their black neighbor pixels.
It is better to use the right side because the left side is terminated at (width/4) px. When using the output of CCF it better has to be
When the input is scaled up enough we do not need convert exactly the number of pixels of the output function to get an offset value, because 11 and 14 px give the same result (3) when 5 pixels in CCF correspond to 1 px input (before it was inflated). |
|
|
|
|
|
#83 | Link | |
|
Registered User
Join Date: Feb 2002
Location: Borås, Sweden
Posts: 492
|
Quote:
Should be: http://forum.doom9.org/showthread.php?t=162832
__________________
Ronny |
|
|
|
|
|
|
#85 | Link |
|
Registered User
Join Date: Jan 2006
Posts: 1,869
|
First test of my "perfect TBC" test signal, I have a number which is proportional to the shift in high accuracy. This was a test of an actual VHS. It's just the detection value, no dejitter yet. I also have to scale the number into actual pixels first. At least it looks like it's going to work. Oh, and that 'head switching noise' that everyone crops? No need to, I can recover quite a bit of it.
|
|
|
|
|
|
#86 | Link |
|
Registered User
Join Date: Jan 2006
Posts: 1,869
|
Results of my jitter analysis. Good and bad. My test shows jitter is +-.25 in left border and +-.5 in right border. This is with a modern card which probably has an Ultralock type feature. I hardly need TBC for this tape.
The samples of jitter I've provided before were from an older capture card, and a worn VHS which possibly had macrovision, that could explain why it's so much worse. I need to prepare more tests with a VHS in LP mode, with a stretched tape, or with a copy of a copy to get some real jitter. |
|
|
|
|
|
#87 | Link |
|
Registered User
Join Date: Sep 2011
Posts: 37
|
Hi! I finally tried to take a look at this. Have a hardware TBCd capture that, even that, has a couple of seconds with jitter that it seem it wasn't able to recover (or maybe it came from a previous generetion or whatever). I've haven't been able to make virtualdub vhsrest2.vdf plugin work (it makes it crash, nor through avisynth's LoadVirtualDubPlugin), and with DeJitter.dll I get far more jitter than in the original file.
The problem is I am not able to run this script. I've been upgraded to Avisynth 2.6 alpha, downloaded and included the required plugins with the following lines: LoadPlugin("mt_masktools-26.dll") LoadPlugin("GRunT.dll") LoadPlugin("minmax.dll") and loaded the video file, but I always get an "I don't know what 'thresh' means ([ScriptClip], line 4)" error. I'm suspecting something is not getting loaded. Any hints?? |
|
|
|
|
|
#88 | Link | |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Quote:
Check your script is the same as in the first post. Before the call to ScriptClip, there should be this line: thresh=int(findthresh(src))+3 |
|
|
|
|
|
|
#90 | Link |
|
Registered User
Join Date: Oct 2011
Location: Germany
Posts: 39
|
Cross correlation between a real video border and an edge model
This is part 3 of posting 69 and 82.
Basing on Border Detection 0.3 by jmac698 (same thread, here) I have modified the script that calculates cross correlation between the border of a real video and an edge model, whose parameters can be adjusted (edge blur, white level and number of black pixels of the edge). You are welcome to do your own tests. PHP Code:
Here are a few first results. ![]() ![]() ![]() It can be seen that the width of the cross correlation reacts on the luma of the input video. Bright image parts produce a longer CCF output. The effect is smaller when input contrast is lowered (which is done in this version by clamping all luma values above a certain threshold). By looking at these pictures I am not so convinced anymore that cross correlation can provide a good border detection. Last edited by sven_x; 31st October 2011 at 12:06. |
|
|
|
|
|
#91 | Link |
|
Registered User
Join Date: Jan 2006
Posts: 1,869
|
sven,
Great work and analysis. I have a simple suggestion, just change the 'white' color of the edge model into the averageluma of the video, this would eliminate the 'border bias' you are getting. If I analyzed the actual correlation calculations, I'm sure I could understand why it's doing this anyhow. Does your script work on two model edges correctly? What about using a pure threshold, but then using salt&pepper removal to clear the noise? It seems your borders are quite good, there just has to be some way to detect them. Did you try the edge masks built into masktools? |
|
|
|
|
|
#92 | Link | |
|
Registered User
Join Date: Sep 2011
Posts: 37
|
Quote:
By the way, I just wanted to test how the alignment was working with one of my already-captured-without-sync captures... |
|
|
|
|
|
|
#93 | Link |
|
Registered User
Join Date: Jan 2006
Posts: 1,869
|
Oh, make sure you have gscript installed.
http://forum.doom9.org/showthread.php?t=147846 Can also set thresh manually, thresh=20 (for example) inside the scriptclip. Gscript is sort of dangerous to have around for development, it silently affects variable scope I believe making me not realize I need it in a script. I mean something will just work for me when a plain avisynth would give an error. |
|
|
|
|
|
#94 | Link | ||
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Quote:
Quote:
The fact that "something will just work" is what it is intended to achieve, so is for the most part an advantage(!), but I understand what you mean in that it is harder to realise you need it for a given script. This is because once installed it extends the standard run-time environment and will still be used if you call 'ScriptClip' instead of 'GScriptClip' - it has to be this way as all run-time filters must work the same way for it to function properly. Perepandel, are you saying your script is like this: Code:
src=AVISource("...")
thresh=int(findthresh(src))+3
ScriptClip(src, """
#Mark video edges
converttoyv12
m=mt_binarize(thresh)
#Line up video
findpos_h(m, searchwidth=22)
alignbyluma(src,last)
""")
...
That should work whether or not you are using GRunT. The only exception would be if you have put this code inside a function (or if you have also configured GRunT to run each run-time script in a separate scope, by calling GRTConfig(local=true)), in which case you would have to add args="src, thresh" to the ScriptClip call (or simply make src and thresh global). Last edited by Gavino; 1st November 2011 at 15:06. Reason: typos and clarification |
||
|
|
|
|
|
#95 | Link | |
|
Registered User
Join Date: Sep 2011
Posts: 37
|
Quote:
|
|
|
|
|
|
|
#97 | Link |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Certainly, GScript is required, but without it you should get the error 'there is no function named "GScript"', not a message about 'thresh'. Or is this actually what you did get?
(I need to understand the details just in case there is something strange happening with GRunT.) |
|
|
|
|
|
#98 | Link |
|
Registered User
Join Date: Jan 2006
Posts: 1,869
|
Example of my ideal TBC performance
http://screenshotcomparison.com/comparison/91487 You'll see some aliasing, that's due to a simple resizer to fix the jitter. On VHS you'd never notice. What this is, a test signal is added to the video, this allows my software to line-up the video and remove the jitter. This is only useful for new VHS recordings. It's use really is just to measure the actual jitter added, not to perfect obsolete VHS ![]() I'm still working on measuring jitter from 2nd generation tapes, etc. |
|
|
|
![]() |
| Tags |
| tbc |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|