View Single Post
Old 4th April 2011, 01:47   #4  |  Link
Mini-Me
Registered User
 
Join Date: Jan 2011
Posts: 121
Quote:
Originally Posted by Gavino View Post
I don't yet fully understand how your code is designed to work, but are you sure the recursion bottoms out?

Basically, the recursion occurs in the functions StabilizeClockwise and StabilizeCounterclockwise:

Perhaps it should be using bestandedgeswoven on the recursive call?
Good catch! I had an infinite loop, and fixing it makes the script work! The results are excellent, but I'll still tweak the combing measurement for further improvement. It also seems a lot faster than my previous version. Even though I have some other stuff running, I'm getting ~10.5 FPS on average, whereas my original implementation yielded about ~3.7 FPS. Thank you so much!

I think I need to pass the recursion level as a parameter though and put a limit on it. Ordinary frames seem to be going quite fast, but it's taking too long to find the nonexistent "sweet spot" for the garbage frames at the beginning of the capture.

Quote:
Originally Posted by Gavino View Post
What you are doing is slightly different, in that you are calling (G)ScriptClip itself recursively. I think this should work, but perhaps it's inefficient and unnecessary. Because of the ability to call runtime functions (eg AverageLuma) directly from a user function, you don't need to wrap the inner call inside ScriptClip or ConditionalFilter, as long as the function itself is called inside ScriptClip. But that would involve a redesign of your outer level function so that ScriptClip is called only once and all the recursion takes place inside it.
I'll refactor it as you suggest for clarity and efficiency and see if it gets any faster. Thanks for the advice! UPDATE: The refactored version works as well, but it's a bit slower at the moment. Instead of ~10.5 FPS average, the refactored version gets ~8.6 FPS average. I'll have to keep working on this.

I know there are some other threads where posters needed something like this, so once I have the script "release ready," I'll create a new thread and officially "publish" it for use under the GPL. In the meantime, I'll fix the infinite loop above script in case anyone could use it ASAP.

Last edited by Mini-Me; 4th April 2011 at 03:18.
Mini-Me is offline   Reply With Quote