Touch Calibration
The WiimoteWhiteboard software has two graphical user interfaces: the main control panel and a four-point calibration form. The purpose of the calibration form is to obtain the four pairs of points needed to compute the homography matrix described earlier. It is a full-screen window that displays four crosshairs sequentially at known locations near each corner of the display. The user places the IR pen at each crosshair location, activates the LED, the camera sees the dot, the software pairs the dot location with the known display coordinates of the crosshair, and then proceeds to the next crosshair. Once all four points have been registered, we have enough information to compute the homography matrix and can begin simulating the mouse.
Let's begin by creating our Calibration Form. First we need add a new Windows Form to our project. In the Solution Explorer, right-click on your project name, which should bring up a menu. Navigate to Add →New Item, select Windows Form from the choice of templates, and name it CalibrationForm.cs or CalibrationForm.vb, depending on your language of choice.
We must set up the form's properties so it will show up as a full-screen window. To do this, set the FormBorderStyle property to None, and StartPosition to Manual. Later, in code, we will manually assign the window position and size to cover the screen.
We want to be able to draw into this form, and one way to do that is to draw into a PictureBox object. From the Toolbox panel, select ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access