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. |
11th March 2017, 12:41 | #1 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Automatic white balance with RGBAdapt plugin
Since 2017, the work is always in progress, thus the last script version is post 61
https://forum.doom9.org/showthread.p...31#post1951831 StainlessS, Fred, I open this thread for my automatic white balance script based on the RGBAdapt plugin. The various plugins necessary for its operation are indicated at the head of the script. The script can use the AvsPmod user cursors. It is sufficient to uncomment lines 41 to 63. The script can apply by color channel, A correction of autogain, the force of this correction is adjustable from 0 to 100%, A correction of gamma, the force of this correction is adjustable from 0 to 100%, A bias correction, the force of this correction is adjustable from 0 to 100%, The correction of gamma is a correction in accordance with the theory of the gray world. Indeed with this theory the bias correction is obtained by solving equation 128 = mean value - correction. The gamma correction is thus obtained by solving the equation 128 = pow (mean value /255.0,1/correction gamma) The script can also apply a contrast by channel. The value of this contrast is that of automatic gain after weighting. The application of this contrast is automatic according to a threshold relating to the difference between the greatest max value of the channels and the smallest min value. This threshold is adjustable. With a value of zero it activates the contrast, with the value of 255 it deactivates the contrast. Finally, the script adjusts the color temperature. This adjustment can be done automatically or manually. The script also contains technical parameters, which if necessary need to be adjusted. These allow you to fix the area of the image to be analyzed in order to extract the data (eliminates the influence of colored borders or a very large colored object in the center of the scene). A threshold of not taking into account extreme pixels, adjustable from 0 to 100%. This threshold, set by default to 10%, only influences the result of the autogain. I wanted to make a script giving an automatic white balance without adjustments, but the videos being almost all special cases, it often remains necessary to adjust the process. To make the settings easier, the script can display a comparison of processes. The two images at the top correspond to the default treatments without and with contrast. The middle line shows the original, the result of coloryuv (autowhite), (this is to do better) and the output resulting from the operator settings. The bottom line shows the result of other combinations, autogain alone, autogain and bias, autogain and gamma. Finally, novelty of the version broadcast here, a new parameter. In gray world theory, the average color of an image should be 128, in YUV space, it's good, but not in RGB space, because each channel carries a luma information. By default, the script calculates the corrections of the gray world with respect to the average of the average values of each channel, calculated after the possible application of the gain. To the experience of some videos, it appeared to me that to allow to adjust from -50 to +50 this average of the average could be interesting. Last edited by Bernardd; 27th January 2022 at 11:58. Reason: delete dropbox link |
12th March 2017, 10:22 | #2 | Link |
Registered User
Join Date: Mar 2007
Posts: 408
|
Glad you're working on the topic. Maybe you want to read an earlier thread on AWB: Automatic White Balance (AWB) script function(s) (from your post, I don't think you are aware of it already, otherwise my apologies)
|
12th March 2017, 12:08 | #3 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Hello martin53,
I know your thread. https://forum.doom9.org/showthread.p...15#post1672715 Happy news, since 2014 i have learned and now your script works fine on my old computer. But i do'nt know what was the problem in past. My script target is to compensate color aberrations from aged film. Now my improve target is to find a good formula to fix gray value before to apply gamma and bias correction. Thus i return to study your job. Thanks. Bernard |
12th March 2017, 12:44 | #4 | Link |
Registered User
Join Date: Mar 2007
Posts: 408
|
Back then I had the ideal to automatically detect the white balance bias (the correction step afterwards is not the main challenge, I felt).
Note that StainlessS was so kind to implement the Minkowski P-norm statistics function in his RT_Stats plugin especially for these purposes. To my so far experiences back then, of the three common theories, White Patch best suited my taste for a wide range of footage (open sea, colorful nature scenery). But it has a fundamental drawback when used on already recorded footage in contrast to internally in a recording device itself: all camera makes I studied create still fully white bright spots when used indoors with daylight setting. In other words: everything is tinted in orange, but the bright spots are white, which cheats the White Patch approach. (Besides of that, just to mention it: a useful AWB controller must have an alternative algorithm for footage where bright spots are completely absent.) It turned out a dead end to limit the brightest pixels sent to White Patch to e.g. 20 luma increments below full white, because everyday footage can have already colorful objects in this luma range. Then I followed the idea for a while, that objects (in terms of pixel examination: neighboured pixels with color inside a reasonable range) depict mainly the color of the light source in their comparably brighter areas, while in their comparably darker areas, they mainly depict the color of all surrounding reflections. This did not lead anyone to a formula for the light source color, however, because reflections color itself depends on the light source color... Maybe the gray world theorem could be used for darker, reflection-dominated regions more than for the brighter regions. So i had to put my growing ever more complex studies aside for the moment. Recently I was incited to put more thinking into the subject, when I read about homomorphic filtering, which was supposed to separate incident from reflected light, and second I wonder if it could be helpful to calculate the theoretical black body temperature for each pixel, and use the maximum, probably mainly of rather bright (but not fully white! see above) pixels to estimate the light source temperature. This is because I made the observation that blue objects under incandescent light, recorded with daylight white balance, are hopefully not so bright in typical footage that they would cheat this approach. You are heartily welcome to find 'the' solution |
12th October 2017, 22:21 | #5 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Hello,
Here is a new version of the script. The novelty is the possibility of restricting the extraction of RGB data by not taking into account the pixels of the tones very dark and very bright. Thing is allowed with the use of a mask with function RT_RgbChanStats from the powerful RT_Stats plugin. This novelty combined with the use of contrast makes it possible to correct dominants of strong colors. Today by default we find: three display settings comparison = compare different settings - (false or true) show_scrutinized = shows the parsed area - (false or true) show_info = displays extracted and calculated data - (false or true) a technical adjustment matrix = choice of the color conversion matrix (Rec 601 = 0 or Rec 709 = 1) four settings to define the analyzed area x = ignore pixels to the left - percentage of width - default: 0.00 Y = ignore pixels at the top - percentage of height - default: 0.00 w = ignores pixels to the right - percentage of width - default: 0.00 h = ignores pixels below - percentage of height - default: 0.00 a technical setting of RT_Stats threshold = percentage of pixelx extreme to ignore - default: 0.10 twelve white balance automation settings auto_tone_range = Enable tone selection of the pixels to be scanned - (false or true), true tone_range = manual tone selection, ranges from 0 to 127, default 0 auto_luma_adjust = enable automatic adjustment of output luma - (false or true), default true luma_adjust = manual adjustment of the luma adjustment - default: 0, varies from -50 to 50 auto_gain = automatic gain gain setting - (false or true), true default gain_strength = manual gain control - default: 1.0, varies from 0.0 to 1.0 auto_cont = enable automatic contrast force setting - (false or true), true cont_strength = manual adjustment of contrast strength - default: 1.0, varies from 0.0 to 1.0 auto_rpow = enable automatic rpow force setting - (false or true), default true rpow_strength = manual rpow force setting - default: 1.0, varies from 0.0 to 1.0 auto_bias = enable automatic bias force setting - (false or true), true false bias_strength = bias force manual setting - default: 1.0, varies from 0.0 to 1.0 two adjustment of color temperature adjustment auto_temperature = enable automatic color temperature setting - (false or true) default false temperature = manually setting the color temperature - default: 0.0, varies from -1.0 to 1.0 The number of these settings can be frightening. But in practice the default settings with all the automation activated often give an acceptable result (in my opinion). When the result is not satisfactory, the output with the comparisons makes it possible to identify the optimum adjustment combination. In fine the setting for the color temperature is perhaps not useful today. (Google Traduction) The script in the three following posts Last edited by Bernardd; 12th October 2017 at 22:30. |
12th October 2017, 22:25 | #6 | Link | |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Script part one
Quote:
|
|
12th October 2017, 22:28 | #7 | Link | |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Script part two
Quote:
|
|
12th October 2017, 22:29 | #8 | Link | |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Script part three
Quote:
|
|
20th November 2017, 03:12 | #9 | Link |
Registered User
Join Date: Nov 2017
Location: India
Posts: 11
|
Bernard,
Thank you for this wonderful script, the script posted in first post works simply superb. I wanted to try the new version in the above three posts, it gives me following error Script error: syntax error ([GScript], line 169, column 0) (C:\Desktop\RGBAdapt_Awb_Process.avs, line 392) ([GScript], line 7) (C:\Desktop\RGBAdapt_Awb_Process.avs, line 467) (C:\Desktop\RGBAdapt_Awb_Process.avs, line 99) I believe that this is a copy/paste error. It will be very helpful if you can post the whole new version script in a single part avs file so that I can download. Thank you Last edited by Sachin; 20th November 2017 at 03:14. Reason: To make more specific |
20th November 2017, 05:02 | #10 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,009
|
Same here, but slight difference in line numbers (due to blank lines probably)
Code:
([GScript], line 169, column 0) (C:\Desktop\RGBAdapt_Awb_Process.avs, line 395) ([GScript], line 7) (C:\Desktop\RGBAdapt_Awb_Process.avs, line 469) (C:\Desktop\RGBAdapt_Awb_Process.avs, line 102)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 20th November 2017 at 10:07. |
20th November 2017, 17:42 | #11 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Hello,
Sachin, StainlessS, i apology. The error lines are these ARGS="Fmt,show_info,x,y,w,h,threshold, auto_tone_range, tone_range, auto_luma_adjust, luma_adjust," + " auto_gain, auto_cont, auto_rpow, auto_bias, gain_strength, cont_strength, rpow_strength, bias_strength, TooSmall,CWid,CHit," + "auto_temperature, temperature" They should be this : ARGS="Fmt,show_info,x,y,w,h,threshold, auto_tone_range, tone_range, auto_luma_adjust, luma_adjust," + \ " auto_gain, auto_cont, auto_rpow, auto_bias, gain_strength, cont_strength, rpow_strength, bias_strength," + \ " TooSmall,CWid,CHit,auto_temperature, temperature" But i suggest to do'nt spend much time to try the last script version, because i propose a new version. New script more short, more useable. More short, definitively only four ways for color cast correction. action with gain, action with contrast (new formula without color channel ponderation factors), action with rpow, action with bias. This four actions can work together or independantly. Each action have thus a tunable power strength . If you want, each action power strength can be equal and give a readable white balance. Thus it is more useable, you have only one common strength to tune. More useable the script have a automatic mode to compute this common strength. His white balance result is often readable. More useable it is fast to disable the common strength for one, two or three actions to fine the white balance. At this time, you can also tune the power strength of the actions of your choice to refine the white balance. The script have a comparison display mode to help to find the better combination of the four actions. This mode show nine output of the video. Top, without contrast action, in automatic common strength mode, you have from rigth to left gain action only, gain and bias actions, and gain, rpow and bias actions. Middle, from rigth to left, original input, AutoWhite ColorYUV process, and the tuned script output. Bottom, from rigth to left, with automatic common strength desable, but with common strength eaqual to 1.0 gain and contrast actions, gain, contrast, and bias actions and gain, contrast, rpow and bias actions. Comment The automatic common strength factor is an aproximation. Color cast is problem with color channel average and or min and max values. Thus common_strength = (channel average average + channel min average + channel max average))/(128+255). This formula gives often good results with low color cast, but for heavy color cast the strength of the four actions is to few. In this case you must disable automatic common strength and tune it in manual mode. You can also experiment the own manual tune of each actions. and in following posts. Bernard Last edited by Bernardd; 16th February 2018 at 17:33. Reason: delete dropbox link |
20th November 2017, 17:51 | #12 | Link | |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
script first part
Quote:
|
|
20th November 2017, 17:52 | #13 | Link | |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Script last part
Quote:
Last edited by Bernardd; 20th November 2017 at 17:57. |
|
29th January 2018, 21:15 | #15 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
New script version.
Five ways for color cast correction. action with gain, action with contrast, action with rpow, acion with spow, action with bias. This five actions can work together or independantly. Each action have thus a tunable power strength. In default mode, the script use gain, contrast, rpow and bias process. It compute a strength weighting factor for each actions. This mode give often readable results for many videos with a little color cast. The operator can refine the result with manual mode of each action (to desable contrast can be a good idea). With big color cast, the operator can desable the automatic strength weighting factor mode to use the whole correction of each process, it also enable spow process. The script have always a comparison display mode to help to find the better combination of the five actions. This mode show nine output of the video. Top, without contrast action, in automatic strength weighting factor strength mode, you have from rigth to left gain action only, gain and bias actions, followed by gain, rpow and bias actions. Middle, from rigth to left, original input, AutoWhite ColorYUV process, and the tuned script output. Bottom, from rigth to left, with strength weighting factor equal to 1.0, gain action only, gain and bias actions, followed by gain, contrast, rpow and bias actions. Comment If you use AvsPmod, you can uncomment lines 45 to 72 to have UserSliders facility. They are now two automatic strength weigthing factors. One for gain and contrast process : (channel min average + channel max average)/255 and one for gamma and bias process channel average average/128. The script in attachments Bernard Last edited by Bernardd; 16th February 2018 at 17:32. Reason: delete dropbox link |
16th February 2018, 17:31 | #17 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
New script version with automatic white balance improved in hight light.
Six ways for color cast correction. action with gain, action with contrast, action with bias rpow mix, action with spow, action with final bias. This six actions can work together or independantly. Each action have thus a tunable power strength. In default mode, the script use gain, contrast, bias rpow mix, spow and final bias process. It compute a strength weighting factor for each actions. This mode give often readable results for many videos. The operator can refine the result with manual mode of each action. In first action i suggest to desable the contrast. After you can use the comparison display mode, which help to find the better combination of the six actions. Comment If you use AvsPmod, you can uncomment lines 46 to 77 to have UserSliders facility. The script here and here https://www.dropbox.com/s/qft9f4fzrp...20fev.avs?dl=0 Bernard |
2nd March 2018, 11:46 | #18 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Hello,
New script version which improve process. First in past i have used a tip to control strength of gain, contrast and gamma process. Thus when i tuned strength to 0.0 gain, contrast and gamma values were 1.0 (neutral). When i tuned strength to 1.0, gain, contrast and gamma values were the computed values from RGB channels datas. For example the formula for gain was : gain = 1.0 + (255.0/MinMaxDiff_0 - 1.0) * gain_strength In manual mode this tip is not a problem, the operator choose the good gain_strength value. But in past, in automatic mode, i calculated a gain_strength value based on RGB channels datas to decrease, to ponderate the process strength and in this case the formula is not accurate 1.0 + (255.0/MinMaxDiff_0 - 1.0) * gain_strength is not (255.0/MinMaxDiff_0) * gain_strength, when gain_strength >0.0 and < 1.0. Now i used this formula gain = (255.0/MinMaxDiff_0) * (ponderate_factor + gain_strength) gain_strength is manual adujst arg in range from -1.0 to 1.0 with default 0.0 With the last formulas i have some problem of luma. Thus i was obliged to base the bias calcul on average of RGB channels averages after gain to recover readable something. With accurate formulas, no luma problem. Thus all process use the RGB channels values of original clip. Thus the new script is for color cast correction with five and half process. action with gain, action with contrast, action with one bias and rpow mix, action with spow, and the half,only if contrast is enable, action with one final bias to recover luma. (Contrast increase color saturation but also decrease luma.) This actions can work together or independantly. The operator can enable or desable gain, contrast, rpow and spow process with boolean switchs. He can also adjust the computed strength of gain and contraste with theire strength args. Bias and Gamma (rpow and spow) process are auto mixed in default mode. The operator can desable this automatic process with a boolean switch. In this case the operator can tune the bias gamma mix percentage with one arg. In manual mix mode percentage = 0.0 traduce only gamma process, 1.0 only bias. For inflexion point of Spow curve, the script compute one automatic spmid by RGB channels, but the operator can adjust these spmid with a spmid strength arg. One arg stay always manual. "pord" equal false (default) rpow corrections are computed before spow corrections, true inverse Gain bias formulas are classic formulas. Gamma formula is a mathematical application of grey world theory. Nota, gain and contrast are having the same formula, rpow and spow have the same formula. Automatic ponderation factor for gain and contrast, automatic bias gamma mixed percentage and spmid have formulas choosed after many personnal tests. This formulas are choosed for big colors casts like lena or tahiti clip, but i think they give readable output for low colors casts. But for big colors casts with washed colors, the spmid formula is not the best. In this case i suggest first to decrease the spmid strength and after to try to adjust bias gamma mix in manual mode. Below some samples Lena with default mode and comparaison display and RgbAdapt graffer to show curves. https://www.dropbox.com/s/cizhhta89k...aison.jpg?dl=0 https://www.dropbox.com/s/4f1t8qb4gw...affer.jpg?dl=0 Tahiti clip with default mode. On this sample we can see problem with contrast. Contrast is necessary to recover color, but we loose some details in the dark. At the end, red is a little magenta. A little hue with Tweak function can solve this look. https://youtu.be/y4LSb0pcTsU Disneyland park. on left half original, on right half default without contrast and on right without contrast but with decreased spmid strength to 0.6. I do'nt suggest that default without contrast and 0.6 spmid is the good combination, but it is very fast to find. https://youtu.be/x6oVh5PmTGk Comment If you use AvsPmod, you can uncomment lines 43 to 70 to have UserSliders facility. The script in attachment and here https://www.dropbox.com/s/j02xhirllh...20mar.avs?dl=0 |
30th June 2018, 23:07 | #19 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Hello
New script version. Better luma process. It is a manual white balance, you must tune the args. The script args are : comparison = boolean arg to show differents settings output show_scrutinized = boolean arg to show the scrutinized aera show_info = boolean arg to show extracted and comptuted datas matrix = "Rec601" or "Rec709" to choice the color conversion matrix x = float arg to specify the left of scrutinized aera Y = float arg to specify the top of scrutinized aera w = float arg to specify the right of scrutinized aera h = float arg to specify the bottom of scrutinized aera threshold = float arg to specify extreme pixels percentage to be ignored when datas extraction gain_strength = float arg to enable gain process and increase his strength cont_strength = float arg to enable contrast process and increase his strength cont_adapt = float arg to adapt contrast bias bias_gamma = boolean arg to enable bias and gamma white balance process bias_strength = float arg to enable bias process and increase his strength gamma_strength = float arg to enable gamma process and increase his strength cont_adapt2 = is the same arg as cont_adapt, but its vlaue is used when bias and gamma white balance is enable spow = boolean arg to enable spow process pord = boolean arg to secify order of rpow and spow process spmid_strength = float arg to adapt spimd temperature = float arg to increase or decrease color temperature The script calculate for each color channel, - the classic autogain with a gain bias to keep the value between 0 to 255 - the contrast, with gain formula and a cont bias to aviod a visual bad offset - a bias to keep the luma value after gain and or contrast application - in accordance with the grey world theory a bias to get the same value of color channel average - in accordance with the grey world theory a rpow float number - a spow float number with the rpow formula - a spmid number to specify inflexion point of the s curve Cont_adapt, cont_adapt2, bias_gamma, pord and temperature are not computed. They are operator choices. The operator can modify, adjust the computed results by increasing or decreasing gain, contrast, bias and gamma strengths and cont adapt. The operator can choice the combination of process. Gain, contrast, bias and gamma strengths desable process when their values are null. Nota : For gain and contrast strengths = 0.0, gain and contrast factors = 1.0 and gain bias and contrast bias = 0.0. But, for gain and contrast strengths = 0.1, gain and contrast factors are near to 1.0, but gain and contrast bias are not null. For sample, if the min value of one color channel is 100, the bias for gain is -100. The perform of this script is the contrast bias use. The operateur can tune cont_adapt2 (or cont_adapt if only gain and contrasts process are selected) to get the best contrast bias. For some videos, it is possible to get a readable white balance with only gain and contrast process. For other video, you must use classical bias and gamma process. The arg tunes are manual With the boolean arg bias_gamma, you can make a fast comparison between gain and contrast result and result of combination of gain, contrast, bias and gamma . The default args give a readable output with "lena" color cast sample picture. But it can be better. First decrease or increase cont-adapat2. The script have always a comparison display mode to help to find the better combination of actions. This mode show nine output of the video. Top, from left to right, gain action only, gain and bias actions, followed by gain, rpow and bias actions. Middle, from left to right, original input, AutoWhite ColorYUV process, and the tuned script output. Bottom, from left to right, default modes without gain, and without cont, default modes without gain and default modes all process. Comment If you use AvsPmod, you can uncomment lines 45 to 76 to have UserSliders facility. The script here in attachment and here https://www.dropbox.com/s/lhvwqufa8h...0juil.avs?dl=0 Bernard Last edited by Bernardd; 30th June 2018 at 23:10. |
17th September 2018, 15:44 | #20 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 251
|
Hello,
The script with two automatic modes and one manual. The first automatic mode use only gain and contrast process, sometimes for white balance it is enough. The second automatic mode use gain, contrast, bias and gamma process. In this mode you can adjust gamma S curves process action to refine the white balance. In manual mode you tune separately each process actions. The script args are : 1- for display tunings - comparison , default = false, to compare different process selection outputs : -------------------Top, from left to right, full gain an contrast action,full contrast action, followed by automatic gain and contrast actions. -------------------Middle, from left to right, original input, AutoWhite ColorYUV process, and the tuned script output. -------------------Bottom, from left to right, automatic mode without rpow, automatic modes without spow and automatic mode all process. - show_scrutinized, default = false, to select the area scrutinized by RT_Stat plugin for data extraction - show_info, default = false, to see extracted datas and process args tune - matrix, defaut = "Rec601", to give the video color space matrix - x, default = 0.1, to specify the source rectangle under scrutiny by RT_Stat plugin for data extraction - Y, default = 0.1, see RT_STAT doc - w, default = 0.1 - h, default = 0.1 - threshold, default = 0.1, to specify extreme pixels percentage to be ignored when datas extraction (see RT_STAT doc) 2- automatic white balance preset tunings - mode, default = "auto", in this case all process are used in automatic, if "gain_&_cont" only gain and contrast are used in automatic, if "manual" you tune separately each process - rpow, default = true, only efficiency in mode "auto", you can enable or desable the rpow process, - spow, default = true, only efficiency in mode "auto", you can enable or desable the rpow process, - spow_adjust, default = 0.0, float from -1.0 to 1.0, only efficiency in mode "auto", you can adjust the automatic computed spow strength to refine spow process. If value = 0.0 no computed spow strength have not change. 3- manual white balance tunings - gain_strength, default = 0.5, float from 0.0 to 1.0, to tune gain process strength. If value = 0.0 no gain process use. - cont_strength, default = 0.5, float from 0.0 to 1.0, to tune contrast process strength. If value = 0.0 no conttrast process use. - g_c_bias_adapt, default = 0.5, float from 0.0 to 1.0, to adjust the automatic bias computed when gain and or contrast are applied. If value = 0.0 computed gain and cont bias = 0.0. - bias_strength, default = 0.5, float from 0.0 to 1.0, to tune bias process strength. This bias is a computed bias in accordance with grey world theory for color balance. If value = 0.0 no bias process use. - rpow_strength, default = 0.5, float from 0.0 to 1.0, to tune rpow process strength. This computed rpow is the application of the grey world theory for color balance to gamma space. Explanation in script comment. If value = 0.0 no rpow process use. - spow_strength, default = 1.5, float from 0.0 to 2.0, to tune spow process strength. Like rpow proces but with S curve. If value = 1.0 no spow process use. 4- spow process's specifics tunes in automatic or manual mode, if spow process is enable - pord, default = false, priority for rpow or spow process, see RGBAdapt doc. - spmid_strength, default = 1.0, float from 0.0 to 1.0, you can adjust the automatic computed spmid strength to refine spow process In this script, gain formula and grey world bias formula are classical. The other formulas are empirical, i have searched formulas to mix maximal, minimal and average values of each RGB channel RGB to : - do not use too much the autogain process and - get best results with almong videos clips plubished on this forum like here https://forum.doom9.org/showpost.php...7&postcount=83 or found on WDW plublication https://forum.doom9.org/showpost.php...&postcount=924 The problem of this method is to found a good mix of datas to get always the good S curve correction. In fact, the Max, Min and average values of RGB channels are not enough to describe a color channel histogram with two or more pic values. Thus i have jut found one formula for gentle videos. A manual adjust of Spow correction is often necessary. You can make it by tuning spow_adjust and or spmid args. Each video is specific, each scene is specific, a tip is to look at the comparison display output of the script to find the best combination of process. Often, if the automatic mode without spow seem to be the best, you have interest before to desable spow, to tune spow_adjust and or spmid tune. With this display you can find some scene like below, which have a good result with only manual contrast use (result with full gain and contrast seem better, but you have no reserve for add autogain and more saturation). https://www.dropbox.com/s/omvsv5aj7u...00082.jpg?dl=0 Comment If you use AvsPmod, you can uncomment lines 49 to 81 to have UserSliders facility. The script here in attachment and here https://www.dropbox.com/s/kxwctnxg5q...0sept.avs?dl=0 Bernard Last edited by Bernardd; 18th September 2018 at 19:24. |
Thread Tools | Search this Thread |
Display Modes | |
|
|