Motion Capture with MATLAB and a Webcam
Last semester, I had a class project where we had to develop a model for a car or truck’s suspension. We used a half car model and had 2 people stand over the rear axel of a truck and jump out, then analyzed the reposnse to find the parameters of the model. Most groups just held a tape measure up against the car and videotaped it, which we also did as a backup, but I also wrote a quick MATLAB script to capture the response of the system.
Basically we just drapped a darkish sheet across the truck, with a while shape pinned onto it. The script captures all of the frames using a webcam, at 30fps. After the video is all captured, their contrast it upped, they are converted to black and white, and the centriod of the whitespace is found. Once a baseline conversion from pixels to meters is found, it is pretty simple to take the height over time and find a generic model.




All of the code can be found here:
Stay in the loop
Get notified when I publish new posts. No spam, unsubscribe anytime.