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
(2018-02-05, 07:46 AM)random.next Wrote: >then change the resolution (vertical and/or horizontal) until they align perfectly (for example, 1924x1080, or 1916x1072 etc) - try also 1pixel variation, using YV24
Use aspectRatio params instead. And angle params for rotation (range -1 to 1 for beginning) . Aspect ratio is width divided to height.
If your over!ay resolution is 1920x800 then both aspectRatio params are equal to 2.4 by default. Set range instead of fixed default value: aspectRatio1=2.3 and aspectRatio2=2.5. Extend range if necessary. After testing leave minimal appropriate range.
Hi random, I have studied and tested your magic script for a several days, you did a great job, thank you.
I'm going to merge 2 clips with your autooverlay tools, here is my working environment: 
win7, avs+ r2728, autooverlay 2.5
video1:1920x1080, with logo
video2:1920x1080, no logo
now I plan to get video2 overlay on video1
but question is, although both clips have the same resolution, but infact, video2 (look like 1924x1084 content resized to 1920x1080) has little more larger picture than video1, it has screwed me for a long days for modifing and testing the avs script round and round, until saw your this post, the aspectratio params was very helpful, finally, I got them align perfectly, thanks for your guidance.
for now, I would like to ask 2 questions for my curiousness happen on trying this fantasy script:
1, how to set the minOverlayArea and minSourceArea properly in my situation(reference for info above)?  what's the design purpose of these params?
2, to remove the logo, it seem to overlayrender function can't finish the job alone, still need overlay function assist, right? if so what's the best choice for overlay and mt_merge? overlay need to convert the 2 clips to yv24 internally, but mt_merge no need to do it.
Reply
Thanks given by:
First you need to make mask image for video1. It is black and white image where logo is poor black. It is good practice to add some gradient around the logo. You should use it as sourceMask in the OverlayEngine. Note that by default all YUV clips are in limited color range in Avisynth. So it must be converted to PC range. Example:
mask=ImageSource("M:\...\mask.png", pixel_type="Y8").ColorYUV(levels="TV->PC").Trim(999,999)
OverlayEngine(... sourceMask=mask...)
Mask clip tells OverlayEngine to exclude logo area from image comparison to provide better alignment.

After that if sources are stabilized to each other (have the same align settings for all frames) you should use StaticOverlayRender without OverlayEngine with align settings that you could take from your previous script with engine and OverlayRender(...debug=true). Or if they are not stablized then use OverlayRender.

As for your questions.
1. For your explanation overlayArea is about (1920x1080)/(1924x1084). I don't exatly know what videos are you use so try to set both params to 95.
2. To hide logo you should use your mask clip with internal Overlay filter after OverlayRender.
Reply
Thanks given by: iwil
(2018-09-19, 07:10 PM)random.next Wrote: First you need to make mask image for video1. It is black and white image where logo is poor black. It is good practice to add some gradient around the logo. You should use it as sourceMask in the OverlayEngine. Note that by default all YUV clips are in limited color range in Avisynth. So it must be converted to PC range. Example:
mask=ImageSource("M:\...\mask.png", pixel_type="Y8").ColorYUV(levels="TV->PC").Trim(999,999)
OverlayEngine(... sourceMask=mask...)
Mask clip tells OverlayEngine to exclude logo area from image comparison to provide better alignment.

After that if sources are stabilized to each other (have the same align settings for all frames) you should use StaticOverlayRender without OverlayEngine with align settings that you could take from your previous script with engine and OverlayRender(...debug=true). Or if they are not stablized then use OverlayRender.

As for your questions.
1. For your explanation overlayArea is about (1920x1080)/(1924x1084). I don't exatly know what videos are you use so try to set both params to 95.
2. To hide logo you should use your mask clip with internal Overlay filter after OverlayRender.



thanks for your kindly reply, 
I had tried to adjust the "minoverlayarea" param to 50, according your this post:

(2018-02-02, 03:08 PM)random.next Wrote: Try OverlayConfig.minOverlayArea about 50 and properly crop source clip.

after do that, I found the debug info for diff value has been droped to 3.x from 4.x, it show that it works?

but if the "minoverlayarea" param was adjusted to higher than 50,  80 etc. then the diff value will be raised to 4.x, it seem it was a worse setting?

I assumed that lower diff value mean to better align result, is that right?
Reply
Thanks given by:
>I assumed that lower diff value mean to better align result, is that right?
Did you read the readme?
Reply
Thanks given by:
I may have a misunstanding about the diff value, would you explain it more here?
Reply
Thanks given by:
Diff value is the root-mean-square error (RMSE) calculated from tested image intersection: https://en.wikipedia.org/wiki/Root-mean-..._deviation
PSNR (widely used in image processing) is based on and inversaly proportional to the RMSE: https://en.wikipedia.org/wiki/Peak_signa...oise_ratio
Reply
Thanks given by:
So, resizing in the automatic mode happend only with the save of the aspect of overlay source?
But In the editor I can change it without saving the aspect (uncheck box).
Reply
Thanks given by:
(2018-10-09, 07:25 AM)tonik2000 Wrote: So, resizing in the automatic mode happend only with the save of the aspect of overlay source?
You should use aspectRatio params to set aspect ratio range.
Reply
Thanks given by:
How do I get rid of artifacts that occur after color adjustment?
[Image: e24ccffcb04a8ed341f8c53ce59e7227.jpeg] [Image: 2e1e5e33cf1c332aaa1f47345cc614b2.jpeg] [Image: 3ad4cdb81ebbf74da9a0415b12894633.jpeg]
Quote:If you want also combine it with open matte (3 sources) then firstly merge the two of them as usual and overlay the third with mask of previous two by OverlayRender.mode=6.
Write please in more details. I'm doing something wrong: Error requesting frame 0. Resize: Planar destination height must be a multiple of 2.
Reply
Thanks given by:
@random.next

I encounter a problem that when your plugin is loaded/in the plugin directory, I am unable to reload an avs file in VirtualDub. It hangs forever/freezes. Anything you can do about that? Only workaround at this moment is to close VirtualDub and open the avs file again.
Reply
Thanks given by:


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

Forum Jump:


Users browsing this thread: 40 Guest(s)