konstantin magnus Posted August 24, 2015 Share Posted August 24, 2015 (edited) Could anyone please give me some advice on how to program a simple box filter in COPs using python or VEX? Basically calculating the average of every pixel and its immediate surrounding pixels over and over again? I created one in a VOPCOP2filter, but due to the lack of a foreach-node in COPs I cant repeat it multiple times without copying nodes over and over again (see attachment). boxblur.hipnc Edited August 24, 2015 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
Yader Posted August 24, 2015 Share Posted August 24, 2015 I guess you have a good reason not to use the blur node set to box filter? Quote Link to comment Share on other sites More sharing options...
eetu Posted August 24, 2015 Share Posted August 24, 2015 For-loop inside VOPs? Quote Link to comment Share on other sites More sharing options...
magneto Posted August 24, 2015 Share Posted August 24, 2015 You have to loop through samples. Fortunately a lot of COP nodes are written in VEX (I assume by our legendary Mark?) that you can check out to learn how to write your own box blur. I think Radial Blur should be the closest to what you need. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted August 25, 2015 Author Share Posted August 25, 2015 @yader: i solved other tasks with vops and wanted to replace 'premade' nodes by custom ones (mainly for learning reasons, the feeling to know whats happening and for having it done by myself : ) @eetu: afaik for-loops dont loop over the latest result but just over the same input again and again? @magneto: great hint! thank you for the answers! Quote Link to comment Share on other sites More sharing options...
eetu Posted August 25, 2015 Share Posted August 25, 2015 Ah yeah, sorry, I read too fast. I thought you wanted a loop for taking many samples/taps for the blur. For a special case you could set up a feedback loop with file write/read, but it doesn't really suit a general purpose node Or, you could make it an HDA with a few of those VOP nodes inside, but that would of course mean a fixed number of passes.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.