LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Translating Evdev Axis Calibration to Matrix or something else? (https://www.linuxquestions.org/questions/linux-desktop-74/translating-evdev-axis-calibration-to-matrix-or-something-else-4175608482/)

IsaacKuo 06-23-2017 02:28 PM

Translating Evdev Axis Calibration to Matrix or something else?
 
I've upgraded from Debian 8 to Debian 9, and they've gotten rid of evdev. I had been using evdev to calibrate the resistive touch screen on one of my weirder computers (actually a Fujitsu ScanSnap N1800 kiosk scanner).

Here's what I used to use to calibrate it:

Code:

xinput set-prop "Fujitsu Takamisawa USB Touch Panel" "Evdev Axis Calibration" 850 16083 1000 15853
But if I list the available properties now, obviously evdev properties no longer show up:

Code:

xinput list-props "Fujitsu Takamisawa USB Touch Panel"
Device 'Fujitsu Takamisawa USB Touch Panel':
        Device Enabled (153):        1
        Coordinate Transformation Matrix (155):        1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Calibration Matrix (518):        1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Calibration Matrix Default (519):        1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Natural Scrolling Enabled (520):        0
        libinput Natural Scrolling Enabled Default (521):        0
        libinput Send Events Modes Available (273):        1, 0
        libinput Send Events Mode Enabled (274):        0, 0
        libinput Send Events Mode Enabled Default (275):        0, 0
        libinput Left Handed Enabled (522):        0
        libinput Left Handed Enabled Default (523):        0
        libinput Scroll Methods Available (524):        0, 0, 1
        libinput Scroll Method Enabled (525):        0, 0, 1
        libinput Scroll Method Enabled Default (526):        0, 0, 1
        libinput Button Scrolling Button (527):        2
        libinput Button Scrolling Button Default (528):        2
        libinput Middle Emulation Enabled (529):        0
        libinput Middle Emulation Enabled Default (530):        0
        Device Node (276):        "/dev/input/event3"
        Device Product ID (277):        1072, 1281
        libinput Drag Lock Buttons (531):        <no items>
        libinput Horizontal Scroll Enabled (532):        1

I don't see any property which looks similar to the one I originally used, but I do see "libinput Calibration Matrix (518)".

Am I right in thinking I'm going to have to somehow translate my evdev corner calibration coordinates into a transformation matrix? Any idea how to do this other than trial and error? Thanks!

IsaacKuo 06-28-2017 10:07 AM

I ended up just biting the bullet and redoing the calibration from scratch using "libinput Calibration Matrix".

I didn't want to get into the complexities of rotation and skewing, so I just did scaling and translation. This meant modifying four of the 9 matrix entries:

Code:

A 0 C
0 E F
0 0 1

The default identity matrix looks like this:

Code:

1 0 0
0 1 0
0 0 1

This means no calibration at all. The corresponding command line for this default looks like this:

Code:

xinput set-prop "Fujitsu Takamisawa USB Touch Panel" "libinput Calibration Matrix" 1 0 0  0 1 0  0 0 1
The factors A and C determine x-axis scaling and translation.

The factors E and F determine y-axis scaling and translation.

I just used trial and error to dial in the calibration until I was satisfied. The resulting command I ended up with was this:

Code:

xinput set-prop "Fujitsu Takamisawa USB Touch Panel" "libinput Calibration Matrix" 1.07 0 -.05  0 1.09 -.07  0 0 1
I stuck it in a script set to automatically run (in XFCE4 settings, it's Sessions and Startup).


All times are GMT -5. The time now is 02:34 AM.