"Кинопередвижка" Форум любителей и коллекционеров плёночного кино.

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » "Кинопередвижка" Форум любителей и коллекционеров плёночного кино. » AviSynth » Обработка отсканированного материала с помощью AviSynth


Обработка отсканированного материала с помощью AviSynth

Сообщений 21 страница 40 из 49

21

Кто может объяснить причину появления в начале этой зелени на 3 кадра, далее идёт нормально.

http://s3.uploads.ru/t/7zVgc.jpg

Отредактировано dan74 (30-09-2019 17:17:55)

22

Выход из ситуации в предыдущем посте решил опять же с помощью Ависинта. Добавив в скрипт очистки одну строчку.

FadeIn(25,color=color_black)   # появление из затемнения

23

Скрипт восстановления цвета -

http://s7.uploads.ru/t/idUVH.jpg

имеется регулировка LEVELS

http://s3.uploads.ru/t/N8ZEw.jpg

скрипт

--------------------------------------------------------------------------------------------------------

AVISource("C:\Users\zzzzz2019zzzzz\Desktop\123.avi")

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\GRunT.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RGBAdapt.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RT_Stats.dll")
# display tunings
comparison = false
show_scrutinized = false
show_info = false

Levels(19, 1.228, 255, 0, 255)

# color space matrix tuning and specify the source rectangle under scrutiny
matrix = "Rec601"
x = 0.09
Y= 0.09
w = 0.09
h = 0.09

# autogain tunings
threshold  = 0.10
gain_strength = 1.0       

# autocontraste tunings       
auto_cont  = true
cont_strength = 1.0

# gamma process tunings
auto_spow = true
rpow_strength = 1.0
spow_strength = 1.0
pord = false

# bias tuning
bias_strength = 1.0

# If you use AvsPmod user sliders you can delete comment for follow lines

#~
#~ comparison = Select(0, false , true)
#~ show_scrutinized = Select(0, false , true)
#~ show_info = Select(0, false , true)

#~
#~ matrix = Select(0, "Rec601" , "Rec709")
#~ x = 0.07
#~ Y= 0.07
#~ w = 0.07
#~ h = 0.07
#~ threshold  = 0.1

#~

#~
#~ gain_strength = 1.0

#~
#~ auto_cont = Select(1, false , true)
#~   
#~ cont_strength = 1.0

#~
#~ auto_spow = Select(1, false , true)
#~
#~ rpow_strength = 1.0
#~ spow_strength = 1.0
#~ pord = Select(0, false , true)

#~
#~ bias_strength = 1.0
                                           
output = RGBAdapt_awb_process(matrix = matrix, show_scrutinized = show_scrutinized,  show_info = show_info, x = x, y = y, w = w, h = h, \
                                                       threshold = threshold, gain_strength = gain_strength, auto_cont = auto_cont,cont_strength = cont_strength, \
                                                       auto_spow = auto_spow,rpow_strength = rpow_strength, spow_strength = spow_strength, pord = pord, bias_strength = bias_strength)                                                                                 
                                                                               
without_cont_output = (!comparison) ? nop : RGBAdapt_awb_process(matrix = matrix, show_scrutinized = false,  show_info = false, x = x, y = y, w = w, h = h,  \
                                                       threshold = threshold, cont_strength = 0.0, auto_spow = false)\
                                                       .AddBorders(0, 80, 0, 0, color=$000000). Subtitle ("gain, rpow_strength, spow_strength and  bias process     no cont and no auto mode for gamma"+ \
                                                  "\n threshold : " + LeftStr(string(threshold),4) + "   gain strength : 1.0"  + "   auto_cont : false  cont strength : 0.0" + \
                                                  "\n auto_spow : false   rpow strength : 1.0" + "   spow strength : 1.0"  + "   pord : false" +\
                                                  "\n bias strength : 1.0" , lsp = 20)                                                     
                       
bias_only  =  (!comparison) ? nop : RGBAdapt_awb_process(matrix = matrix, show_scrutinized = false,  show_info = false, x = x, y = y, w = w, h = h, \
                                                       threshold = threshold, gain_strength = 0.0, cont_strength = 0.0, rpow_strength = 0.0)\
                                                        .AddBorders(0, 80, 0, 0, color=$000000). Subtitle ("bias process only      output near ColorYUV autowhite"+ \
                                                  "\n threshold : " + LeftStr(string(threshold),4) + "   gain strength : 0.0"  + "   auto_cont : false  cont strength : 0.0" + \
                                                  "\n auto_spow : false   rpow strength : 0.0" + "   spow strength : 0.0"  + "   pord : false" +\
                                                  "\n bias strength : 1.0" , lsp = 20)

gain_bias_only =  (!comparison) ? nop : RGBAdapt_awb_process(matrix = matrix, show_scrutinized = false,  show_info = false, x = x, y = y, w = w, h = h, \
                                                       threshold = threshold, cont_strength = 0.0, rpow_strength = 0.0)\
                                                        .AddBorders(0, 80, 0, 0, color=$000000). Subtitle ("gain and bias process only"+ \
                                                  "\n threshold : " + LeftStr(string(threshold),4) + "   gain strength : 1.0"  + "   auto_cont : false  cont strength : 0.0" + \
                                                  "\n auto_spow : false   rpow strength : 0.0" + "   spow strength : 0.0"  + "   pord : false" +\
                                                  "\n bias strength : 1.0", lsp = 20)
                                                 
gain_gamma_only =  (!comparison) ? nop : RGBAdapt_awb_process(matrix = matrix, show_scrutinized = false,  show_info = false, x = x, y = y, w = w, h = h, \
                                                    threshold = threshold, cont_strength = 0.0, auto_spow = false, bias_strength = 0.0) \
                                                      .AddBorders(0, 80, 0, 0, color=$000000). Subtitle ("gain cont rpow and spow process but no bias process and no auto mode for cont and gamma"+ \
                                                  "\n threshold : " + LeftStr(string(threshold),4) + "   gain strength : 1.0"  + "   auto_cont : false  cont strength : 0.0" + \
                                                  "\n auto_spow : false   rpow strength : 1.0" + "   spow strength : 1.0"  + "   pord : false" +\
                                                  "\n bias strength : 0.0" , lsp = 20)                                                   
                                                       
all =  (!comparison) ? nop : RGBAdapt_awb_process(matrix = matrix, show_scrutinized = false,  show_info = false, x = x, y = y, w = w, h = h, threshold = threshold) \
                                                      .AddBorders(0, 80, 0, 0, color=$000000). Subtitle ("gain cont rpow spow and bias process  with auto mode for cont and gamma"+ \
                                                  "\n threshold : " + LeftStr(string(threshold),4) + "   gain strength : 1.0"  + "   auto_cont : true  cont strength : 1.0" + \
                                                  "\n auto_spow : true   rpow strength : 1.0" + "   spow strength : 1.0"  + "   pord : false" +\
                                                  "\n bias strength : 1.0" , lsp = 20)                                                                         

compared_output = (!comparison) ? nop : StackVertical(StackHorizontal(last.AddBorders(0, 80, 0, 0, color=$000000).Subtitle("original"),gain_bias_only, all), \
                                                  StackHorizontal(bias_only, gain_gamma_only, output .AddBorders(0, 80, 0, 0, color=$000000)\
                                                  . Subtitle ("user setting where all args are free" + \
                                                  "\n threshold : " + LeftStr(string(threshold),4) + "   gain strength : " + LeftStr(string(gain_strength),3)  + "   auto_cont : " + string(auto_cont)+\
                                                   "   cont strength : " + LeftStr(string(cont_strength),3) + \
                                                  "\n auto_spow : " + string(auto_spow) + "   rpow strength : " + LeftStr(string(rpow_strength),3) +"   spow strength : " + \
                                                  LeftStr(string(spow_strength),3)  + "   pord : " + string(pord) +\
                                                  "\n bias strength : " + LeftStr(string(bias_strength),3)  , lsp = 20)))
                       
(!comparison) ? output : compared_output

# ----------------------------        function script      -------------------------------------

function RGBAdapt_awb_process(clip clip, string "matrix",bool "show_scrutinized", bool "show_info", float "x", float "y", float "w", float "h", \
                                                      float "threshold",  float "gain_strength" ,  bool "auto_cont", float  "cont_strength", \
                                                      bool "auto_spow", float "rpow_strength", float "spow_strength", bool "pord", float "bias_strength")
                                                                     
{

#----------------------------------------------based on  RGBADapt plugin ---------------------------------------------------------------------#
#                 script author  : StainlessS http://forum.doom9.org/showthread.php?p … ost1681286                                     #
#------------------------------------------------------------------------------------------------------------------------------------------------- #

#---------------------------------------------- need  RT_Stats plugin ----------------------------------------------------------------------------#
#                 script author  : StainlessS http://forum.doom9.org/showthread.php?p … ost1584313                                       #
#----------------------------------------------------------------------------------------------------------------------------------------------- #

#---------------------------------------------- need  GRunT plugin ----------------------------------------------------------------------------#
#                 script author  : Gavino http://forum.doom9.org/showthread.php?p … ost1157083                                         #
#----------------------------------------------------------------------------------------------------------------------------------------------- #

Assert(IsYV12(clip) || IsRGB(clip)," Input video colorspace must be YV12 or RGB, not YUV") 
matrix = string(Default(matrix, "Rec601") ) # Color standard, Rec 601 or Rec 709
Assert(matrix == "Rec601" || matrix == "Rec709", """RGBAdapt_auto_awb: matrix "Rec601" or "Rec709"""")
show_scrutinized = Default(show_scrutinized, false) # show scrutinized aera or not, default false
show_info = Default(show_info, false) # show info or not, default false
x = float(Default(x,0.00)) #width percentage to specify the coords source rectangle under scrutiny, the default :  x = y = h = w = 0.00 is full frame
Assert(x>=0.00 && x <= 0.99,"RGBAdapt_auto_awb: x 0.00 -> 0.99")
y = float(Default(y,0.00)) #heignt percentage to specify the coords source rectangle under scrutiny, the default :  x = y = h = w = 0.00 is full frame
Assert(y>=0.00 && y <= 0.99,"RGBAdapt_auto_awb: y 0.00 -> 0.99")
w = float(Default(w,0.00)) #coords specify the source rectangle under scrutiny, the default :  x = y = h = w = 0.00 is full frame
Assert(w>=0.00 && w <= 0.99,"RGBAdapt_auto_awb: w 0.00 -> 0.99")
Assert(x+w>=0.00 && x+w <= 0.99 ,"RGBAdapt_auto_awb: x+w 0.00 -> 0.99")
h = float(Default(h,0.00)) #coords specify the source rectangle under scrutiny , the default :  x = y = h = w = 0.00 is full frame
Assert(h>=0.00 && h <= 0.99,"RGBAdapt_auto_awb: h 0.00 -> 0.99")
Assert(y+h>=0.00 && y+h <= 0.99 ,"RGBAdapt_auto_awb: x+w 0.00 -> 0.99")
threshold  = Float(Default(threshold, 0.10)) # threshold arg of RT_Stats plugin
Assert(threshold>=0.00 && threshold <= 1.00,"RGBAdapt_auto_awb: threshold 0.00 -> 1.00")
gain_strength = Float(Default(gain_strength, 1.00)) # strength arg for gain
Assert(gain_strength>=0.00 && gain_strength <= 1.00,"RGBAdapt_auto_awb: gain_strength 0.00 -> 1.00")
auto_cont = Default(auto_cont, true) # auto weighted cont_strength arg
cont_strength = Float(Default(cont_strength, 1.00)) # strength arg for contrast
Assert(cont_strength>=0.00 && cont_strength <= 1.00,"RGBAdapt_auto_awb: cont_strength 0.00 -> 1.00")
auto_spow = Default(auto_spow, true) # auto weighted rpow_strength arg control by cont_strength arg
rpow_strength = Float(Default(rpow_strength, 1.00)) # strength arg for rpow
Assert(rpow_strength>=0.00 && rpow_strength <= 1.00,"RGBAdapt_auto_awb: rpow_strength 0.00 -> 1.00")
spow_strength = Float(Default(spow_strength, 1.00)) # strength arg for spow
Assert(spow_strength>=0.00 && spow_strength <= 1.00,"RGBAdapt_auto_awb: spow_strength 0.00 -> 1.00")
pord = Default(pord, false) # RGBAdapt pord arg
bias_strength = Float(Default(bias_strength, 1.00)) # strength arg for automatic bias_strength
Assert(bias_strength>=0.00 && bias_strength <= 1.00,"RGBAdapt_auto_awb: bias_strength 0.00 -> 1.00")

#---------- Specify the source rectangle under scrutiny

        x = int(Width(clip) * x)
        y = int(Height(clip) * y)
        w = int(-Width(clip) * w)
        h = int(-Height(clip) * h)
       
#--------- RGB color space process       

RGB_clip = (!isRGB(clip)) ? ConvertToRGB24(clip, matrix=matrix) : clip

#--------- AWB process       

ScriptClip(RGB_clip, """

#---------- First pass :  gain process for each channel

        RT_RgbChanStats( RGB_clip, x = x, y = y, w = w, h = h, threshold = threshold, chan = -1, flgs = 1+2+4+16)
       
        # ------ detection BlankClip and condition to avoid division by 0           
       
        blanklip = RCS_MinMaxDiff_0 + RCS_MinMaxDiff_1 + RCS_MinMaxDiff_2   
       
RCS_MinMaxDiff_0 = Max (RCS_MinMaxDiff_0, 0.01) RCS_MinMaxDiff_1 = Max (RCS_MinMaxDiff_1, 0.01) RCS_MinMaxDiff_2 = Max (RCS_MinMaxDiff_2, 0.01)
               
        #---- gain process
               
        r_gain = 1 - (1 - float(255.0/RCS_MinMaxDiff_0)) * gain_strength
        r_bias = - RCS_Min_0 * r_gain * gain_strength
                                                 
        g_gain = 1 - (1 - float(255.0/RCS_MinMaxDiff_1)) * gain_strength
        g_bias = - RCS_Min_1 * g_gain * gain_strength
       
               
        b_gain = 1 - (1 - float(255.0/RCS_MinMaxDiff_2)) * gain_strength
        b_bias = - RCS_Min_2 * b_gain * gain_strength
       
        #---- cont process
       
        # Cont is dangerous, because it can overshoot light and dark, but it is necessary to help to find good correction for very big
        # color cast. Thus bool auto_cont arg enable a automatic weighted autocont stength. I observe that picture do'nt need contraste is
        # picture, which have a large histogram, which have min value near 0 et max value near 255, which have bigger min max diff value.
        # But not it is simple, sometime the automatic weigthed autocont stength must be desable.
       
        r_cont = (!auto_cont) ? 1 - (1 - r_gain) * cont_strength : 1 - (1 - r_gain) * cont_strength * (255.0 - RCS_MinMaxDiff_0)/255.0
        r_cont_max = RCS_Max_0 * r_gain + r_bias + (r_cont - 1) *(RCS_Max_0 - 128)
       
        g_cont = (!auto_cont) ? 1 - (1 - g_gain) * cont_strength : 1 - (1 - g_gain) * cont_strength * (255.0 - RCS_MinMaxDiff_1)/255.0
        g_cont_max = RCS_Max_1 * g_gain + g_bias + (g_cont - 1) *(RCS_Max_1 - 128)

        b_cont = (!auto_cont) ? 1 - (1 - b_gain) * cont_strength : 1 - (1 - b_gain) * cont_strength * (255.0 - RCS_MinMaxDiff_2)/255.0
        b_cont_max = RCS_Max_2 * b_gain + b_bias + (b_cont - 1) *(RCS_Max_2 - 128)
       
        r_cont_bias = (!auto_cont) ? (255 - r_cont_max) * cont_strength : \
                                              (255 - r_cont_max) * cont_strength * (255.0 - RCS_MinMaxDiff_0)/255.0 
        g_cont_bias = (!auto_cont) ? (255 - g_cont_max) * cont_strength : \
                                              (255 - g_cont_max) * cont_strength * (255.0 - RCS_MinMaxDiff_1)/255.0
        b_cont_bias = (!auto_cont) ? (255 - b_cont_max) * cont_strength : \
                                              (255 - b_cont_max) * cont_strength * (255.0 - RCS_MinMaxDiff_2)/255.0
       
        #------------ gain and cont in RGBadapt args range     
       
        r_gain = Min (8.0, Max (r_gain, -8.0))
        g_gain = Min (8.0, Max (g_gain, -8.0))
        b_gain = Min (8.0, Max (b_gain, -8.0))
       
        r_cont = Min (8.0, Max (r_cont, -8.0))
        g_cont = Min (8.0, Max (g_cont, -8.0))
        b_cont = Min (8.0, Max (b_cont, -8.0))                                     
                                                     
        r_bias = r_bias + r_cont_bias
        r_bias = Min (512.0, Max (r_bias, -512.0))
        g_bias = g_bias + g_cont_bias
        g_bias = Min (512.0, Max (g_bias, -512.0))
        b_bias = b_bias + b_cont_bias
        b_bias = Min (512.0, Max (b_bias, -512.0))
       
#---------- gamma curves corrections process in accordance with gray world theory
         
    #----------- RGB values calculation
     
      r_gain_cont_ave = RCS_Ave_0 * r_gain + r_bias + (r_cont - 1) *(RCS_Ave_0 - 128)
      g_gain_cont_ave = RCS_Ave_1 * g_gain + g_bias + (g_cont - 1) *(RCS_Ave_1 - 128)       
      b_gain_cont_ave = RCS_Ave_2 * b_gain + b_bias + (b_cont - 1) *(RCS_Ave_2 - 128)       
         
    #----------- RGB gamma corrections values calcul
             
        # In gray world theory, in YUV range, we increase or decrease average value to ref = 128.0, but in RGB range
        # average of channel average values is better, with average of channel average value after gain process the
        # picture ligth is better
       
        # In gamma process, to incresae or decrease average value, we use gamma args. To find this gamma args, we
        # solve this equation ref = pow(average value/255.0,1/gamma args)
       
   # Gamma corrections are calculated with gain output, because is more refine than calculated with gain and cont output
       
        ref = (RCS_Ave_0 * r_gain + r_bias + RCS_Ave_1 * g_gain + g_bias + RCS_Ave_2 * b_gain + b_bias)/3.0

        r_rpow = 1 + (log((RCS_Ave_0 * r_gain + r_bias)/255.0)/log(ref/255.0) -1) * rpow_strength
        r_rpow = Min (4.0, Max (r_rpow, 0.1))
        g_rpow = 1 + (log((RCS_Ave_1* g_gain + g_bias)/255.0)/log(ref/255.0) - 1) * rpow_strength
        g_rpow = Min (4.0, Max (g_rpow, 0.1))
        b_rpow = 1 + (log((RCS_Ave_2 * b_gain + b_bias)/255.0)/log(ref/255.0) -1) * rpow_strength
        b_rpow = Min (4.0, Max (b_rpow, 0.1))
                     
    #-----------  RGB correction with spow curve calcul

    #------- Spow process is enable in default mode, spmid and pord args default values increase
    #------- rpow process action, thus we get more color saturation but also more dark aeras.
    #------- Spow for rpow is like contrast for gain. Thus i use the same factor to get automatic
    #------- weigthed spow arg
       
       r_spow = (!auto_spow) ? 1 - (1 - 1/r_rpow) * spow_strength : \
                               1 - (1 - 1/r_rpow) * spow_strength * (255.0 - RCS_MinMaxDiff_0)/255.0
       r_spow = Min (4.0, Max (r_spow, 0.1))                                                                             
       g_spow = (!auto_spow) ? 1 - (1 - 1/g_rpow) * spow_strength : \
                               1 - (1 - 1/g_rpow) * spow_strength * (255.0 - RCS_MinMaxDiff_1)/255.0
       g_spow = Min (4.0, Max (g_spow, 0.1))   
       b_spow = (!auto_spow) ? 1 - (1 - 1/b_rpow) * spow_strength : \
                               1 - (1 - 1/b_rpow) * spow_strength * (255.0 - RCS_MinMaxDiff_2)/255.0
       b_spow = Min (4.0, Max (b_spow, 0.1))                                     
       
       r_spmid = (r_spow == 1.0) ? 0.5 : (RCS_Ave_0 * r_gain + r_bias)/255.0
       r_spmid = Min (0.99, Max (r_spmid, 0.01))
       g_spmid = (g_spow == 1.0) ? 0.5 : (RCS_Ave_1* g_gain + g_bias)/255.0
       g_spmid = Min (0.99, Max (g_spmid, 0.01))
       b_spmid = (b_spow == 1.0) ? 0.5 : (RCS_Ave_2 * b_gain + b_bias)/255.0
       b_spmid = Min (0.99, Max (b_spmid, 0.01))
           
#---------- bias corrections process in accordance with gray world theory
   
    #----------- RGB bias corrections extraction and calcul
   
RGBAdapt( RGB_clip, \
    R_bias = r_bias, R_Gain = r_gain, R_Cont = r_cont,  R_rpow = r_rpow, R_spow = r_spow, R_SPMid = r_spmid, R_Pord = pord,\
     G_bias = g_bias, G_Gain = g_gain, G_Cont = g_cont, G_rpow = g_rpow, G_spow = g_spow, G_SPMid = g_spmid, G_Pord = pord,\
     B_bias = b_bias, B_Gain = b_gain, B_Cont = b_cont, B_rpow = b_rpow, B_spow = b_spow, B_SPMid = b_spmid, B_Pord = pord)
   
RT_RgbChanStats( LAST, x = x, y = y, w = w, h = h, threshold = threshold, chan = -1, flgs = 16)
     
     ref = (RCS_Ave_0 + RCS_Ave_1 + RCS_Ave_2)/3.0 # in RGB range ref is better 128.0 for Gray world theory correction
   
     dr = ref - RCS_Ave_0
     dg = ref - RCS_Ave_1
     db = ref - RCS_Ave_2

     r_bias = (r_bias + dr * bias_strength)
     r_bias = Min (512.0, Max (r_bias, -512.0))
       
     g_bias = (g_bias + dg * bias_strength)
     g_bias = Min (512.0, Max (g_bias, -512.0))
       
     b_bias = (b_bias + db * bias_strength)
     b_bias = Min (512.0, Max (b_bias, -512.0))
                                               
RGBAdapt( RGB_clip, \
    R_bias = r_bias, R_Gain = r_gain, R_Cont = r_cont,  R_rpow = r_rpow, R_spow = r_spow, R_SPMid = r_spmid, R_Pord = pord,\
     G_bias = g_bias, G_Gain = g_gain, G_Cont = g_cont, G_rpow = g_rpow, G_spow = g_spow, G_SPMid = g_spmid, G_Pord = pord,\
     B_bias = b_bias, B_Gain = b_gain, B_Cont = b_cont, B_rpow = b_rpow, B_spow = b_spow, B_SPMid = b_spmid, B_Pord = pord)
     
(blanklip == 0) ? RGB_clip : last

#----------- variables strings are tuned in global mode for data display in following ScriptClip

global r_args = (!show_info)? nop : \
RT_String("\\n                     R_bias : %s      R_gain : %s      R_cont : %s  \\n                     R_rpow : %s          R_spow : %s    R_spmid : %s",\
                      string(r_bias), string(r_gain), string(r_cont), string(r_rpow), string(r_spow), string(r_spmid),esc =1)
global g_args = (!show_info)? nop : \
RT_String("\\n                     G_bias : %s      G_gain : %s      G_cont : %s  \\n                     G_rpow : %s         G_spow : %s    G_spmid : %s",\
                      string(g_bias), string(g_gain), string(g_cont), string(g_rpow), string(g_spow), string(g_spmid),esc =1)
global b_args = (!show_info)? nop : \
RT_String("\\n                     B_bias : %s      B_gain : %s      B_cont : %s  \\n                     B_rpow : %s         B_spow : %s    B_spmid : %s",\
                      string(b_bias), string(b_gain), string(b_cont), string(b_rpow), string(b_spow), string(b_spmid),esc =1)                                           

return last """, args = "RGB_clip, show_info, x, y, w , h, gain_strength, threshold, auto_cont, cont_strength, auto_spow, rpow_strength, spow_strength,"+\
                                    "pord, bias_strength")
                                     
#--------- datas display process       
                                     
(!show_info) ? last :\
ScriptClip(last, """

#--------- start RGB values extraction for display

        RT_RgbChanStats( RGB_clip, x = x, y = y, w = w, h = h, threshold = threshold, chan = -1, flgs = 1+2+4+16)
        start_ave = (RCS_Ave_0 + RCS_Ave_1 + RCS_Ave_2)/3.0
        r_start = RT_String("\\nDeparture :  Average : %s    Min/max : %s             Min : %s    Max : %s",\
                   string(RCS_Ave_0), string(RCS_MinMaxDiff_0), string(RCS_Min_0), string(RCS_Max_0),esc =1)
        g_start = RT_String("\\nDeparture :  Average : %s    Min/max : %s             Min : %s    Max : %s",\
                   string(RCS_Ave_1), string(RCS_MinMaxDiff_1), string(RCS_Min_1), string(RCS_Max_1),esc =1)
        b_start = RT_String("\\nDeparture :  Average : %s    Min/max : %s             Min : %s    Max : %s",\
                   string(RCS_Ave_2), string(RCS_MinMaxDiff_2), string(RCS_Min_2), string(RCS_Max_2),esc =1)           
       
#--------- final RGB values extraction for display

       RT_RgbChanStats( last, x = x, y = y, w = w, h = h, threshold = threshold, chan = -1, flgs = 1+2+4+8+16)
       
        r_end = RT_String("\\nFinish       :  Average : %s     Min/max : %s             Min : %s    Max : %s",\
                   string(RCS_Ave_0), string(RCS_MinMaxDiff_0), string(RCS_Min_0), string(RCS_Max_0),esc =1)
        g_end = RT_String("\\nFinish      :  Average : %s     Min/max : %s             Min : %s    Max : %s",\
                   string(RCS_Ave_1), string(RCS_MinMaxDiff_1), string(RCS_Min_1), string(RCS_Max_1),esc =1)
        b_end = RT_String("\\nFinish      :  Average : %s     Min/max : %s             Min : %s    Max : %s",\
                   string(RCS_Ave_2), string(RCS_MinMaxDiff_2), string(RCS_Min_2), string(RCS_Max_2),esc =1)
               
#-------- display           

Subtitle("channels averages average : " + string(start_ave)+\
         "\n\n" + "Red values : " + r_start + r_args + r_end +\                     
         "\n\n" + "Green values : " + g_start + g_args + g_end+\
         "\n\n" + "Blue values : " + b_start + b_args + b_end+\                                               
         "\n\n" + "channels averages average : " + string((RCS_Ave_0 + RCS_Ave_1 + RCS_Ave_2 )/3)\
            ,y = 20, lsp = 20, text_color = $00FFFF00, halo_color = $00000000, size = float(height()/32.0))                       
                       
return last """, args = "RGB_clip, x, y, w , h, threshold")                                     

#-------- display scrutinized aera

        scrutinized_green = (!show_scrutinized)? nop : BlankClip(RGB_clip, width = (Width(last)-x+w), height = (Height(last)-y+h), color=$00FF00)
        scrutinized_white = (!show_scrutinized)? nop : Blankclip(RGB_clip, width = (Width(last)-x+w), height = (Height(last)-y+h), color=$FFFFFF)
        scrutinized_int = (!show_scrutinized)? nop : Blankclip(RGB_clip, width = (Width(scrutinized_white)-4), height = (Height(scrutinized_white)-4),\
                                                                                                                color=000000)
       
        scrutinized_mask = (!show_scrutinized)? nop : Overlay(scrutinized_white, scrutinized_int, x=2, y=2, opacity=1.0, mode="multiply", greymask=true,\
                                                                                    ignore_conditional=false, pc_range=false)
       
        scrutinized = (!show_scrutinized)? nop : Overlay(last, scrutinized_green, mask = scrutinized_mask, x=x, y=y, opacity=1.0, mode="blend", greymask=true,\
                                                                                            ignore_conditional=false, pc_range=false)

(!show_scrutinized)? last : scrutinized

#--------- End of RGB color space process

!isRGB(clip) ? ConvertToYV12(last, matrix=matrix) : last                                     
                                                                                                                         
}

Отредактировано dan74 (16-12-2019 06:16:53)

24

# очистка от пыли,царапин
RemoveDirtMC(40,false)

dan74, скажите пожалуйста, какая версия фильтра у Вас установлена и какая версия Ависинта?
У меня Ависинт 2.6, но этот фильтр, скачанный с оф.сайта, почему-то не загружается.
dll-кой не поделитесь?

25

У меня Ависинт 2.6

Пожалуйста   -   https://yadi.sk/d/e5kNYP94JyOQ7g

Скрипт скачал отсюда, всё работает.

https://forumupload.ru/uploads/0018/29/2a/13/t48129.jpg

Отредактировано dan74 (28-01-2021 05:32:39)

26

фильтр чистки - RemoveDirt 0.9

порядок установки Ависинт и прочего   -
https://forumupload.ru/uploads/0018/29/2a/13/t364889.jpg

Отредактировано dan74 (28-01-2021 06:43:40)

27

Скрипты для очистки в наборе.

28

dan74, спасибо за богатый подарок!
Буду разбираться.

29

Что-то не получается у меня пока этот фильтр запустить.
Дело в том, что Ависинт у меня уже стоит, и немного в другой папке.
Путь к плагинам получается такой:
LoadPlugin("C:\Video\AviSynth 2.5\Plugins\RemoveDirtS.dll")
Ставить вторую версию Ависинта как-то боязно, неизвестно, как они между собой дружить будут...
И какая версия будет скрипты открывать.

30

GreifeR
Удаляйте свою Ависинт, ни чего страшного не будет. И ставьте как я писал, в какие пути.  И не забывайте папку Ависинта назвать -  AviSynth 2.5https://forumupload.ru/uploads/0018/29/2a/13/t133219.jpg

31

dan74, а у Вас в какой ОС это всё работает?

32

GreifeR написал(а):

dan74, а у Вас в какой ОС это всё работает?

Во всех - от 7ки до 10ки.

33

Простой скрипт очистки шума -

https://forumupload.ru/uploads/0018/29/2a/13/t135323.jpg

------------------------------------------------------------------
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DeGrainMedian.dll") # загружаем плагин

AVISource("C:\Users\ZZZZZZ\Desktop\99.avi")

FadeIn(10)

DeGrainMedian(mode=1, interlaced=true, limitY=3, limitUV=5)

RemoveDirtMC(40,false)
----------------------------------------------------------------

Отредактировано dan74 (24-02-2021 14:50:58)

34

dan74
Добрый день ! Надеюсь Вы ещё на форуме.
Не могли бы Вы дать несколько уроков по AviSynth, а то не получается вообще что то ничего ...
Я имею ввиду соединиться по любой сети, вайбер, вацап, телеграмм. Где есть микрофон и соедениться с моим компом по удалёнке.
Провести несколько уроков наглядно.
Очень хочется достичь результатов по фильтрации изображения

35

Алексей
Приветствую!  Предыдущие посты  -5-26-30 выполнены как описано? Что то запускается?

36

dan74 написал(а):

Предыдущие посты  -5-26-30 выполнены как описано? Что то запускается?

Добрый день ! Да, делаю всё как написано. У меня винь 10-64 бит
Что получается на скринах, пока просто попытка открыть файл, пробую так сказать
https://forumupload.ru/uploads/0018/29/2a/230/t285780.png
https://forumupload.ru/uploads/0018/29/2a/230/t503626.png
https://forumupload.ru/uploads/0018/29/2a/230/t581274.png

37

После этой попытки, был собран новый комп с нуля на винь 7-32 бита
Ну тоже пока без успеха
Правда может фреймворк надо с версии 1.1 поставить
https://forumupload.ru/uploads/0018/29/2a/230/t941965.png
https://forumupload.ru/uploads/0018/29/2a/230/t500293.png
https://forumupload.ru/uploads/0018/29/2a/230/t230426.png

38

Алексей
В этом ависинте столько подводных камней, я тоже самоучка.Поэтому тяжело что то подсказать. Ставлю Вин 10 компакт, тоже ошибки пишет.Ставлю полную версию,всё работает.
То бывает пишет ошибку "не могу найти файл - Previev.avs, хотя он есть.
По Вашему случаю - K-Lite_Codec_Pack_820_Full.exe    ставили?  Винду лучше конечно 10 64бита.  И прямо по порядку ставить и прописать всё как я выше скрин показывал пост 26.

39

он пишет что кодека нет, формат DV стандартного разрешения

40

Алексей написал(а):

dan74
Добрый день ! Надеюсь Вы ещё на форуме.
Не могли бы Вы дать несколько уроков по AviSynth, а то не получается вообще что то ничего ...

Для желающих освоить AviSynth  "с нуля" открыта специальная тема: AviSynth - ликбез


Вы здесь » "Кинопередвижка" Форум любителей и коллекционеров плёночного кино. » AviSynth » Обработка отсканированного материала с помощью AviSynth