الثلاثاء، 9 مارس 2010

Phase 2: Calibration

This part of the project really confused us for a long time, we were so convinced that we won't need manual calibration and we spent the whole time trying to implement automatic calibration. But, then we faced some problems that I'll discuss in details that lead to the necessity of using manual calibration.

First, What's Calibration?
It is a preprocessing stage before warping, in which we align the coordinates of the display to the wii-mote coordinates.


Manual Calibration : suggests that the user at the beginning of the application, marks the corners of the projector, and save the corresponding wii-mote coordinates. Then maps the corners of the projector to the corners of the wii.

Automatic Calibration: doesn't need any user interference to map the display to wii-mote coordinates.


Second, Why use calibration?

Well, if we took the coordinates directly from the wii-mote without any preprocessing and projected on those coordinates, we'll find that the image is not positioned directly on the display, since the wii-mote coordinates system [1024*768] is different than the projector/ display coordinate system [Screen resolution]. And if we positioned the wii-mote away from the projector, that might lead to distorted image. So we do this process to calculate origin (0,0) of the screen maps to what coordinate in the wii-mote.


Third, we're going to discuss in details each approach.

Manual Calibration in details,


How,
1- At the beginning of the application, a white screen is projected and small crosshairs at the corners of the screen are drawn.
2- The user user selects those crosshairs using the IR pen.
3- Then we save the corresponding wiimote coordinates.
4- After that we compute a homography matrix, where the source points are the screen corners, & the destination points are are the saved wiimote coordinates.

5- After that whenever we save coordinates of the IR LEDs, we multiply it by the above homography matrix.


Advantages,
1- A very big advantage is that it doesn't place any constraints on the place of the wii-mote relative to the projector.
2- It's accurate, the position of the image is placed on the display without any errors.

Disadvantages,
1- A major disadvantage is that it needs user interference to calibrate.


Automatic Calibration in details,


How,
1- without any user interference, we take the coordinates of the IR LEDs and do some calculations on it to output the mapped display coordinates.
2- Those calculations are illustrated below: (similar to normalization equations)

pt.x = (int)((newpt.x / 1023) * this.Width);
pt.y = this.Height - (int)((newpt.y / 767) * this.Height – 225);

Hint:
1- in the Y equation, we subtract [Height – newpt], because the origin of the screen is top left while the origin of the wii-mote is bottom left.

2- in the Y equation also, we subtract with a constant value 225. It is due to the difference between the projector lense and the wii-mote just placed above. You won't believe how we got this number, but we actually took a ruler measured the distance between them it was about 2 cm, then took this ruler and measured the screen. With some cross multiplication :D, we calculated (2 cm) corresponds to how many pixels (225).


Advantages,
1- It's obvious that its main advantage, is that it won't need user interaction.

Disadvantages,
1- It places a constraint that the wii-mote must be placed above the projector.
2- The big problem appeared, when we found that the size of the image wasn't perfectly matching to the size of the display.


Last,  We decided to go for manual calibration as it's more accurate.

ليست هناك تعليقات:

إرسال تعليق