Motion trails that DON'T EVER fade from live feed (Jitter)

    Nov 04 2013 | 12:22 am
    I'm currently working on a project where I'm using Max/Jitter and a Kinect camera (although I'm not using the depth-perception aspect typically associated with the Kinect).
    To briefly describe the project, it basically consists of the Kinect camera mounted on the ceiling that "tracks" people through the space by leaving a motion trail behind the viewer. This live feed, including the motion trail, will be visible to others on a monitor screen from OUTSIDE of the space. There will also be an object directly centered in the camera's view (and the space in which the viewer walks). **When people step into the center, the motion trails will be ERASED, and the people viewing the monitor will witness the space as trail-free for a moment until the person in the space starts moving again. (The patch also saves the last frame before the motion trails are reset to the computer, which forms a photographic archive of all the trails that are made.)
    So, I've been able to figure all of this out– aside from one aspect. *I want the trails to NOT FADE at all (until they are cleared by someone stepping in the center of the frame). I'm using jit.change and jit.slide to achieve the current motion trail that I have in place. I have made the jit.slide last for a while, and turned that function all the way up, using the silde_down attribute. I've set the scale factor for slide_down as 1000000 although I'm pretty sure numbers higher than 100,000 don't make the trail last any longer.
    SO, my question is: Is there an object, other than jit.slide, that can have the same effect, but where the trails don't fade (until I reset them with the "clear" msg)? Or, is there a different message/attribute I can sent to the jit.slide object? If no object does this, I was also thinking that maybe there would be a way to unpack and perform operations on numbers involved with the jit.slide function so I could "slow down" the fade a LOT, so that (if each motion took 10 sec total to fade now) I could make it take, say, 60 seconds or 1000 seconds to fade.
    This is for a class project with an upcoming due date, so any help will be MUCH, MUCH appreciated!!
    The patch is below:

    • Nov 04 2013 | 4:43 pm
      Render your scene in the GL world and set's @erase_color to 0. 0. 0. 0.
      No time to make the patch for you, but see and
    • Nov 09 2013 | 6:36 am
      Thanks so much! I was completely unfamiliar with GL but ended up using and (tp.slide.jxs-help.maxpat in the examples folder).
    • Jun 27 2016 | 9:01 pm
      This post has been very helpful to point me in the right direction about GL (which I wasn t familiar in max either) and the "trail" effect. However, I am finding that trails are not continuos, the trails are kind of "broken" in segments (in the case of a light trail for instance) ... Obviously, the segments are more noticeable if the image moves faster as the distance increases.. I guess it has something to do with how the tp.slide.jxs shader (and jit.slider is the same) handle the frames.
      So, After trying a few ideas, like daisy chaining same effect or feeding the slide effect back through and xfade it I am getting the same result and can´t get smooth transitions.
      So, Could anybody throw some light here and suggest any jitter or GL object or shader or method which would be producing this kind of "continuos trail effect"?
      Thanks a lot in advance, as you might have guess not any expert in handling video or textures or in jitter..
    • Jun 29 2016 | 6:25 pm
      First off, post your patch so people can peek at possible patching errors.
      An alternative to pixel based feedback is drawing trails using I've done this by accumulating a list of coordinates to draw line segments between and clearing it when I need the trail to disappear.
    • Jul 09 2016 | 10:33 pm
      Yes, I guess is difficult without posting anything but I was basically trying with examples and help files included in Max..
      I fact, probably, I should start a new post from scratch. I have read and try some of the solutions offered in the topic:
      ..also read and completed Andrew s video processing tutorials..
      As I said, I was building some test patches by mixing parts of these tutorials and help files. Of course, I can and I do post below a basic example of what I am using to test but I guess is not going to show anything new to anyone. I am also including an screen shot of my "problem" waving a marker in front of the camera using the delay shader.
      What I would like is to have a "continuos trail", the solutions I tried all seem like are taking a frame, fade it away (via slide or any other object or shader) and then will take another and do the same. As a result, you can see several instances of the moving image forming the trail instead of that continuos trail I would like to obtain. Obviously, as the image moves faster the trail is more "broken". I guess it will all have to do with the number of frames and how fast they are fed back to the mixing chain but can t seem to find out how to solve it.
      I also tried some examples with jit.matrixset and as DTR suggest but so far they seem to be a bit out of reach for me. .
      So.. would there be any shader, object, parameter I could try to provide this effect? I am a bit new to all the jitter and GL environment in max but I would like if possible to stay on the GL world for processing. The project should consist of an HD camera providing the input for this effect (and others) to be applied.
      Thanks again
    • Jul 09 2016 | 10:37 pm
      Sorry, I attach the image again.. was too big..
    • Jul 10 2016 | 1:57 pm
      Well the broken trails depend on your frame rate. If your render at 30fps of 60 theres a huge difference. Try the smear effect (works like a charm) and erase settings mentioned above.
      I also think this could be tricky with a video feed. If the camera is in an environment with varying light conditions or camera movement could be problematic.
    • Jul 11 2016 | 8:30 pm
      > I also tried some examples with jit.matrixset and as DTR suggest but so far they seem to be a bit out of reach for me. .
      I didn't get you are after trails on video content. What I suggested is not intended for that, although it makes me curious for whether something like that can be done...
    • Jul 11 2016 | 10:16 pm
      > I didn’t get you are after trails on video content. What I suggested is not intended for that, although it makes me curious for whether something like that can be done…
      Well yes.. That is my concern also if it can be done or not. I have little experience with video or data and specially with the way GPUs or softwares in general handle the frames.. The way I see it all these effects involving delays, fades and so on seem to output frames that are always "discrete" and visible as different frames.. Of course, it makes sense since they are using frames as units in time to perform the transitions between them.
      But.. when we watch any video (live, recorded or generated) content these frames are perceived as a continuos image due to the frame rate (from basics of video and human vision) but when we apply these effects, effectively transitions in max (I think..), these frames are clearly seen specially when the image moves fast. It feels like the frame rate of the "base frames" (say the frames that are fading out in a slide down effect, in the picture I post would be each instance of the pen that is clearly seen) are too separated in time and the frames in between are filled with the fading.. so my question and what I would be after is, if those frames could be output at a higher rate so the pen itself would only be seen once and the trail would be formed from out of the fade of one frame and the next one but much closer so the would be only perceive as a color trail.
      I think for instance in the kind of effect produced by playing a footage of cars and their lights moving at night ( I don t know if that helps..)
      Regarding your suggestion, I was thinking of maybe using the jit,matrixset to store the frames and then output them at a faster rate and applying the effect to them but first of all I am not sure if that would work or even how to make it properly but.. being live content I presume that is not achievable..
      > Well the broken trails depend on your frame rate. > If your render at 30fps of 60 theres a huge difference.
      As I explained before my conclusions are that definitely has to do with frame rate but not of the source. I have seen that also happening when the shapes are generated inside the GL environment rendering at very high frame rates.
      I tried anyway to raise frame rates to maximum. In my case, I am working with a profesional camera and using a BlackMagic Ultra Studio 4K interface to input the feed and with a macbook pro Retina with the GeForce GT 750M. So input can come at 50-60 fps and render is definitely higher than 30 fps..
      > Try the smear effect (works like a charm) and erase settings mentioned above.
      I tried the help file on that, I did not have time to implement and test with the live feed and I am not sure what the smear FX does but in the jitter examples file the shape leaves a "broken trail" that gets smother inside after some time but you can still see each segment of the trail..
      So, that is my issue.. maybe I am just missing something very basic and what I am after is not possible due to how the whole thing works but hopefully I am trying a completely wrong approach but I could not find any example where those trails or fades generated from max are the way I need.
      Many thanks again for patience and help
    • Jul 12 2016 | 7:53 am
      If you have a fixed background, you can use background subtraction techniques, or frame difference to catch only moving objects, then you can feed a with the video feed, and treat it as a GL object (the erase_color method suggested bu Jesse)
    • Jul 14 2016 | 12:38 pm
      wow, Nice LSKA, Thanks a lot for that.. That is something.. I am going to need a bit of time to investigate the patch since I am not familiar with or jit.gen but that seems like it opens a lot of possibilities.. I am starting with jitter and GL but also feels like I have to read a lot from the , by the way wonderful, documentation of Max, does not feel like going the short way now..
      > If you have a fixed background Anyway.. fixed background is an option of course.. there will be fixed camera for sure but would be interesting to be able to apply the effects only to certain moving objects. In the example above maybe only to the pen and not to the hand but I think that will be quite easy to implement by "filtering" frames again using luminance or colors.
      So.. seems like I have some work in front of me, I hope it is not a bit over for me.. I will definitely come back for more issues.
      By the way LSKA, respect for your work. Very interesting and varied stuff. Bel lavoro!
    • Jul 14 2016 | 12:52 pm
      And thanks for sharing..