Visiting guest. Why not sign in? |
News, knowledge and discussion for the AI enthusiast.
FEATURES |  | COMMUNITY |  | KNOWLEDGE |  | SEARCH |
Get Creative: AI Article Writing Contest Fancy the chance of getting developer focus, improving your research skills, sharing your artificial intelligence ideas, obtaining expert feedback, getting published online AND winning a prize? Enter the AI Article Writing Contest! |

Motion Detection A system for detecting motion from a VFW compatible webcam
Motion Detection I've written a fairly efficient system for detecting motion within images grabbed from a VFW compatible webcam using VB6. The red dot in the motion image represents the "centre of motion" within the image, and could be used to guide the camera if it was mounted on a pan/tilt mechanism. You can download the source at http://www.fuzzgun.btinternet.co.uk/Downloads.htm - Bob P.S. There don't seem to be any discussion categories here for robotics/vision | motters 136 posts. Saturday 01 December, 05:20 Reply
Looking good! Nice page! Good choice of test images for the face detection :P I haven't downloaded the code yet, but it should be very interesting. I haven't done any vision yet. And what do you mean there's no place to discuss robotics! I was planning to do it soon anyway ;) | Alex J. Champandard 931 posts. Saturday 01 December, 08:54 Reply
Motion based servoing I'm currently testing out the code with Rodney, my stereo vision robot. At present the robot roughly pans the cameras towards moving objects (such as my head) and occasionally gets distracted by other objects such as a TV in the background. The motion is still pretty crude and jerky though, and needs better tuning. - Bob | motters 136 posts. Saturday 01 December, 09:00 Reply
Smoothing There are plenty of ways you could potentially get smoother movement. You could just use a simple filtering process, i.e. keeping the previous value intact and blending it together with the current value: 80% / 20% weighting for example. Or you could just get a Neural Network to do the motion interpolation for you... My NN-based navigation code can deal with nearly 80% of destrutive noise quite well! Admittedly, the bots look drunk, but they have smooth movement ;) But I'm sure all this was already on your 'to-do' list! | Alex J. Champandard 931 posts. Saturday 01 December, 12:16 Reply
Motion control After a certain amount of twiddling I've managed to get the motion detection algorithm working successfully with the robot. The movement of Rodney's head isn't completely smooth but instead moves sporadically in a series of saccade type movements. There are two reasons for this type of movement. First the control of the servos is done using a mondotronics miniSSC board which does not have any sophisticated motion control capabilities such as the ability to specify the speed of the servos. The speed of movement can only be specified explicitly in the code by doing a linear interpolation between positions. Even if smooth continuous motion of the head was possible this would not necessarily be desirable. The frame rate for the two USB Quickcams which form Rodney's eyes is relatively slow, and the compression system used by the cameras assumes that the camera would normally remain in a fixed position with relatively little movement from one frame to the next. This means that for Rodney's motion tracking ability the head needs to move in a "chicken-like" fashion, continuously switching between moving from one point to another, letting the camera stabilise for a fraction of a second, observing any motion within the image and then moving the head once again. If you look at many types of animal you can also see this sort of sporadic head movement. For a large proportion of the time the head is actually stationary, permitting the animals vision to concentrate on detecting the movements of potential predators or prey. Detecting motion while the animal is itself on the move is more difficult (but not impossible) and relies upon the brain's ability to effectively factor out self-induced movements. This kind of ability is believed to be one of the first stages in the development of a self/non-self distinction. Anyway, Rodney is now pretty good at picking up movements (even with his relatively low-tech electronics) such that he can track me walking across the room and keep his cameras fixed on me while I'm typing this message. - Bob | motters 136 posts. Saturday 01 December, 13:18 Reply
Good Points As I said, I don't have any experience in motion detection, so you'll have to forgive my naivety ;) All the points you put forth are very pertinent indeed! It just goes to show it's all about experience anyway, and it really makes me want to do some work on real robots. About the factoring out of self-induced movement, I was lucky yo assist a talk last friday by a guy from the Robotics Group at Geneva University. They talked about custom designed VLSI chips, which they used to automatically find the point with the most motion (with a competitive neural model I believe). They used this to simply avoid close objects and not to detect motion. However, together with distance information sensors, you could determine if this point is actually fixed in space (and that it's not perspective trying to play a trick on you ;) ... But it sounds like a lot of hard work to me! PS: Did you want the release announced as news or not? | Alex J. Champandard 931 posts. Sunday 02 December, 08:10 Reply
Motion Detection For hardware detection of moving targets this would be fairly easy to achieve without the use of neural networks. Taking the difference between successive frames and then applying a gaussian filter would be sufficient. What they were probably using the VLSI circuit for would be optical flow detection. This means finding feature points within the image and then tracking their movements over successive frames. This sort of thing is more advanced than simple motion detection and does require the use of neural nets. Optical flow - sometimes refered to as the "looming effect" - can be used to estimate the distances to objects for obstacle avoidance tasks. The principle is exactly the same in stereo vision (as on the Rodney robot), except that the matching is done in space rather than over time. Other means of distance measurement such as ultrasonics or lasers would be used to calibrate the visual system, but otherwise vision alone is sufficient for obstacle avoidance. I've been experimenting with an additional feature on Rodney, where the visual input is classified using a self-organising topological feature map. Interesting (i.e. moving) features are classified such that hopefull the robot will learn to discriminate between different situations such as someone sat at the desk in front of it, or a person walking across the room, etc. Additional simple behaviors can be added which give the robot some rudimentary emotional feedback. Using a flexible piece of rubber attached to a minature servo the robot can be made to look as though its either smiling or scowling. The motion detection algorithm can be used to calculate a general overall level of visual stimulation for the robot (as a leaky integrator). If the robot detects that there is a moving object close to it and the visual stimulation level is within certain limits then the robot should smile. Too much or not enough stimulation could lead to scowling. This is exactly the sort of simple reflex behavior that you might find in a human baby, which is designed to encourage nurturing and interactive behaviors from the parent. - Bob | motters 136 posts. Sunday 02 December, 12:09 Reply
Stereoscopy and Time-based Analysis It seems like the time-based analysis of successive frames is a lot of work, and not only from a theoretical research point of view, but also in the speed of the implemented algorithm. Hence the reason for hardware. That said, it seems a bit silly to require such analysis when you can have two cameras instead, and analyse those with 'slightly' simpler maths. Humans do it that way too, having nearly two eyes on average ;) SOFM are great... I've never worked with them personally, but some other Ph.D's here are doing some sexy stuff with Neural Gas Networks: mapping raw input space onto NGN nodes based on imitation. In your case, obviously emotions would guide the learning rather than feedback. Sounds like rodney is a great lot of fun! | Alex J. Champandard 931 posts. Wednesday 05 December, 05:51 Reply
Sense and sensibility Yes ultimately most intensive visual processing tasks are best implemented in hardware. This is demonstrated quite well by some of the off-the-shelf industrial vision systems that are available, whch are self contained units that you can connect directly to digital inputs and outputs. After some experimentation it seems that the neural classifier that I'm using on Rodney isn't terribly efficient. Simply feeding the visual input into the classifier makes it very difficult for the system to learn anything remotely useful. Instead I've taken advantage of the fact that the robot sits (some might say languishes) in a stationary position on my desk. From a stationary point it can build up a panoramic database of what it expects to see for any given configuration of servo positions. The panoramic data is again implemented as a leaky integrator type system, so that the robot continuously updates what it expects to see and slowly forgets old information. This allows the robot at any point in time to compare what it actually sees against its panoramic database and find the differences (things which have moved or changed). It's generally more important to learn about things which change over time rather than things that continuously remain the same, so the difference between expected and actual visual input is fed into the classifier system. I had a look at some stuff on neural gas type networks on a web site recently (I think Sussex university, UK), but I'm still unsure as to exactly how they work. - Bob | motters 136 posts. Wednesday 05 December, 12:07 Reply