Quantcast Avisynth: Fixvhsoversharp (Beta) - Page 2 - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Avisynth Scripting

Reply
 
LinkBack Thread Tools
  #21  
07-17-2003, 07:10 PM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
My camcorder does passthru conversion so it can be done either way. The sample I mentioned is pure DV camcorder.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #22  
07-18-2003, 10:18 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Hm... I hate to say this but not all DV camcorders have this problem.

I guess this does suggest that the FixVHS filter may find more use in the future. It seems that not many people are doing VHS-VCD conversons but more and more will be doing home movie conversions.

I'll get back on the FixVHS filter in the next few days. (Right now I'm woking on a motion adaptive temporal smoother. Sort of a PixieDust on steriods.)
Reply With Quote
  #23  
07-18-2003, 01:05 PM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Yes, I was surprised when I saw the halo in the DV sample. I don't remember exactly which camcorder was used to make it. I think it was bottom-end JVC but, even so, the exact model # would be necessary as things change between model years. I've never had this problem with my Canons.

Please let me know about your new filter. I've stopped with the KVCD optimal script because it appears to smooth some things inappropriately. If you look at the camcorder test shot on my discussion page you'll see what looks like an incense burner. The use of TemporalSoften is destroying that smoke. I've seen similar situations where motion is primarily in the luma channel and smoothers wipe it out because the chroma is stable. Unfortunately, I no longer have a good raw sample of that.

I've often thought temporal softening is great but only if it's got a motion-sensing or block-oriented aspect. Donald Graft's dup filter is a good example. It works great unless the image is somebody talking and their lips don't move much. Another example is a camcorder on a tripod with a stable backdrop. If you've got motion in the foreground but the background doesn't change, it would sure be nice to average the static background for noise reduction. The trick would be to ensure the edges of the parts in motion don't look too different and you create the appearance of cheap bluescreen. (Oh, there's an idea, you might find something helpful here: http://forum.doom9.org/showthread.php?s=&threadid=56277)

I've also stopped development because it appears there might be some problems with DV codecs. I'm losing information when converting to YUY2. Without a safe way to do this, it really doesn't matter what else is done to DV. I'm designing a test scenario. Description is here: http://forum.doom9.org/showthread.php?s=&threadid=57112 Please let me know if you have any suggestions for this test.
Reply With Quote
  #24  
07-18-2003, 05:41 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Kwag's script is limited because because the YDifferenceToNext() filter operates on the whole frame. So, if a car passes by [in a clip], the whole frame gets smoothed. The issue here is that there is no filter to identify fast moving parts of a frame. Of course this is exactly what is needed for a motion adaptive temporal smoother. (i.e I am writing a spec on just this kind of thing.)

On the other hand, there may be a simple way to modify my MADMask filter to mask on large fast moving areas only.... I'll give it some thought.

I'll let you know what I come up with.
Reply With Quote
  #25  
07-18-2003, 07:02 PM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you, I'd be very interested in testing such a filter.

I'm almost to the point of capturing twice and combining for noise reduction. It requires more space but might be worth the effort.
Reply With Quote
  #26  
07-21-2003, 03:57 AM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
If at all possible, please consider adding filtering of the saturated red and blue bleed which is common to 4:1:1 NTSC. There's a sample on my discussion page (http://www.geocities.com/fredthompson6) showing FlyVideo capture vs. Canopus ADVC. Been kicking this around with a few folks but no really good solution.

http://forum.doom9.org/showthread.php?s=&threadid=57013
http://neuron2.net/ipw-web/bulletin/...topic.php?t=10

I still think a dark smoother which sets a threshold before chroma is allowed on the pixel is a good idea. Would be best if there is weighting based on the luma of surrounding pixels, sort like how Smart Smoother works.

Also, don't use AviSynth 2.5.2 because there is a problem with colorspace conversion. It had me all messed up trying to locate what was destroying fine detail.
Reply With Quote
  #27  
07-21-2003, 05:41 PM
morsa morsa is offline
Free Member
 
Join Date: Mar 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
From my experience, I´ve seen that the oversharped feature on DV source has nothing to do with the format or the camcorder.It is related with the amount of detail/enhancement/sharpness you set in the camcorder menu.
Another topic is that thes artifacts are always pure black or pure white, so I guess that restricting the border detection to that values should improve results.Also I believe is better to work on the whole image rather than line by line.
By the way, if someone wants to test wavelet noise reducer for Vdub it detects very well those artifacts given the correct settings.
Reply With Quote
  #28  
07-21-2003, 06:48 PM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
I'm not sure I understand what artifacts you mean. Can you describe?

I certainly do agree with your comment about sharpening features in the camcorder.

The 4:1:1 and 4:2:0 problems with colorspace are horizontal artifacts only because that is how the color is encoded. wrt my idea of testing the surrounding pixels to see if they are near-black, yes, that should be done in a 2D manner. If, for example, 6 out of 8 surrounding pixels are near-black, it's probably a safe assumption that the near-black with high red being tested should not have the red. Once this kind of filtering is done, however, you cannot go back to 4:1:1 without the problem reappearing.

The challenge with processing an entire frame of interlaced source is you don't really have a stream of 25/30 individual pictures. You have 2 distinct streams of 25/30 pictures each.

Spatial filtering on interlaced material, unless the filter is specifically set for it, will mess up your source. It's far safer to divide into 2 half-height streams, filter, then weave. That's assuming your source is true video.
Reply With Quote
  #29  
07-21-2003, 07:06 PM
morsa morsa is offline
Free Member
 
Join Date: Mar 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
I´m always talking about FixOversharp filter.
With artifacts I mean those ugly full black or full white borders added to an image to simulate sharpness.
In this case the idea is to replace them by interpolation, but the dificult task is how to detect them.
In a normal video sequence usually the only pure black parts are these added borders.Even if this wasn´t the case, replacing some other pure black parts won´t be noticeable.
Reply With Quote
  #30  
07-21-2003, 07:44 PM
FredThompson FredThompson is offline
Free Member
 
Join Date: Jun 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
ah, I understand.
Reply With Quote
  #31  
07-22-2003, 11:38 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
This is an interesting thread. Morsa has confirmed what I suspected, that the oversharp effect is the result of some sharpening circuit.

From what I have seen, on VHS tapes, the oversharp effect can be found all over frame. Often I cannot see it by looking at the frame but when I graph the luma, the effect is easily identified. (If I could post a picture, I would show you the graph.)

As for Morsa's proposed solution, all I can say is I whish it was that easy. The FixVHSOversharp filter actually applies a smooth to the effected areas by looking just past the oversharpen edge. This of course can introduce errors as discussed higher in this thread. Another approach is to undo the oversharp error by proportionally adjusting the Luma value at the edge. This approach would be better but it assumes that you can determine the correct value for that pixel without looking on either side of it. My Lumagraph filter has shown that the oversharp effect varies quite a bit on each kind of edge. At times, the overhsharp effect can even trail the edge by a couple of pixels. (i.e. the ends of the edge are fine but suddenly a pixel or two later, the oversharp spike appears.)

In my re-write, I am attempting to use the slope of the areas leading to and following the edges to correct the oversharp spikes. The idea here is to rebuild the edge without copying values from around the edge boundaries. If it works, this new method would avoid the errors to text that the present filter creates.

I am NOT a C++ programmer so my source code is awful but if anyone wants the souce to FixVHS, send me your email address. Perhaps you could find a better method to deal with this issue.
Reply With Quote
  #32  
07-22-2003, 06:45 PM
morsa morsa is offline
Free Member
 
Join Date: Mar 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Well, the oversharp everyone is acustomed with VHS is, usually, the result of applying unsharp mask in any of its flavors on the video to make it look sharp on VHS.
That's because of VHS poor resolution.Everytime I make a VHS copy from another source I need to perform this task, otherway the final VHS looks terribly blurry.
As for camcorders (all of them analog or digital, home or professional), I've been testing many of them (always digital ones) and what the circuit does is that it applyes a simple sharpen matrix or sometimes a much advanced unsharp mask always based on contrast.This has something to do with a known CCD limitation.CCD's are always a little blurry, it is on their nature.So if you eliminate the sharpen feature you'll end up with a little blurry image.Another issue is that standard video cameras doesn't use a mechanical shutter, which leads to some kind of blend between one image and the following.That's why new expensive professional cameras (as the ones used for sports events) have a mechanical one.Have you ever wonder why digital photo cameras have mechanical shutters too, even the cheapest of them?
There must be different approaches to correct VHS and to correct any other digital format.The tapes coming from a camcorder don't have this oversharp problem all over the image.They just have it on high contrast areas and it is always a black or white line beside an actual edge.
Reply With Quote
  #33  
07-23-2003, 03:07 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Here is a link to a quick page I set up for my filters:

http://www.geocities.com/mrtibsvideo/


Here is a link to a before/after page showing the oversharp problem with LumaGraph marked. Here you should be able to see how much oversharpening is actually on each frame.

http://www.geocities.com/mrtibsvideo...ore_after.html
Reply With Quote
  #34  
07-23-2003, 04:42 PM
morsa morsa is offline
Free Member
 
Join Date: Mar 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Impressive results!!!!!!
But what I´ve seen with DV cameras (e.g. Sony PD150) doesn´t look like that.
The borders aren´t halos, they are black or white added borders.
I´ll try to send you an example.
Reply With Quote
  #35  
07-23-2003, 05:24 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
@FredThompson and @morsa

Well, the only thing to do now is get a sample of the DV files. I've provided both of you an email account that can accept large files. If you could send me a sample video, I'll see if I can modify the filter to work better on a DV source. (i.e. FixDVOversharp)
Reply With Quote
  #36  
07-24-2003, 11:01 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
@morsa

I got the video clip you sent and I see what you are talking about.

When I plotted the frame with LumaGraph, the oversharpened edge looked the same as it does in the VHS source. However, there are a couple of differences between the two sources which is effecting the FixVHS filter:

1. The frame is more than 352 wide. This means that the "halos" that follow the edges are too wide for FixVHS to fix. - You would have to resize the video to 352 in order to it to work. (There is no reason to capture VHS over 352 pixels wide so I allowed this limit to exist in the filter.)

2. In your sample, the overhsharpening effect also seen above and below edges. On VHS sources, the oversharpening effect is only on the horizontal. FixVHS would never be able to fix this.

When I wrote the filter, I gave it the VHS name because I realized that there was a specific pattern and limits to the VHS oversharp problem. With DV, however, things are quite different. I'll take a look the filter and see if I can modify it to work with your source. (I don't know how I'll deal with item 2 though. - I'm not much of a C++ programmer.)
Reply With Quote
  #37  
07-25-2003, 10:42 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
I've been working on the filter but I tried this to see if I could improve results with the exisiting filter. Although this "workaround" may seem silly, the results it produced amazed me: Near PERFECT edges!

Quote:
#my source was 352x480 so I resized
bicubicresize(704,480)

FixVHSOversharp(30,28,24)
FixVHSOversharp(30,28,20)
FixVHSOversharp(30,24,16)
FixVHSOversharp(30,24,12)
FixVHSOversharp(30,24,8 )
This method also greatly reduces the errors to text. Give it a try!
Reply With Quote
  #38  
07-31-2003, 05:03 PM
morsa morsa is offline
Free Member
 
Join Date: Mar 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Well, I've been testing it with really good results.Although it leaves some black spots on some corrected black borders(Anyone remember that I said the dark halos in DV are almost black?)
About the horizontal sharpenning: What would happen if the filter internally turns the image 90 degrees and makes a second pass?
Reply With Quote
  #39  
07-31-2003, 05:08 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by morsa
What would happen if the filter internally turns the image 90 degrees and makes a second pass?
You mean 180 degrees to invert the phase, and cancel the signal, right

-kwag
Reply With Quote
  #40  
07-31-2003, 08:03 PM
morsa morsa is offline
Free Member
 
Join Date: Mar 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Not exactly.I just thought that , if the filter works a line at a time and it only can remove the vertical edges, turning the image would give me the horizontal ones as if they were vertical.So...
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: DGMPEGDec 1.0.13 beta 5 released incredible Avisynth Scripting 0 01-13-2005 09:00 AM
D.I.K.O. 0.76 Beta 3 e Gold 1.46 Beta 3 - Reportem os Bugs! vmesquita Conversão e Codificação de Vídeo (Português) 3 10-14-2004 06:10 PM
D.I.K.O. 0.76 Beta 2 e Gold 1.46 Beta 2 - Reportem os Bugs! vmesquita Conversão e Codificação de Vídeo (Português) 23 09-20-2004 02:54 PM
AviSynth 2.5.0 beta jorel Avisynth Scripting 1 01-28-2003 10:50 PM
Avisynth: Auto crop using avisynth filter beta? black prince Avisynth Scripting 6 11-28-2002 08:51 AM




 
All times are GMT -5. The time now is 08:01 AM  —  vBulletin © Jelsoft Enterprises Ltd