Sunday, April 14, 2013

Use your webcam with JavaFX and openCV - Part II

In case you want to use your webcam as input device for grabbing and processing images, this blog post has some pieces of information which might be valuable for you.

Yacht on Sydney Harbour

Last week I've discovered that you can use OpenCV to grab images from your webcam quite easily, all you need is the starting point project on github and a valid openCV installation for your system.  Maybe you have a look at my previous posting which documents my struggle to get it up and running.

I've learned that in the end it is quite easy to set it up.

On windows you'll just need to download the openCV archive and use the appropriate dll and jar file. On MacOsX you can either compile openCV yourself or use the premade scripts from the macports or homebrew installation systems.


The github project gives you a full setup and self contained program which demonstrates how to use JavaFX to create a simple gui for a image processing application. It shows also how to convert a "Mat" datastructure to a format suitable for JavaFX (without using temporary files), and a Service implementation for the image source. Bottom line is that the picture taken from the webcam will be grabbed by openCV, processed by openCV and displayed with JavaFX.

With this you have the starting point to do more image processing using desktop Java facilities. 




7 comments:

  1. I like your post.Very impressive way of writing....appreciate the great information about Image Analysis. Many thanks...

    ReplyDelete
  2. Nice post. I have one or two posting on the subject of object detection using OpenCV that you may find useful.
    http://www.technical-recipes.com/2011/object-detection-using-the-opencv-cvblobslib-libraries/

    ReplyDelete
    Replies
    1. thank you happyuk, your site is awesome, I'll definitely will reuse some of your ideas in the future :)

      Delete
  3. I actually enjoyed reading through this posting.Many thanks.
    Image Processing India

    ReplyDelete
  4. How fast does face detect work? How many frames per second?

    ReplyDelete
    Replies
    1. depends on your hardware configuration, didn't do any benchmarks, on my laptop you get several face detections per second.

      Delete