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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd January 2019, 20:52   #41  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 346
How long does it generally take for the forum admins to approve attachments?
Danette is offline   Reply With Quote
Old 23rd January 2019, 21:57   #42  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by Danette View Post
How long does it generally take for the forum admins to approve attachments?
I heard tell that whilst waiting, one guy died and ended up desiccated.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 24th January 2019, 02:11   #43  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 346
Quote:
Originally Posted by StainlessS View Post
I heard tell that whilst waiting, one guy died and ended up desiccated.
Bernardd: please remain hydrated!!
Danette is offline   Reply With Quote
Old 25th January 2019, 11:50   #44  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Hello,

First, this new version always is in accordance with Stainlesss nice and smart redaction to have compatibility with Avisynth x32 and Avisynth+ x64 and the suitable plugins.

Secondly, this version have the same engine than the previous (except for spmid calculation, which is more simple), but operator dialogue is changed. You have now a RGBAdapt function with a AWB mode, which can be refined with original RGBAdapt args.

Third the script do a half automatic white balance, in finish you must control and often adjust pord and spmid.

This script has one target : a better automatic white balance than ColorYUV(autowhite=true).

Thus the script have one display args to show the assesment :

- comparison , default = false, to compare ColorYUV(autowhite=true) output with three other outputs :
------- Top, from left to right, original input, like AutoWhite ColorYUV process.
------- Bottom, from left to right, automatic mode with whole process, tuned script output.

The script automatic mode is not full optimized, often the channel spmid need to be tuned.
For this process, the datas like color channel average, max and min datas are not enougth to descrive the color channel curve, thus not enougth to choice inflexion point of S curve.
Thus the script have one secund display args to verify spmid influency :

- influency , default = false, to compare different process selection outputs :
------- Top, from left to right, original input, automatic mode with whole process, but with spmid = 0.25 for the three channels.
------- Bottom, from left to right, automatic mode with whole process, but with spmid = 0.75 for the three channel, tuned script output.
This display do not show the best solution for spmid, it give you by comparison a way to find the best tune.

The script have two other display args :

- show_scrutinized, default = false, to display the scrutinized area by RT_Stat plugin for data extraction.
- show_info, default = false, to see extracted datas and process args tunes.

The script have the following args to tune the white balance process :

- 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)

With this following args, you can choice automatic process combination :
- gain, default = true, gain process enable
- cont, default = true, cont process enable
- bias, default = true, bias process enable
- rpow, default = true, rpow process enable
- spow, default = true, spow process enable

Finally, the script have also the RGBAdapt's args, for bias, gain, cont, rpow, spow, spmid and pord. See RGBAdapt documentation.

Note :
If you have only selected bias, you get like ColorYUV(autowhite = true) ouput. If you tune one RGBAdapt channel bias arg, you change this white balance.

In fact, the script produce a automatic white balance, that you can refine by tunning RGBAdapt args. If all automatic process are desabled, you have only manual RGBAdapt function.

Fast tips :
Run script with default args,
Look influency display to verify if spmid is good, if no, tune channel spmid. After return comparison diplay or output display.
If necessary, now, you can improve the white balance by tunning RGBAdapt args, like channel gain (little change like 0.1 or 0.2) or like bias and rpow together. If you decrease a channel bias you decrease channel inflency in light aera, if you increase the same channel rpow, you increase channel inflency in dark aera.

To refine, you can try to tune all RGBAdapt args, but do not forget, if automatic process is enable, your changes on suitable RGBAdapt args must be little.
Thus the AvsPmod user slider ranges for RGBAdapt args are more little than in the RGBAdapt documentation.

Comment :
The script have always two functions :
AWB_Func(), which call the second function and add only two comparison displays opportunity, in default mode this comparison display are desabled.
RGBAdapt_AWB_Process(), which is the script for AWB with technical settings like "scrutinized aera", "color matrix", and process combination to produce AWB (gain and contrast, and bias or whole).

Thus, one script with one line like AWB_Func(), give the same output that one script with one line RGBAdapt_AWB_Process(). This output is the AWB with whole process and their default settings.

The script release file content two avs files, one for the functions, the secund for the client.
The script need to load this plugins in accordance with avisynth version :
- GRunT author Gavino http://forum.doom9.org/showthread.php?t=139337 and the posts 35 and 39 for x64 versions by Yesmanitsbearman.
- GScript author Gavino http://forum.doom9.org/showthread.php?t=147846, x32 only, no need with Avisynth +
- RGBAdapt author Stainless http://forum.doom9.org/showthread.php?t=170642
- RT_Stats author Stainless https://forum.doom9.org/showthread.p...13#post1584313

If you use AvsPmod, you can uncomment lines 67 to 115 to have UserSliders facility.

The script here in attachment
and here https://www.dropbox.com/s/95q3uhvo5i...202019.7z?dl=0

I think this version is a candidat release, i have no idea to improve it, to make it more automatic.

Bernard

PS : DropBox link for thirsty people
Attached Files
File Type: 7z RGBAdapt Awb Process x32 x64 jan 2019.7z (6.7 KB, 243 views)

Last edited by Bernardd; 25th January 2019 at 13:14.
Bernardd is offline   Reply With Quote
Old 31st January 2019, 21:21   #45  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 346
I agree with others: this is a noticeable improvement over the earlier versions - even using defaults. Flesh tones are better and colors and whites are warmer. Better than the likes of ColorYUV and, in many situations, WhiteBalance.

Congratulations, Bernard, on turning StainlessS good work into what appears to be a simple one-size-fits-all white balance capability.

Of course, a dll would eliminate all the lines needed in the script, but I can appreciate that such coding is more than you want to get involved in.
Danette is offline   Reply With Quote
Old 1st February 2019, 07:29   #46  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Quote:
Originally Posted by Danette View Post
How long does it generally take for the forum admins to approve attachments?
Although I visit this forum regularly, I hadn't read this thread as I work almost entirely with black and white material and it didn't interest me. But I had a look, saw your question, and approved all pending attachments. On behalf of us lazy mods, I apologize.

To answer your question, anywhere from immediately to never.
manono is offline   Reply With Quote
Old 1st February 2019, 15:10   #47  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 346
Quote:
Originally Posted by manono View Post
Although I visit this forum regularly, I hadn't read this thread as I work almost entirely with black and white material and it didn't interest me. But I had a look, saw your question, and approved all pending attachments. On behalf of us lazy mods, I apologize.

To answer your question, anywhere from immediately to never.
Thanks. I'll complain when they start paying you to do this.
Danette is offline   Reply With Quote
Old 1st February 2019, 21:06   #48  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
A bit OT.
Quote:
Originally Posted by foxyshadis View Post
Report your own post, say "approve plz" and it'll get approved. I don't think the 200k thing is a real limit.

Unfortunately vBulletin in all of its wisdom notifies mods of reports but does NOT notify us of pending approvals, so the only option is to wade into threads on the off chance someone might have attached something. There's the mod panel, but it's... lousy, at best. I check on this thread twice a week, but it's so active I miss a lot. Now that we all work way more than full time, the rules page really needs a Rule #0: Report your own post for prompt service.
https://forum.doom9.org/showthread.p...90#post1837290

The REPORT icon is the little red triangle under your avatar [ideally on post containing the attachment, or add which post you refer to].

EDIT:
Quote:
Originally Posted by Danette View Post
Thanks. I'll complain when they start paying you to do this.
I'll complain a lot more often, when they start paying me to do that.
__________________
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; 1st February 2019 at 21:35.
StainlessS is offline   Reply With Quote
Old 16th February 2019, 16:55   #49  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Hi StainlessS

I think export the RGBAdapt args computed by my script in a text file and i would load this data in RGBAdapt_graffer. But i have not the knowledge to modify RGBAdapt_graffer for this use. Thus, please, i ask you, if you wish insert for me, datas import function in the graffer soft.

Bernard
Bernardd is offline   Reply With Quote
Old 16th February 2019, 22:41   #50  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
What format would input take ?

Will probably take a least a couple of days for me to get time.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 17th February 2019, 18:35   #51  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Thanks StainlessS

I think add lines like below to export in text file the computed datas.

Quote:
enregistre = true

Fmb= "%7.3f %5.3f %5.3f" +
\ " %5.3f %5.3f %5.3f %s\n" +

\ "%7.3f %5.3f %5.3f" +
\ " %5.3f %5.3f %5.3f %s\n" +

\ "%7.3f %5.3f %5.3f" +
\ " %5.3f %5.3f %5.3f %s"

E=RT_String(Fmb,
\ red_bias, red_gain, red_cont,
\ red_rpow, red_spow, r_spmid, r_pord,

\ grn_bias, grn_gain,grn_cont,
\ grn_rpow,grn_spow, g_spmid, g_pord,

\ blu_bias,blu_gain,blu_cont,
\ blu_rpow,blu_spow, b_spmid, b_pord)
if (enregistre) {RT_WriteFile("F:\Travail sur Videos\RGBAdapt.txt",string(E))}
The text file is like this sample :
-114.959 1.255 1.439 0.291 1.037 0.418 False
30.556 1.221 1.380 1.516 0.985 0.621 False
70.043 1.541 1.930 1.828 0.979 0.599 False

If RGBAdapt_graffer soft can load this datas and use them like args, it is more easy to refine the output process by looking the color channels curves.

I am not hurry, you are the master of time.

Thanks

Bernard

Last edited by Bernardd; 17th February 2019 at 21:03.
Bernardd is offline   Reply With Quote
Old 9th July 2019, 21:54   #52  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Hello,

Bellow, a new script. The aim is always the same : get a better result than ColorYUV(autowhite = true).
This new version is in accordance with Stainlesss nice and smart redaction to have compatibility with Avisynth x32 and Avisynth+ x64 and the suitable plugins.
This script use only maximum, minimum, maximum - minimum difference, average color channel values.
This script is more sober. Now, they are no more my experimental factors to ponderate and adapt gain, contrast, bias and gamma corrections.
In fact, the script is less automatic, if you are lucky, the full automatic ouput should be good for you, but it is possible you must tune some process.
In the previous scripts, automatic gain and contrast were sometimes too much.
In this script, gain and contrast calculation is new. If necessary, one manual tune has been also add to decrease automatic gain and contrast.

This script applies a automatic gain and contrast, compute the datas of the clip with this gain and contrast, then applies a gray world theory corrections with bias and gamma process based on the computed datas.
By default, for gray world theory, half of job is made with bias and the other half is made with gamma (rpow and spow). One manual tune has been add to tune bias gamma process actions mix.

Like in previous scripts, you can desable automatic gain, contrast, bias, rpow and spow. You can choose the best combination of process for your videos.

For fast tune, the script can display four screens :
1- one with original clip, ColorYUV(autowhite = true) clip, overlay of automatic default mode but without gain on left and without contrast on right and selected output.
This screen is to better result than ColorYUV(autowhite = true) assement,
to tune gain and contrast, (gain desable, or contrast desable, or the both, or perhaps decreased automatic gain and contrast)
2- one screen with automatic default mode with 50 % of bias use and 50% of gamma use, output with 25 % of bias use and 75% of gamma use, ouput with 75 % of bias use and 25% of gamma use and selected output.
This screen is to adjust action percentage of bias process versus gamma process.

3- one screen with selected output default spmid, selected output with half decrease automatic spmid, selected mode output with half increase automatic spmid, and selected output with your spmid tune.
this screen is to adjust spmid correction (you have to change color channel spmid args of RGBAdapt plugin).

4- one screen with selected output without refine, selected output with invariant red refine and or RGBAdapt plugin args mod, selected output with invariant green refine and or RGBAdapt plugin args mod,and selected output with invariant blue refine and or RGBAdapt plugin args mod.
This screen is to adjust refine args. You can change this args and see if it is good or no for one color channel.

In finish, you can also refine the automatic output with whole RGBAdapt plugin args. These RGBAdapt plugin args tunes are added to automatic tunes.

The script release zip file content two avs files, one for the functions, the secund for the client.
Decription of args are also in documentation file joint in zip file.

The script here https://www.dropbox.com/s/8liexi6r1a...rocess.7z?dl=0

Bernard
Bernardd is offline   Reply With Quote
Old 19th July 2019, 15:16   #53  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Ok, henryperu77, a avs script demo with your video.
You have to upload these files and to add their paths on your computer.

This script make only white balance for you. For color saturation, or tone adjust try to use Tweak (internal avisynth function).

Quote:
Import ("C:\................\RGBAdapt_Awb_Process v 2019 juil 32 64 bits function.avs")
LoadPlugin("C:\.............\GRunT101\GRunT.dll")
LoadPlugin("C:\.............\GScript_11\GScript.dll")
LoadPlugin("C:\.............\RgbAdapt_25&26_x86_x64_dll_v0.05_20190301\Avisynth+_x86\RgbAdapt_x86.dll")
LoadPlugin("C:\.............\RT_Stats_25&26_dll_v2.00Beta11_20170910\Avisynth26\RT_Stats26.dll")

LoadPlugin("C:\.............\ffms2-2.20-icl\x86\ffms2.dll")
FFVideoSource("C:\..........\beatles-film.mp4")

AWB_Func(matrix="Rec601",show_scrutinized=false,x=0.14,y=0.04,w=0.14,h=0.04,threshold=0.1,show_info=false,
\ gain = true, cont = true, g_c_decrease = 1.0, bias = true, rpow = true, spow = true, gamma_bias_mix = 0.5)

Last edited by Bernardd; 19th July 2019 at 15:26.
Bernardd is offline   Reply With Quote
Old 19th July 2019, 16:09   #54  |  Link
henryperu77
Registered User
 
Join Date: Jun 2009
Posts: 49
Quote:
Originally Posted by Bernardd View Post
Ok, henryperu77, a avs script demo with your video.
You have to upload these files and to add their paths on your computer.

This script make only white balance for you. For color saturation, or tone adjust try to use Tweak (internal avisynth function).



hi thank you
please could you check starting Frame 5784, the color change like crazy...
henryperu77 is offline   Reply With Quote
Old 19th July 2019, 16:23   #55  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
This script is not full automatic. Some scenes need a different tune.

Thus you can try this with no Grey world theory bias process.

Quote:
AWB_Func(matrix="Rec601",show_scrutinized=false,x=0.14,y=0.04,w=0.14,h=0.04,threshold=0.1,show_info=false,
\ gain = true, cont = true, g_c_decrease = 1.0, bias = false, rpow = true, spow = true, gamma_bias_mix = 0.5)
Bernardd is offline   Reply With Quote
Old 19th July 2019, 16:28   #56  |  Link
henryperu77
Registered User
 
Join Date: Jun 2009
Posts: 49
Quote:
Originally Posted by Bernardd View Post
This script is not full automatic. Some scenes need a different tune.

Thus you can try this with no Grey world theory bias process.
the problem is still the same scenes, the color change frame to frame...
henryperu77 is offline   Reply With Quote
Old 19th July 2019, 16:47   #57  |  Link
henryperu77
Registered User
 
Join Date: Jun 2009
Posts: 49
this is sample

https://drive.google.com/open?id=1jN...Mh2I0R8KikjKop
henryperu77 is offline   Reply With Quote
Old 19th July 2019, 20:11   #58  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
It is extreme pixels problem when pixel max and min values are extracted. You can try to increase threshold arg, like this

Quote:
AWB_Func(matrix="Rec601",show_scrutinized=false,x=0.14,y=0.04,w=0.14,h=0.04,threshold=0.5,show_info=false,
\ gain = true, cont = true, g_c_decrease = 1.0, bias = false, rpow = true, spow = true, gamma_bias_mix = 0.5)
But, i have not found a good tune for whole clip.

The solution is not use of gain and contrast, like below.

Quote:
AWB_Func(matrix="Rec601",show_scrutinized=false,x=0.14,y=0.04,w=0.14,h=0.04,threshold=0.1,show_info=false,
\ gain = false, cont = false, g_c_decrease = 1.0, bias = false, rpow = true, spow = true, gamma_bias_mix = 0.5)
Bernardd is offline   Reply With Quote
Old 19th July 2019, 22:35   #59  |  Link
henryperu77
Registered User
 
Join Date: Jun 2009
Posts: 49
but the colors are awful , i cant fix it with colormill
henryperu77 is offline   Reply With Quote
Old 7th August 2019, 17:06   #60  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Hello,

A new version, more smart, more automatic.

This script brings the RGBAdapt plugin an automatic mode to achieve the white balance.

The default white balance results from the combination of gain, contrast, average, gamma (rpow) and gamma correction with S (spow) curve on each color channel.

The correction in agreement with the gray-world theory results from the combined action of a correction of bias and a correction of rpow, the second treating the part not taken into account by the first one. The script calculates for each image the proportion of work done by each process. Finally a spow correction (S curve) is added.

The data used to calculate these corrections, ie the average, maximum and minimum values ​​of the color channels, do not allow a continuous description of the histogram curve of the three basic colors, so they are not sufficient to choose the inflection point of the S curve. By default, the script proposes for each channel, an inflection centered on its average value. For a little disturbed movie, this solution may be satisfactory, but in general, you will need to adjust the spmid of each channel by watching the movie.

Default automatic mode result for Lena in center, with red_spmid = 0.20 green_spmid = 0.20 and blue_spmid = 0.70 on right.

https://i.postimg.cc/zvz1q1ZC/Lena2.png

The script here in attachment
and here https://www.dropbox.com/s/j6ahq37eno...%20aug.7z?dl=0

Bernard
Attached Files
File Type: 7z RGBAdapt_Awb_Process 32 64 bits v 2019 aug.7z (12.7 KB, 340 views)
Bernardd is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.