Work In Progress!

Pendulum Tracking with OpenCV

As part of a laboratory course on optics, I developed a rig and associated code to track a torsion pendulum and update values to a webpage in real time.

The pendulum itself consisted of a stick suspended from spider silk.

A downward pointed webcam served as the input device, and python-opencv based image processing routines enabled extracting the torsion angle from the live video feed.

Backend

Python Script uses OpenCV to extract Angle of pendulum.
The script maintains a TCP server that responds with the latest angle details to clients

Source Code


The library used for image manipulations

 

 

Frontend

A local webserver was setup using Apache, and Drupal CMS was installed.

On top of the fancy Drupal environment, a Jquery+Ajax webpage was coded to fetch values from the server and display an animation corresponding to the angle.

Jquery.flot was used to plot the obtained values inside the browser page

torsion