Hello guest, if you like this forum, why don't you register? https://fanrestore.com/member.php?action=register (December 14, 2021) x


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AutoOverlay (PKA AutoAlign) discussion
#91
I'm trying to match the sources the best I can.
Ive already done a pass with RE:Match.
Thought a Merge Pass might do it, but Ive had no luck Smile

[Image: Rye.jpg]
Reply
Thanks given by:
#92
A question: is this a quest to find out the right colors of "The Quest"? Big Grin
Reply
Thanks given by: CSchmidlapp
#93
(2018-01-31, 12:26 PM)spoRv Wrote: A question: is this a quest to find out the right colors of "The Quest"? Big Grin

Yes lmao.

Ill explain in full in a relevant thread.

I can not match the DVD(Bottom), BD (Top) perfectly, It's close but the grays look as in the screen shot.
Thought i may be able to use the color and luma information of the DVD and just use the extra detail of the BD Smile
Im color correcting it again anyway in a later passSmile

I'm still experimenting and I'm not to good with AviSynth.

This is an amazing plugin!
Reply
Thanks given by:
#94
I assume you have played around with the coloradjust parameter?
Reply
Thanks given by:
#95
(2018-01-31, 12:47 PM)TomArrow Wrote: I assume you have played around with the coloradjust parameter?

Yes bud.
None of the options in that parameter worked.
Reply
Thanks given by:
#96
Matrix parameter and RGB clips in OverlayRender may cause wrong color adjustment. Use ConvertToYV24 insted of ConvertToRGB24 to adjust only luma channel with histogram matching.
To change chroma offset you could use function before overlay render:
clip2adjust=clip2adjust.AdjustColor(clip2adjust, referenceClip, false, true, 2, 1, false)
Code:
function AdjustColor(clip input, clip sample, clip reference, bool luma, bool chroma, int tr, float maxDiff, bool debug)
{
   global sample1=sample
   global reference1=reference
   return input.ScriptClip("
       tr = " + string(tr) + "
       maxDiff = " + string(maxDiff) + "
       luma = " + string(luma) + "
       chroma = " + string(chroma) + "
       debug = " + string(debug) + """
       
       count=tr*2 + 1
       lumaMedian=0.0
       chromaMedianU=0.0
       chromaMedianV=0.0
       ownY = reference1.YPlaneMedian() - sample1.YPlaneMedian()
       ownU = reference1.UPlaneMedian() - sample1.UPlaneMedian()
       ownV = reference1.VPlaneMedian() - sample1.VPlaneMedian()
       for ( i = -tr, tr, 1) {
           curY=reference1.YPlaneMedian(i) - sample1.YPlaneMedian(i)
           curU=reference1.UPlaneMedian(i) - sample1.UPlaneMedian(i)
           curV=reference1.VPlaneMedian(i) - sample1.VPlaneMedian(i)
           if (abs(curY-ownY) <= maxDiff || abs(curU-ownU) <= maxDiff || abs(curV-ownV) <= maxDiff) {
               lumaMedian=lumaMedian + curY
               chromaMedianU=chromaMedianU + curU
               chromaMedianV=chromaMedianV + curV
           } else {
               count=count-1
           }
       }
       lumaMedian = luma ? (lumaMedian/count) : 0 #*(255/testMask.AverageLuma())
       chromaMedianU = chroma ? (chromaMedianU/count) : 0
       chromaMedianV = chroma ? (chromaMedianV/count) : 0
       ColorYUV(off_y=round(lumaMedian), off_u=round(chromaMedianU), off_v=round(chromaMedianV))
       if (debug) {
           Subtitle("Y=" + string(lumaMedian) + ", U=" + string(chromaMedianU) + ", V=" + string(chromaMedianV))
       }
   """)
}
Reply
Thanks given by:
#97
Trying to simplify your script. 
Try different MIN_ASPECT_RATIO and MAX_ASPECT_RATIO according to resolution of BD.
Try coloradjust=2 for luma as BD or coloradjust=1 for luma as DVD. 

Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\AvsFilterNet.dll")
LoadNetPlugin("C:\Program Files (x86)\AviSynth\plugins\AutoOverlay.dll")
OM=must be upscaled to HD: 1920x1080 for ex.
WS=AVISource("BD2.avi")                  

# uncomment below to adjust chroma of DVD to BD (and copy-paste function AdjustColor to the end of the script). works only in AviSynth+
#OM=OM.AdjustColor(OM, WS, false, true, 2, 1, false)
                                     
config=OverlayConfig(requiredSampleArea=3000, aspectRatio1=MIN_ASPECT_RATIO, aspectRatio2=MAX_ASPECT_RATIO)

OverlayEngine(OM.ConvertToY8(), WS.ConvertToY8(), configs=config, backwardFrames=5, forwardFrames=8, maxDiff=10)

OverlayRender(OM.ConvertToYV24(), WS.ConvertToYV24(), debug=true, noise=50, upsize="Spline64Resize", gradient=20, noise=80, coloradjust=0)

ConvertToYV12()
Reply
Thanks given by:
#98
(2018-01-31, 04:19 PM)random.next Wrote: Matrix parameter and RGB clips in OverlayRender may cause wrong color adjustment. Use ConvertToYV24 insted of ConvertToRGB24 to adjust only luma channel with histogram matching.
To change chroma offset you could use function before overlay render:
clip2adjust=clip2adjust.AdjustColor(clip2adjust, referenceClip, false, true, 2, 1, false)
Code:
function AdjustColor(clip input, clip sample, clip reference, bool luma, bool chroma, int tr, float maxDiff, bool debug)
{
   global sample1=sample
   global reference1=reference
   return input.ScriptClip("
       tr = " + string(tr) + "
       maxDiff = " + string(maxDiff) + "
       luma = " + string(luma) + "
       chroma = " + string(chroma) + "
       debug = " + string(debug) + """
       
       count=tr*2 + 1
       lumaMedian=0.0
       chromaMedianU=0.0
       chromaMedianV=0.0
       ownY = reference1.YPlaneMedian() - sample1.YPlaneMedian()
       ownU = reference1.UPlaneMedian() - sample1.UPlaneMedian()
       ownV = reference1.VPlaneMedian() - sample1.VPlaneMedian()
       for ( i = -tr, tr, 1) {
           curY=reference1.YPlaneMedian(i) - sample1.YPlaneMedian(i)
           curU=reference1.UPlaneMedian(i) - sample1.UPlaneMedian(i)
           curV=reference1.VPlaneMedian(i) - sample1.VPlaneMedian(i)
           if (abs(curY-ownY) <= maxDiff || abs(curU-ownU) <= maxDiff || abs(curV-ownV) <= maxDiff) {
               lumaMedian=lumaMedian + curY
               chromaMedianU=chromaMedianU + curU
               chromaMedianV=chromaMedianV + curV
           } else {
               count=count-1
           }
       }
       lumaMedian = luma ? (lumaMedian/count) : 0 #*(255/testMask.AverageLuma())
       chromaMedianU = chroma ? (chromaMedianU/count) : 0
       chromaMedianV = chroma ? (chromaMedianV/count) : 0
       ColorYUV(off_y=round(lumaMedian), off_u=round(chromaMedianU), off_v=round(chromaMedianV))
       if (debug) {
           Subtitle("Y=" + string(lumaMedian) + ", U=" + string(chromaMedianU) + ", V=" + string(chromaMedianV))
       }
   """)
}
Thank you again for your help Smile

Changing to 'ConvertToYV24' and the coloradjust=1 parameter helped. But it has introduced the same problems in other shots that we're good using the RGB variant! I went back to the original DVD colours and not the RE:Match grade one as it would be nice to cover everything in one 'go to script'. I am still experimenting though bud and will post my results later Wink

Shot with 'ConvertToYV24' and the coloradjust=1, Original DVD Colours
[Image: R9m.jpg]

Here is where i show my lack of knowledge (and skill) with Avisynth. When I try using AdjustColor it returns with an error code telling me it does not know what it is! Do I copy the 'code' you have posted above into the Avisynth root or something? Or is it only compatible with Avisynth+?


(2018-01-31, 04:29 PM)random.next Wrote: Trying to simplify your script. 
Try different MIN_ASPECT_RATIO and MAX_ASPECT_RATIO according to resolution of BD.
Try coloradjust=2 for luma as BD or coloradjust=1 for luma as DVD. 

Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\AvsFilterNet.dll")
LoadNetPlugin("C:\Program Files (x86)\AviSynth\plugins\AutoOverlay.dll")
OM=must be upscaled to HD: 1920x1080 for ex.
WS=AVISource("BD2.avi")                  

# uncomment below to adjust chroma of DVD to BD (and copy-paste function AdjustColor to the end of the script). works only in AviSynth+
#OM=OM.AdjustColor(OM, WS, false, true, 2, 1, false)
                                     
config=OverlayConfig(requiredSampleArea=3000, aspectRatio1=MIN_ASPECT_RATIO, aspectRatio2=MAX_ASPECT_RATIO)

OverlayEngine(OM.ConvertToY8(), WS.ConvertToY8(), configs=config, backwardFrames=5, forwardFrames=8, maxDiff=10)

OverlayRender(OM.ConvertToYV24(), WS.ConvertToYV24(), debug=true, noise=50, upsize="Spline64Resize", gradient=20, noise=80, coloradjust=0)

ConvertToYV12()

Thanks again, this is great and helps me understand how a script is broke down and functionsSmile

I edited it abit myself (removing .AdjustColor) and a bit of trial and error to the point it was not giving me normal 'script' errors

Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\AvsFilterNet.dll")
LoadNetPlugin("C:\Program Files (x86)\AviSynth\plugins\AutoOverlay.dll")
OM=AVISource("DVD2.avi")
WS=AVISource("BD2.avi")
config=OverlayConfig(requiredSampleArea=3000, aspectRatio1=1920, 1080, aspectRatio2=1920, 1080)
OverlayEngine(OM.ConvertToY8(), WS.ConvertToY8(), configs=config, backwardFrames=5, forwardFrames=8, maxDiff=10)
OverlayRender(OM.ConvertToYV24(), WS.ConvertToYV24(), debug=true, upsize="Spline64Resize", gradient=20, noise=80, coloradjust=1)
ConvertToYV12()

I get this as a render

[Image: R98.jpg]



I tried installing Avisynth+ and none of my scripts would work, on this project or earlier more simple scripts.
It kept telling me it was referencing 64bit.dll files in a 32bit environment and was in error! again this is my lack of skill with Avisynth and I probably need to learn abit more about script writing and the whole Avisynth environment before I proceed Smile
Reply
Thanks given by:
#99
You can try to overlay only luma channel, try OverlayRender.lumaOnly=true and colorAdjust. I think then color adjustment will be clear and good overall quality.
AspectRatio is the float number such as 2.4 or 1.77. Divide width of you overlay clip to height and specify range near this value such as 2.2 and 2.5.

As I said before AdjustColor function needs avisynth+ because it includes loop.
Avisynth+ contains both x86 and x64 dll's. Put x64 one to system32 and x86 to sysWOW64 and have fun.
As I know the latest version contains installer https://github.com/pinterf/AviSynthPlus/...g/r2580-MT
Reply
Thanks given by:
Wizardry bud.

[Image: R9Q.jpg]

Truly amazing plug in. Thanks for the support good sir Smile
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
  home 7.1 releases - general discussion spoRv 7 3,066 2021-10-11, 05:51 PM
Last Post: spoRv
  Recordable blu-ray disc general discussion spoRv 6 7,919 2017-05-20, 11:37 AM
Last Post: spoRv

Forum Jump:


Users browsing this thread: 2 Guest(s)