r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • ABOUT
  • OLD SITE
  • SEARCH
  • FEEDBACK

How to: Pixelise a webcam stream using OpenCV

r3dux | December 8, 2010

There was a video the other day which I posted about where the video footage was all highly pixelised into circles of varying sizes and colours, and I reckoned I could produce a similar effect by either resizing the stream down so it’s really blocky then scaling it back up or reading all the pixels in a block, averaging the colour and then drawing blocks of that averaged colour.

Well, I had an hour or so today to do a bit of “me-coding”, and in the end I took the second option.

Pixelised Webcam Stream

The pixelisation works on the live stream, and you can drag the slider around to switch through from 1 division (i.e. the entire window is one block of solid colour) to 160 divisions.

I’ll bring the values into OpenGL and see what I can do with points and the like when I have another hour or two spare over the coming few days – fun stuff =D

Source code after the jump for those interested…

Read the rest of this entry »

Comments
1 Comment »
Categories
Coding, How-To
Tags
Block, Blockify, Blocky, C++, OpenCV, Pixelise, Pixelize, Stream, WebCam
Comments rss Comments rss
Trackback Trackback

How To: Perform Real-Time OpenCV Edge Detection on a WebCam Stream

r3dux | November 6, 2010

I’ve started learning OpenCV, the open-source computer vision library, and I’ve got to say – it’s absolutely brilliant. In the below screenshot I’m just running the canny edge detection filter on the live stream and outputting it in a window with some sliders which link to the edge detection parameters, and the entire thing from initialising the web cam, to displaying the frames and performing all the filtering is a little over 100 lines of code… Amazing!

OpenCV Canny Edge Detection

It’s when I start asking OpenCV to do things that it currently doesn’t do that I’m going to start screaming, and I read that optical flow analysis has stolen the youth of many a Ph.D student… But how awesome will it be if I can make a really robust gesture recognition system and tie it into OpenGL? I guess there’s only one way to find out…

Full source code after the jump for those interested (although please don’t ask me how to build/install OpenCV and link the libraries into the project – it’ll vary depending on your system and build tools of choice).

Read the rest of this entry »

Comments
3 Comments »
Categories
Coding, How-To
Tags
C++, Edge Detection, OpenCV, Real-Time, Stream, WebCam
Comments rss Comments rss
Trackback Trackback

How To: Enable “Stereo Mix” in PulseAudio and Record Absolutely Any Playing Audio

r3dux | October 23, 2010

I found these instructions on the PulseAudio Wiki a long while back, but they still work (circa Ubuntu 10.10) and are super useful to record streams/record the audio from videos (i.e. YouTube), so I thought I’d put this out here under a different heading to help people find the info…

  1. Install PulseAudio Volume Control by running the following in the Terminal:

    sudo apt-get install pavucontrol
  2. Fire up Audacity and:
    – Go to Preferences by pressing Ctrl+P (or select “Edit” -> “Preferences…” from the drop-down menu).
    – Click the “Devices” .
    – Change the Playback device to “pulse”.
    – Change the Recording device to “pulse”.

  3. Open PulseAudio Volume Control (“Applications” -> “Sound & Video” -> “PulseAudio Volume Control”) and leave it open.
    The first time you use a recording program you need to to edit the recording settings of PulseAudio Volume Control. It should remember your settings after rebooting.

  4. Open Audacity and hit the “Record” button.

  5. While Audacity is recording, open PulseAudio Volume Control and select the “Recording” tab. It will show “Alsa plug-in Audacity. Alsa capture from” and a combo-box. Choose the “Monitor of internal audio…” if you use an internal sound card.
  6. Note: You need to select another monitor if you use any playback device other than an internal sound card. For example, when I play sound with Microsoft LifeChat headphones connected to my computer via USB, I select the “Monitor of Microsoft LifeChat Analogue Stereo” to capture from it with Alsa.

  7. Check Audacity, it should be recording now.

Sling a note in the comments if you’re having any difficulty enabling recording of the “stereo-mix” output – not that you should come up against any problems, but I’m happy to work on clarifying the wording if it’s necessary…

Cheers!

Comments
11 Comments »
Categories
Linux, Music
Tags
Audacity, PulseAudio, Record, Stereo Mix, Stream
Comments rss Comments rss
Trackback Trackback

Britain Without the Gulf Stream

r3dux | January 8, 2010

Apparently, due to freak conditions the Gulf Stream has left the UK for Greenland it’s winter in the UK – and this is the result! (Gulf Stream myth debunking here).

Great Britain in Winter 2010

Beautiful, yet frickn’ freezing!

There’s a high of 32C in my part of Oz today – and can’t say I really miss the cold that much at all :)

Comments
1 Comment »
Categories
Imagery, Life
Tags
2010, Britain, Great Britain, Gulf, Gulf Stream, Stream, Winter
Comments rss Comments rss
Trackback Trackback

Translate

Categories

Archives

Tags

3D ActionScript ActionScript 3.0 Adobe AI Ballarat Bash C++ Class Convert CS4 Effect Film Flash GLSL Gnome Hack How-To install Jaunty Java Kinect Linkage Linux Mash-Up Microsoft Motion OpenGL Particle Photoshop Problem PS3 Remix Remove Retro script Slides Sound Systems Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

OpenR3dux

Misc.

Flattr this

RSS Feed

r3dux twitter feed



“You are fair-minded, just and loving.”

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox