Attraction and Particles

pwix44's picture

Hello,

I am working on a project to create particle effects in QC. The idea is that I am looking for particles that will follow video images in the "background". So, for example, in a video of a bouncing ball, particles would follow the ball. Ideally, some sort of randomness could be generated, so that he gravity of the ball would not pull in each and every particle to its center but there would be some elements circling around, orbiting the video image. For now, I am thinking solely in 2d, but in the future, 3d would be preferable.

Is this possible in QC? How?

p

axel's picture
Re: Attraction and Particles

Of course you can do this, but I am not sure how either. There seems to be a lot of discussions about that feature on the board.

I am new to this forum and I am trying to do something similar. What would be very usefull to this forum is to have an example .qtz file that would track at least one set of x,y coordinates, similar to the finger pointing example for particle tools, with the emitter coming from the tip of the finger. This is nothing new to a lot of people here, but such an example would enable the rest of us to get up to speed on interactive qtz compositions.

leegrosbauer's picture
Re: Attraction and Particles

hmmm. Actually, 'tip of the finger' precision in image tracking doesn't seem to have been achieved yet with Quartz Composer, to the best of my knowledge. At least, many of us here are just as anxious for it as you are, myself included.

gtoledo3's picture
Re: Attraction and Particles

Off the top of my head...

I've used kineme open CV to create a "point", which I assign with mouse click to my finger... that point tracks with the motion of my finger tip, creating x/y coordinate. I have successfully used that to track 3D objects to my face, and particle systems to my finger tips..

However... it's been a loooong time since I mocked that stuff up, and I don't have example compositions handy. I also can't remember if it would work with video feed, or if it had to be the apple video cam input (?).

But, if you poke around the openCV stuff, you can definitely set it up so that you can track x/y motion. I guess I would try to set it up so that when I "clicked" with my mouse, the particle system would track to the openCV created point...

Now... with the kineme openCV you cannot derive Z coordinate info.

An alternate method for video effects...

What I would do if I wanted to make things easy on myself would be to put my particle system in a 3D transform, and hook up a mouse to a kineme value historian, and then to the 3D transform. I would use my trackpad to manually "make" the particles follow the bouncing ball in the movie. Then, I would just play back my recorded data, along with the movie. Or use the timeline patch to control the movement.

If you are talking about "QC automatically recognizes a bouncing ball and automatically assigns particles to ball..."... then I have NO ideas :o) I know that shape detection is somewhat trivial, but I'm not your guy for implementing that...in any reasonable time frame anyway :)

axel's picture
Re: Attraction and Particles

Interesting George, I thought that a non clickable tracker would be easily doable (and already done) by now with Open CV for someone like you. Are you saying that everyone is clicking on the trackers first before they make their demos? It seems a big point of discussion on the forum.

By the way, where do we find OpenCV? I signed up for the Kineme beta and it is not in the list of downloads.

Also I found a tracking tutorial: http://vimeo.com/3849687 using ARTrack. Any comments on how well ARTrack works in a video input environment? Do you need to mouse click on the tracker too?

gtoledo3's picture
Re: Attraction and Particles

All that AR toolkit needs is to "see" a marker, via its video input. It doesn't currently work with "movie" input, only live cam input... I haven't tried too hard to mess with that/workaround though.

As far as OpenCV, you definitely don't need to click to assign a tracking point, all you need to do is decide how you are going to setup what assigns the track point, and what methodology you are going to use to place the coordinates of the first "point"... which could be done many different ways. I'm not really sure what other people do/don't do.

leegrosbauer's picture
Re: Attraction and Particles

axel wrote:
where do we find OpenCV?

OpenCV Patch, 20080207 beta. I've thought the Kineme patch lists acted oddly on rare occasion and in truth, I didn't see the Open CV patch the first time I looked at the list just now, either. On second examination it was there. It's probably just us, eh?

axel's picture
Re: Attraction and Particles

This is great, thanks for showing a blind man the way 8-) Open CV does it, and I am tracking already with good accuracy. Onto 3D particles. I'll keep you posted.

cwright's picture
Re: Attraction and Particles

leegrosbauer wrote:
I've thought the Kineme patch lists acted oddly on rare occasion and in truth, I didn't see the Open CV patch the first time I looked at the list just now, either. On second examination it was there. It's probably just us, eh?

Not just you -- I'm personally really lousy at administrating ridiculously complicated, redundant information sets, and the side menu/this site is exactly that (in defense of the setup, it makes a lot of sense for accomplishing many other behind-the-scenes stuff).

For this site, there's a taxonomy, the actual content nodes, a menu hierarchy, and meta-nodes (not sure what they're called, perhaps views?) -- adding a new flavor of patch requires a new view for the types (I seldom do this), a content node (I'm good at this), a menu entry (I mess this up sometimes, but am slowly getting better), and possibly a taxonomy thing (I mess this up too).

If I had my druthers, the view, menu, and taxonomy would all happen at node creation (via configuration in the node fields), but that's mostly because I'm morbidly obsessed with single-point-of-reference information stuff.

Lango's picture
Re: Attraction and Particles

Hi pwix44, welcome to the forums.

"pwix44" wrote:
The idea is that I am looking for particles that will follow video images in the "background"

At the start this may seem like a simple thing, detect the image and create particles, however this is not the case. There are many ways to achieve this in many programs, which is why you will get either vague answers or very specific answers that won't suit your goal.

My advice would be to tackle the current task you have in the simplest, easiest way possible. Do not try to prepare yourself for what you may have to do in the future.

"pwix44" wrote:
for example, in a video of a bouncing ball, particles would follow the ball

This is a good example of a task and the solution you find for this might not be any help to other situations where you need track something in a video stream.

This task also looks simple enough but there are still areas that need to be answered before choosing how to tackle the problem or what software to use. Off my head, these questions will be...

  1. Is this a pre-rendered video or a live stream? If pre-rendered then a program such as Adobe After Effects may be better suited. If it is a live stream then Adobe After Effects is not going to be a suitable option. But that still doesn't mean Quartz Composer is your best option.
  2. What is the reason behind it being a video? What if you could create the ball in 3d and use no video feeds.
  3. What else is in the scene? If it is just a ball, then this can easily be done in QC
  4. How does the ball differentiate from the rest of the scene? Is it a different colour? Is it the only movement in the scene?
  5. Can people manipulate the program in real-time? (i.e. be able to click on the spots that want to be tracked)
  6. What are your skills? If you have very little programming knowledge, QC is a good option (as long as if still fits with how you answer the questions above). If you are confident with programming more options open up to you, such as Processing, NodeBox and Flash. If you are formally trained in programming and think you can handle memory management then custom patches in Quartz Composer also open up as well as directly using the OpenCV library in c++

So in short, I would recommend not thinking I want particles to follow an object how do I do this and start thinking I want particles to follow a certain object(s) in this particular context/environment for these reasons, what is the simplest way to do this?

I hope this has helped and good luck with your project

Regards

mradcliffe's picture
Re: Attraction and Particles

So redesign and up to drupal 6 next week, right? :)

cwright's picture
Re: Attraction and Particles

Ha, if there wasn't anything else to do perhaps :)

You feel up to the task? ;)