COP Feedback?

   16478   22   4
User Avatar
Member
19 posts
Joined: Feb. 2006
Offline
Hi guys,
Does anyone know if it's possible to rig up a feedback loop inside a compositing network? I basically want it to do something like this:

new image = previous image + 0.75 * input

I'm trying to get that old additive video feedback effect that used to be so popular in the 70's!

Cheers

Andy
User Avatar
Member
401 posts
Joined:
Offline
maybe via chops?
Or rather a timewarp …

Sounds interesting.

But it might be a little more difficult than this:
The typical analog feedback loop also slides slowly to the left.

Georg
this is not a science fair.
User Avatar
Member
19 posts
Joined: Feb. 2006
Offline
Thanks. I'll check out timewarp.

Could you elaborate about how chops would work in conjunction with cops? Not sure how to do that!

Andy
User Avatar
Member
1390 posts
Joined: July 2005
Offline
Check timefilter COP! you can also tweak a bit its VEX code if you don't like result which is filtered similar to motion blur (its nice but not very ghost-like).

done it onces but can't find result now.

cheers,
sy.
User Avatar
Member
69 posts
Joined: July 2007
Offline
I do not think any cop will allow you to do what you want directly.
It seems to me that if you are doing a series of images what you need to do is reload the previous image from the harddrive composie the new image and save.
Repeat as needed.
You may want to have an initial image on the drive before starting so that you have something to load.
this should give you what you want.
User Avatar
Member
401 posts
Joined:
Offline
fxnut
Thanks. I'll check out timewarp.

Could you elaborate about how chops would work in conjunction with cops? Not sure how to do that!

Andy

I think you can fetch a cop into chops.
But this was just a guess.

As Darg_ego said It might be a tedious task to reproduce this. You would need a lot of sample footage or even better a analog video mixer to analyse the effect.

there are 1000 ways how such a feed back can look like:
http://www.preset.de/filme/projektor/kingKobra/ [preset.de]

this is video feedback, too.

Maybe take a look at VJsoftware they maybe have such effects build in.

Georg
this is not a science fair.
User Avatar
Member
19 posts
Joined: Feb. 2006
Offline
Dark_Ego
It seems to me that if you are doing a series of images what you need to do is reload the previous image from the harddrive composie the new image and save.

Yep, that seems to be the only way to go as far as I can see.

Thanks for the other suggestions though. I tried the timefilter, but it only pulls in frames surrounding the current frame. I guess I could configure it to pull in all previous frames, but I reckon it'd be a little slow! Plus I'd need to put in my own filter and I'm not sure how to do that.

Thanks again for the help

Andy
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Then you want TIMA!

The Time Machine COP might be the answer. It takes a sequence of images on the left and an image on the right of the same resolution to warp time.

To do what you want, just use a Color COP set to a gray value of 0.75 set to the same resolution as your image sequence.
Set the Black Pixel Frame to -2 and the White Pixel Frame to 1.

It gets real fun when you have an animation on the right as well and you increase the Black and White pixel frame parms to larger values. Careful as you have to have all the frames in memory.

Attachments:
tima.hip (32.4 KB)

There's at least one school like the old school!
User Avatar
Member
401 posts
Joined:
Offline
looks cool but crashes my too old h9 build.

I think I get my mx10 from the attic now.

Thanks for this.

Georg
this is not a science fair.
User Avatar
Member
1390 posts
Joined: July 2005
Offline
fxnut
Thanks for the other suggestions though. I tried the timefilter, but it only pulls in frames surrounding the current frame. I guess I could configure it to pull in all previous frames, but I reckon it'd be a little slow! Plus I'd need to put in my own filter and I'm not sure how to do that.
Thanks again for the help
Andy

It's enough to put expression to Filter Width like: “$F” . Time Filter COP will compose than all frames from the beginning. This gonna be slow - that's clear. Unfortunately TimeFilterCOP averages pixel values (divides pixel value by number of frames mixed) so the more frames you mix the less you will see.

I can send you VOP network which mimics timefilter (without pixel filtering) and gives you control on mixing mode (possibly without averages). This could be extended of course - since adding don't have to be the best way of composing pixels. One can want to screen, over, or what so ever. And this can b done in vops also with simple channel math.

These filters are slow because they loop pixel by pixel. I wonder it there is a way to do it plate by plate. As I assume it's can't be done in VOPs, as they loop through pixel by definition (like geo vops in SOPs context do with points), right?


So maybe can do this hard coded - by hand - with a smart script - what could be, paradoxically, faster!
User Avatar
Member
19 posts
Joined: Feb. 2006
Offline
I think what I need is some way to store a frame in memory so that I can persist it between rendered frames. I've not had much success yet with saving the file to disc, but I'll let you guys know if I do get something that works.

Incidentally, the equation I wrote in my first post was wrong, I originally wrote this:

new image = previous image + 0.75 * input

when it should have been this instead:

new image = (0.75*previous image) + input

Doing it this way, the old images fade off automatically to black so you get left with this awesome streaking effect that trails off.

As far as I can see, TimeMachine COP (which sounds suspiciously like a reference to a Jean-Claude Van Damme movie :wink won't achieve this as it seems to just do the same as the TimeFilter COP but on a per-pixel basis. It's cool, but not what I'm after! Thanks for the suggestion though Jeff.

I'm hoping that it isn't necessary to load all the frames into memory at once - that's the whole point of using feedback - it's a two-image process and should be pretty fast. I just need to figure out how to implement it inside Houdini's way of working.

Andy
User Avatar
Member
19 posts
Joined: Feb. 2006
Offline
Okay, I think I can get this to work by rendering to disc and reloading that rendered image for use in the next frame. (See attached image)

The only problem is that I don't think the File COP is noticing the new files that get rendered. I'm guessing that I need to effectively press the “Reload Sequence” button after every frame that's rendered so that it loads the newly rendered frame.

I noticed that the ROP File Output COP has a “Post-Frame” script event that I may be able to use to do this. Does anyone have any idea how I can use it to trigger the File COP to recognise the new image that's just been saved?

Thanks

Andy

Attachments:
Feedback.gif (5.5 KB)

User Avatar
Member
1390 posts
Joined: July 2005
Offline
Are you going to do this by hand!?
This is really not necessary!

Give me a second!

EDIT:



Are you talking about this effect?
User Avatar
Member
19 posts
Joined: Feb. 2006
Offline
Yep! That looks like what I'm after. C'mon… spill the beans


Actually, not exactly. It looks like you've got like an “over” mode being applied there. I'm after an additive composite. Otherwise, it's spot on.
User Avatar
Member
1390 posts
Joined: July 2005
Offline
ok,
I made it really fast. There are some problems with it, namely it won't work in first one or two frames. Not sure why, but maybe we can live with it for a while.
(actually I suspect that it doesn't work because of iterate-frame-math. If you check TimeFilterCOP Vex code you will see that frame increment stuff takes bigger part of the code. I've just tried to do something fast.

OTL and example included.
There are ADD, OVER and SCREEN mode.
Frame range, Frame Step, and Initial frame option.
Fade off (your multiplication) in loop and globally.

Note: You should probably manually compose original image over output of this operator.

Tested on H8.1, WinXP

hope this help,
cheers,
sy.

EDIT:
see bellow for a faster version
Edited by - Aug. 4, 2007 10:57:37
User Avatar
Member
19 posts
Joined: Feb. 2006
Offline
Heh! Yeah, cool, that gets the look for sure. Thanks for taking the time to put that together for me, I appreciate it.

The only problem was that it took ages to calculate an image like the one below - too many frames I guess! So I'm still interested to know if it's possible to do the post-frame script thingy if anyone has any ideas.

Andy

Attachments:
Feedback2.jpg (27.6 KB)

User Avatar
Member
1631 posts
Joined: July 2005
Offline
Hey Andy,
fxnut
Okay, I think I can get this to work by rendering to disc and reloading that rendered image for use in the next frame. (See attached image)

The only problem is that I don't think the File COP is noticing the new files that get rendered. I'm guessing that I need to effectively press the “Reload Sequence” button after every frame that's rendered so that it loads the newly rendered frame.

I noticed that the ROP File Output COP has a “Post-Frame” script event that I may be able to use to do this. Does anyone have any idea how I can use it to trigger the File COP to recognise the new image that's just been saved?

Thanks

Andy
You can use the “opparm -c” command to do what you want. For example, in the post frame script parameter:
opparm -c /img/img1/file1 reload

To learn more about opparm, type help opparm in the textport.

Cheers!
steven
User Avatar
Member
19 posts
Joined: Feb. 2006
Offline
Thanks, that sounds like it's exactly what I need. I'll try it out as soon as I get back to my desk next week.


BTW, I just want to say that it's great how helpful all you guys are here. I'm a relative newcomer to Houdini and I'm loving it, but also the community too. It's really friendly and inclusive which is always a good sign that a piece of software is spreading the love

Keep it up guys. I hope to be able to give something back soon once I figure out all this VEX stuff :wink:

Cheers

Andy
User Avatar
Member
1390 posts
Joined: July 2005
Offline
This is so called “Added Value” of Houdini. Really amazing community!

cheers,
sy.
User Avatar
Member
1390 posts
Joined: July 2005
Offline
ok,
I found some weekend time to get try “ghost like” effect (or feedback if you will) in complete different approach which render pretty fast compared to VOP way.

It's a hack actually and still has some problems but it's quite easy and elegant.

GhostScript HDA creates on-the-fly composition with layer for every frame in range - like you were trying to do by hand.

Well, it works.

cheers,
sy.

PS Cumulative fade has obviously wrong math but I'm leaving it as it is for now. Be sure your image has alpha (even for screen mode) or HDA won't work. You can add just white alpha channel instead of.

EDIT:

Small additions in version 02: blur, a few more composition modes and some cleanings. Still a raw thing.
Edited by - July 29, 2007 07:27:16

Attachments:
ghostScript.zip (37.1 KB)
ghostScript_v02.zip (4.1 KB)

  • Quick Links