Wednesday, October 07, 2009

Real time Lissajous Graph using OpenCV

If you need a real time charting tools, you might need to make one by your own. In my case, I need to observe the Lissajous Curve of my signal to ensure the phase difference between two signal is correct.

We could perform this using oscilloscope if it is electrical signal, but in my case I need to do take the data from an image captured by camera and I need to observe the Lissajous figure at real time. I found that common windows GUI component (at least the one that I use..) is not fast enough. So I create a custom graph using OpenCV which cost me around 2-3ms to show.

I like OpenCV because it's fast and it's enough for my application. For example if we have a signal like this one and we want to check the phase difference between the Blue point and the Red point, or you want to check the phase difference between Red point and Yellow Point. First we have to determine the points.

We can draw it on a Lissajous Curve by drawing the intensity on the X-Y axis as follow. This is simply just drawing a point based on the intensity of the point.

Based on the theory, if the phase difference is 90 degree, the Lissajous curve will be a circle. We can apply circle eccentricity algorithm to determine whether it's a circle or not. In my case, I haven't implemented it yet. If the shape is almost circle, then it is just enough for my application.

Labels: , , ,


Post a Comment

<< Home