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. |
20th August 2011, 11:49 | #1 | Link |
Banned
Join Date: Jun 2008
Posts: 94
|
Chromatic aberration - Using Tweak() on edges only?
Hi,
While removing blue and yellow chromatic aberration with Tweak(), I noticed that it also kills color where it shouldn't - on people's clothes etc. Because chromatic aberration is mostly on edges and not texture, will it be helpful to target Tweak() only on edges? Or perhaps there's a different solution to the problem? |
20th August 2011, 21:54 | #5 | Link | |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
You could always use the plugin made just for this:
Quote:
It's for virtualdub, but you can use virtualdub filters in avisynth: http://avisynth.org/mediawiki/FAQ_us...ualdub_plugins and remember, for any question you can search for "chromatic aberration plugin for virtualdub or avisynth" |
|
20th August 2011, 21:59 | #7 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
ps If you wanted to write your own script, I believe there is an effects plugin that can do radial zoom.
Try EffectLens http://avisynth.org/vcmohan/EffectsM...any_index.html |
20th August 2011, 22:21 | #8 | Link |
Banned
Join Date: Jun 2008
Posts: 94
|
Thanks jmac698, but the link for VirtualDub's plugin is dead? I've searched for it but couldn't find it.
I did find FixChromaticAberration filter for Avisynth, but it throws an error - Invalid arguments to function "IsRGB" (FixChromaticAberration.avsi, line 30) |
20th August 2011, 22:51 | #9 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
Code:
c= (IsRGB(clip)) ? clip : ConvertToRGB(clip) change to: c=ConvertToRGB(clip) Try contacting the author http://www.dvinfo.net/forum/general-...-software.html This is a real example of digital decay, it's a significant problem for plugins. The plugin might also be in the filter pack at digitalfaq http://www.digitalfaq.com/forum/vide...lters-pre.html I can't find a list of the filters. |
21st August 2011, 00:44 | #10 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
Code:
function FixChromaticAberration(clip "clip", val "red", val "green", val "blue", val "x", val "y") These wrongly make the clip optional, preventing you from using implicit 'last' as the parameter. As written, the function will work if you pass the input clip explicitly. jmac698's fix does not work. |
|
21st August 2011, 14:31 | #11 | Link |
Banned
Join Date: Jun 2008
Posts: 94
|
Thanks Gavino, it worked!
Unfortunately this filter doesn't seem to remove this particular CA... Although I couldn't find VirtualDub's CA plugin, it seems (according to its description) to be along the lines of Avisynth's FixChromaAberration filter... which means it too won't help much in removing this CA. Will it be possible to have a look at why I'm getting this strange result with Nephilis' code? |
23rd August 2011, 22:33 | #12 | Link |
Registered User
Join Date: Sep 2009
Posts: 378
|
What about a simple spill suppression on the blue channel?
http://www.yellowspace.webspace.virg...illsupblue.jpg |
25th August 2011, 12:24 | #13 | Link |
Banned
Join Date: Jun 2008
Posts: 94
|
Looks good!! can this be done in Avisynth? I am not aware of any Spill Suppression filter...
Different question: Is it posible to limit Tweak from affecting areas that are larger then certain size? i.e, if there's a patch of color that was about to be changed by Tweak, and it's larger than a certain size (say a 2x8 block) - Then it will not be changed by Tweak! Is that possible ?? |
25th August 2011, 13:38 | #14 | Link |
Registered User
Join Date: Sep 2009
Posts: 378
|
I used the nodal open source compositor in Blender, which has various chroma keying tools, but that was just a quick hack to see if spill suppression idea could be successful with your image, I couldn't really see where your CA was apart from white edges of flowers.
|
30th August 2011, 13:49 | #17 | Link | |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
Quote:
Code:
# This AviSynth function stretches the red, green and/or blue channel according to # a given factor symmetrically around the center of the frame and crops it afterwards. # # Parameters: clip, red, green, blue. # red, green and blue are stretching (resizing) factors against the original clip size. # # The function returns the clip in RGB24 colorspace. ## (Emulgator: this is true now since my fix from 07.August 2010, before it defaulted to RGB32.) # # Factors of e.g. red=1.015, green=1.01 allow to compensate the colored edges near the # corners of the image which appear from lenses with 'chromatic aberration'. # # If a factor is below 1.0, a that color will be fitted with black corners into the frame. # # x and y allow to set the center of the aberration circle. # It defaults to the center of the image. # ## Emulgator: The latter is not true, since width and height have not been handed over as function parameters. #(Late edit: I was wrong. Default is center of image) ## I prefer to give x and y as width/2 and height/2 anyway before calling this function. #(Late Edit: This allows for offset center) ## If the impression exists that this function would stretch radially this holds not true either. ## Only linear stretching along x and y axis is performed. # # Note that chromatic aberration also smears the image a bit, which is not compensated # by this function. # # Martin Wagener at gmx.de, 04/09/2007 # fixed by Emulgator 07.August 2010
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." Last edited by Emulgator; 30th August 2011 at 15:27. |
|
30th August 2011, 14:38 | #18 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
Code:
c= (IsRGB(clip)) ? clip : ConvertToRGB(clip) w= c.Width() w2= round(w*0.5) h= c.Height() h2= round(h*0.5) xi= default(x,w*0.5) xi= (xi<0)?0:xi xi= (xi>=w)?w-1:xi yi= default(y,h*0.5) |
|
30th August 2011, 15:14 | #19 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
As I tried it the first time it did not work as expected. Lets see...
P.S. Yes, it works as promised and defaults to image center. I guess I wanted to have the center offset back then and started to edit the script. Will have to edit my findings regarding centering. What about the radial stretching ?
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." Last edited by Emulgator; 30th August 2011 at 15:24. |
30th August 2011, 17:47 | #20 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
I believe it does stretch radially, since for each color (R, G, B), the horizontal and vertical scaling factors are equal.
However, there is a slight inaccuracy in the centre point, since it doesn't take into account that Avisynth resizers maintain the image centre point rather than maintaining the top left position. It would also be better to combine the resize and crop in a single operation using floating point offsets. I don't have time to figure out the exact solution just now - I might get back to it later if no one else comes up with it. |
Thread Tools | Search this Thread |
Display Modes | |
|
|