Interested in performing high-performance, high-quality video processing, computer vision, motion tracking, and analysis? And want to do it in the friendly Processing coding environment – an ideal place to start, even for non-programmers? First, you’ll want to read Andy Best’s introduction to OpenCV posted a few days ago, to get started with the topic:

But we’ve got next steps for you, as well. Andy has added a second tutorial which begins to cover actual motion analysis. It’s a simple technique, one possible even in Flash – but with OpenCV and Java/Processing, it can run very efficiently, and it’s a good stepping stone to more sophisticated techniques. Andy writes:

In this tutorial, I will show you how to use a thresholded frame difference (motion) image in order to perform collision detection with objects onscreen. Essentially we will be creating something similar to one of the old webcam games where you can ‘pop bubbles’ with your hands (or indeed anything that moves).

The gesture recognition toolkit uses a mouse as input, but the idea could be applied to video, as well.

Good stuff, and we’ll keep following applications and keep the tutorials coming. Let us know how you fare, and if you get stuck / have any questions.

One little point on Andy’s tutorial. Andy says: “The fact that Processing is based in Java means that while it isn’t as fast as a higher level language like C, it makes up for it with the huge amount of libraries availiable to the Java platform. If speed is what you’re after though, I’d definitely recommend the C++ framework OpenFrameworks.” Now, I’m a big fan of OpenFrameWorks. But in fact, when you’re using OpenCV inside Processing, you should get performance roughly equivalent to OpenCV in OpenFrameWorks/C++, because OpenCV is built with C++. And it is possible to get high performance with Java (which is a higher-level, not lower-level language than C), though the actual variables there can be complex, having to do with the garbage collector, whether you want real-time performance, and what libraries you’re using. Anyway, best to think of these as separate tools, and certainly you should feel perfectly confident in using Java/Processing if you like!

What are the chances you'd do an "ask the community" post on the state of webcams with Processing on Windows/Mac/Linux? We could all do more vision if we had working cameras…

http://www.andybest.net Andy Best

I guess it is true what you say about all of the OpenCV stuff being just as fast due to the library being in C++, but I find that the performance hit comes when writing the OpenCV image onto the Processing window (stage?). I'm not sure if it is just me, but I'm finding it a lot faster to use a blend() command to put the image into the window than just using image().

@daniel reetz As I understand it, webcam support is pretty good on Windows (being that most webcams will have windows drivers). I believe it depends on the video capture method that you use though (you might want to try different libraies to see which one works best for you- processing.video, jMyron, OpenCV capture etc). As for OS X, I believe that the webcam usually has to be compatible with QuickTime, however, there is an open source driver that has support for quite a few webcams here http://is.gd/14jH (Support for some cams is better than others).

http://createdigitalmusic.com Peter Kirn

Ah, yes — now that's because PImage and image() specifically weren't really intended for high performance or video. You can use GSVideo and GLGraphics for a much more efficient solution there.

I'd love an ask the community on working webcams; sounds like a great idea. Was there something specific you wanted to ask, or just to see what folks are using?

http://www.andybest.net Andy Best

Peter Kirn- I shall have a look into them, thanks for the tip

naus3a

i really want to get my hands wet with GSVideo: my computer vision sketches work quite smooth, but when i add a mixed reality layers stuff begin to get heavy. by the way i'm working these days on a real world mixed reality presentation/gig tool… it could be a nice test

http://www.danreetz.com daniel reetz

Andy, you're correct that most webcams have a driver on Windows but my previous experience with Processing and WinVDIG was totally miserable. I tried three different webcams, and ended up only getting one of them to work, at a miserable 320×240. I'll check out the different libraries, thanks.

I could try to outline a question, but maybe outlining a goal makes more sense — what would be cool is if we'd all find that one model of webcam that had good enough performance (say, VGA at 30fps) and worked on and with *everything*, ideally with a "native" driver — the community model I've seen before is the way the wireless hacking community finds well-performing, permissive wireless cards that work on Windows, Linux, and Mac. Macam, linked above by Andy, looks pretty close.

I mean, sure, I can buy the Logitech whatever, install their sheds of crapware, and it will *probably* work (or I can return it and lose only the hours of screwing around with it), but it's hard to find these experiences and this kind of information in a database or forum. Perhaps that's because for the people it works for, it works well and without much effort, and for the others, it's too frustrating to get started. Having spent hours playing with different cameras and Googling around, the input of people with working setups would be invaluable.

http://createdigitalmusic.com Peter Kirn

Hey Daniel,
WinVDIG is a disaster. Avoid at all costs. In fact, I think it's fair to say with Processing NO ONE should be using the default QuickTime library unless they're on a Mac and really desperate. The path forward I believe is going to be GSVideo wrapping native support on each platform (even QuickTime Java, on which Processing's default video library is based, doesn't really count as "native" on the Mac, because it's a deprecated, dead library).

GSVideo or the native capture routines in OpenCV will both serve you well.

Oh, and also avoid Logitech at all costs. (I know, I'm full of great news here.) I've seen major conflicts between their drivers and audio, and other significant sources of instability. Certainly, you don't want to install their video driver.

But I agree absolutely — shared video knowledge would be huge. Maybe we can even have a little Processing install / test party with these libraries and cameras on IRC for cdmotion.

http://www.danreetz.com daniel reetz

Certainly, you don’t want to install their video driver.

Yeah, pretty sure that's what hosed me in the end — the multiple driver installs irreversibly destroyed my ability to get new cams working. So, OK, no Logitech (no surprise, and I've had similar experiences with Creative products) and no WinVDIG (from your advice and my experience)… Which webcam to use, then?

http://www.danreetz.com daniel reetz

And sure, I'd install an IRC client for such a party.

http://createdigitalmusic.com Peter Kirn

Well, any driverless camera is your best first bet. I think Creative and even Logitech have a class-compliant camera… mine is a Live! Cam Optia or something? I'll write it up.

I have tried all the suggestions on this thread, and many others, on four different Windows XP machines, with every version of OpenCV ever released.

I can’t get the darn thing to work.

Is anyone clever enough to have a solution?

Ultimate Colossus

[b]Buy Toys Online: An Easy and Prompt Buying Option[/b]

Are you one of them who want to buy toys online for kids? If your answer is affirmative, then no need to get fretted as there are a number of online stores available selling numerous types of toys at affordable rates. Some even ships the toys the very same day at the customer's doorsteps. Nowadays, toys are no longer just playing commodity, Infact, they have been proved as great products that assist in the overall development of a child. With this concept in mind, the educational toys was designed and manufactured that help child to learn with playway method.

Buying toys from online stores

Individuals are suggested to buy toys online. Reason being, the process is not only promt and easy, but also brings the toys at affordable rates. With the presence of online stores, no one needs to waste their time in moving around shops on their week offs. Some of the popular toys available in the online market include barbie dolls, car toys, transformers or Lego toys, etc. One can order toys according to his/her requirement and budget.

Types of toys

With the presence of online stores, kids can buy different types of toys such as educational toys, activity toys, learning toys, toddler toys and play toys. Most of the stores categorize as toys for boys and toys for girls; therefore buying toys for your kids is now not a hard nut to crack. Toys aid children in all round development and make them able to learn the skills of life. Buy toys online but keep in mind that the toys you are going to buy must not only be safe and sound, but also play an important role in your child's development. You also need to ensure that the store is reputed and doing well in the business of selling toys.

Reading testimonials

Online stores bring testimonials of customers. Before buying toys from online stores, people need to read the testimonials of parents who have already purchased such toys. And thus, they come to know about the advantages and disadvantages of the toys. In fact, environment friendly toys can also be considered as a good option for your kids.