My week...
Feb. 28th, 2010 05:36 pmThis week is kind of busy for me, especially as I had the last two weeks off for the Olympics.
While I have a very busy day on Thursday, I'm most dreading Tuesday's assignment, as that's the course I'm really not liking.
(I'm much more comfortable writing in a programming language than I am writing papers in English)
While I'm on the topic of the open house, I may as well mention what I've been working on recently.
Last open house, I had most of the robots (about eight iRobot Create robots, basically stripped-down versions of the iRobot Roomba) running around with one of the default programs included, and one or two I had running around a program I wrote to "escape from a room", which basically meant "wander around until you find a virtual wall", though the program I wrote for it was a bit more interesting than that.
This year, I'm going to use input from a webcam as another sensor. So now I get to do stuff like finding the brightest or darkest part of the room, or chase a laser pointer.
You know, stuff that's much more interactive and interesting.
I also get my own room this year. The campus has small four- to eight-person rooms for teams to have meetings in, and I'll be given one all my own this time, with some of the Computing Science department in front of my room, and the rest in another room behind the main CS area.
So, this last week has been spent trying to figure out how to get a picture out of the webcam and into my program, hopefully in Python's Image Library format so I can do all kinds of image processing to it.
My first attempt (and what was billed as the easiest method) was using something called OpenCV, a Linux-only computer vision library.
The major problem is an issue with picture stability.
(in other words, the top-left corner of the webcam image is NOT always coming out as the top-left corner of the requested image)
This is something I'm not prepared to deal with, let alone try to understand.
So I found another alternative, and this one seems to have the advantage of being cross-platform as well.
It's called GStreamer, and it's basically a patch panel for audio and video programs.
Each element in the "pipeline" has inputs and outputs, each with their own capabilities, that can be plugged together in a large variety of ways.
Programs for streaming video from a webcam to the screen are pretty easy to find, and are fairly easy to understand, especially when written in Python.
The trick in my case was figuring out how to get the image data out of the pipeline.
(they don't like that sort of thing, so it's not terribly easy to figure out how to do, but actually doing it is quite easy)
Anyway, after a week, I've written a 30 line Python library that allows me to get a frame from the webcam reliably, as fast as I want and in the format I want.
I've tested it on a few computers (Linux only at this point) and on two different webcams, and it seems to work just fine, so it's what I'll be using for now.
The actual programs I'm going to demo aren't written yet, but that's primarily due to my other assignments with higher priority...
(they shouldn't be very hard to write, as I've done stuff similar to this before)
- On Monday, I have a networking homework assignment due.
- On Tuesday, I have a computerized society paper due.
- On Wednesday, I only have newspapers to deliver.
- On Thursday, I have a midterm in the morning, an open house to help set up in the afternoon, my own project to demo during the open house in the evening, and take-down afterwards.
- On Friday, I have another midterm late morning.
While I have a very busy day on Thursday, I'm most dreading Tuesday's assignment, as that's the course I'm really not liking.
(I'm much more comfortable writing in a programming language than I am writing papers in English)
While I'm on the topic of the open house, I may as well mention what I've been working on recently.
Last open house, I had most of the robots (about eight iRobot Create robots, basically stripped-down versions of the iRobot Roomba) running around with one of the default programs included, and one or two I had running around a program I wrote to "escape from a room", which basically meant "wander around until you find a virtual wall", though the program I wrote for it was a bit more interesting than that.
This year, I'm going to use input from a webcam as another sensor. So now I get to do stuff like finding the brightest or darkest part of the room, or chase a laser pointer.
You know, stuff that's much more interactive and interesting.
I also get my own room this year. The campus has small four- to eight-person rooms for teams to have meetings in, and I'll be given one all my own this time, with some of the Computing Science department in front of my room, and the rest in another room behind the main CS area.
So, this last week has been spent trying to figure out how to get a picture out of the webcam and into my program, hopefully in Python's Image Library format so I can do all kinds of image processing to it.
My first attempt (and what was billed as the easiest method) was using something called OpenCV, a Linux-only computer vision library.
The major problem is an issue with picture stability.
(in other words, the top-left corner of the webcam image is NOT always coming out as the top-left corner of the requested image)
This is something I'm not prepared to deal with, let alone try to understand.
So I found another alternative, and this one seems to have the advantage of being cross-platform as well.
It's called GStreamer, and it's basically a patch panel for audio and video programs.
Each element in the "pipeline" has inputs and outputs, each with their own capabilities, that can be plugged together in a large variety of ways.
Programs for streaming video from a webcam to the screen are pretty easy to find, and are fairly easy to understand, especially when written in Python.
The trick in my case was figuring out how to get the image data out of the pipeline.
(they don't like that sort of thing, so it's not terribly easy to figure out how to do, but actually doing it is quite easy)
Anyway, after a week, I've written a 30 line Python library that allows me to get a frame from the webcam reliably, as fast as I want and in the format I want.
I've tested it on a few computers (Linux only at this point) and on two different webcams, and it seems to work just fine, so it's what I'll be using for now.
The actual programs I'm going to demo aren't written yet, but that's primarily due to my other assignments with higher priority...
(they shouldn't be very hard to write, as I've done stuff similar to this before)