Hi
I have been lurking on the list for a while and have been watching the
amazing progress with admiration. It is really a great work you guys
have accomplished.
Unfortunately i have not yet had the time to experiment with Linux on my
own h2200. However on this subject of touch screen calibration, i feel
that i maybe can contribute something useful. At least i would like to
give it a try :-)
I work in computer vision, and have some experience with correction of
nonlinear lens distortion in images. The ts calibration is essentially
the same problem: A nonlinear mapping from one 2D plane to another. If
any of you have calibration data i can get, i could load it into Matlab,
and see if i can build a useable model.
The calibration data should be pairs of corresponding screen and ts
coordiantes from points distributed over the entire screen. The more
points the better and at least about 30. Calibration data from several
different h2200's would be ideal.
Hopefully it will be possible to build a general model, that can be
fitted to any h2200 with five points from the end user.
I do not know what the simplest way of creating such a data set is. But
it should be possible to either create an extended version of the
standard 5 point calibration aplication, or to just to load a full
screen bitmap with premade points, and click them all in order. I would
love to do this myself, but i do not have the time at the moment :-(,
But if any of you can create the data set, i should have the time to try
to create the model.
Best regards
Lau Nørgaard
Koen Kooi wrote:
>> ,___________________________,
>> | ~~~~~~~~---------~~~~ |
>> | |
>> | |
>> | |
>> | |
>> | |
>> | |
>> | _______ |
>> |-~~ ~~~~~~-----___ |
>> '~~~~~~~~~~~~~~~~~~~~~~~~~~~'
>>
>>We need the coordinates of the rectangle: Rx, Ry, Rw, Rh:
>>
>> Rx = min(Ax, Bx);
>> Ry = min(Ay, Dy);
>> Rw = max(Cx, Dx) - Rx;
>> Rh = max(By, Cy) - Ry;
>>
>>Also we need the width and height of the rectangle, it's obvious how to
>>compute it.
>>
>>
>Rw is the width an Rh is the height.
>
>
>
>
>>The easiest way is to interpolate the curves with several linear segments,
>>something like this:
>>
>> 2 3
>> 1 *_____* 4
>> A*-~~ ~~~~~~--*--___ 5
>> ~~~*D
>>
>>
>>
>Make sure the segments have the same width (or x-distance), this will
>help in finding the right segment
>
>
>>The algorithm would work as follows: First, it finds the relative Tx
>>coordinate in the range 0-1 (of course, all math should use fixed-point
>>integer arithmetic, 16.16 precision should be quite enough for this):
>>
>>x = (Tx - Rx) / Rw
>>y = (Ty - Ry) / Rh
>>
>>Now we find the segments on the top and bottom curves with the same X
>>(the curve points must use fixed-point coordinates in the range 0-1
>>as well):
>>
>>for (int top = 0; top_curve [top].x < x; top++) ;
>>for (int bot = 0; bot_curve [bot].x < x; bot++) ;
>>
>>
>segnum = x/segwidth? When segwidth is a power of two you can bitshift.
>
>
>
>>Now find the respective Y on the top and bottom curves:
>>
>>top_y = (x - top_curve [top].x) * (top_curve [top + 1].y - top_curve [top].y)
>>bot_y = (x - bot_curve [bot].x) * (bot_curve [bot + 1].y - bot_curve [bot].y)
>>
>>(I hope you see that there's a lot that could be precomputed here in advance).
>>Now let's find the Y coordinate of the point in rectangle space (range 0-1):
>>
>>y = (y - bot_y) / (top_y - bot_y);
>>
>>Now find the X and Y coordinates of the T point in real coordinates:
>>
>>Mx = Rx + Rw * x;
>>My = Ry + Rh * y;
>>
>>Ugh, okay, I hope nobody felt asleep due to my shitty English and math.
>>
>>
>I had to draw the step to get the idea. It seems good. Maybe we can
>offer the users a two step calibration: first trace the edges, compute
>the arrays and then let the user do the 5 point calibration.
>I haven't investigated this, but it seems to me wince uses a lower
>ts-resolution than linux, maybe that's why CE can be calibrated this
>easy.
>
>regards,
>
>Koen Kooi
>
>_______________________________________________
>H2200-port mailing list
>H2200-port_at_handhelds.org
>https://handhelds.org/mailman/listinfo/h2200-port
>
>
>
>
Received on Tue May 04 2004 - 14:23:59 EDT
This archive was generated by hypermail 2.2.0 : Mon Jul 25 2005 - 17:19:27 EDT