ReFlex Logo
ReFlex (Title)
Documentation
Navigation

Touch Detection

Table of Contents

  1. Introduction
  2. Signal Interference
  3. Implicit vs. explicit extrema
  4. Extremum Classification
  5. Identification of Touch

Introduction

Touch detection is based on the identification of local maxima by calculating the partial derivatives in the x and y directions, and builds directly upon the calculation of the vector field. Within this vector field, the system searches for a change in the sign of the individual components of the vectors.

⬆ back to top

Signal Interference

One challenge here is the noise behaviour of the sensor signal. Without filtering, a large number of local extreme values can be observed. To remedy this signal interference, three fundamental steps are taken:

  1. Pre-processing and filtering: The data is restricted to a specific range of values in all three spatial axes, including the masking of irrelevant areas; the values are then filtered.
  2. Threshold value for maximum angular deviations of the vectors in the vector field: Manual deformation produces uniform changes in the vectors; any remaining peaks are filtered out by this threshold value.
  3. Temporal stabilisation: The calculated position values of the extrema are generally numerically unstable due to sensor noise. Depth points are assigned a confidence value, which increases at each measurement time point at which the corresponding position value has moved less than a predefined distance in the lateral direction; the depth value is also taken into account to a lesser extent. Values with a confidence value below a configurable threshold are also filtered out.

⬆ back to top

Implicit vs. explicit extrema

The detection of contact points based on local extrema leads to another problem inherent in the principle: once there are two or more contact points, additional, ‘implicit’ extrema arise: between two minima there is a maximum, and between three minima there may be several maxima. The complexity of this problem increases with the number of pressure points, making it difficult to determine which extreme value was generated by the user and which by the fabric stretched between them.

One possible approach involves simulating the fabric and comparing it with the depth image. However, this is difficult to achieve in real time and requires precise modelling of the fabric’s material properties. Another approach involves additional finger recognition based on the shadow visible on the infrared image through the translucent fabric surface. This technical concept is comparable to the optical recognition of fingers and objects on interactive multi-touch surfaces. Its feasibility depends heavily on the ambient lighting and the projected content. Recognition is possible in backlit conditions and with homogeneous projection content; in other cases, recognition is highly unreliable – particularly where there is stray light or insufficient ambient light.

In addition to technical concepts, a heuristic approach is also useful, although this may entail certain limitations in terms of interaction. A simple heuristic is based on the assumption that, on one side of the fabric (relative to the normal plane), only one type of extremum is interpreted as a user interaction: from the sensor’s perspective, for example, all pressed-in points are local minima, whilst all pulled-out points are local maxima. Under this definition, it follows that any extreme values where the surrounding depth values have a greater relative distance from the surface should be ignored. This concept offers a simple and robust approach that is sufficient, at least for multi-touch detection.

Sampling to determine the type of extremum

The type of extremum is determined either by comparing the depth values at fixed, predefined positions within the surrounding area (A), at a fixed distance from the extremum (B), or in the form of randomly determined values (C): When pressing in, the majority of depth values within the surrounding area lie between the extremum and the surface’s resting position (A); the same applies when pulling out (B). The distinction is made on the basis of the relative position of the extremum in front of or behind the surface. Sensor noise or irregular shapes produce mixed relative depth values (C).

However, this means that complex deformations in other contexts are no longer detected, for example convex shapes in tangibles or arbitrary deformation in the context of collaborative interaction.

⬆ back to top

Extremum Classification

Two methods can be used to classify extrema: The basic classification is based on the change in sign of the differences between the gradients (corresponding to the second partial derivative). A disadvantage of this approach is that, due to sensor noise, the measurement inaccuracy for subtle deformations sometimes remains below the tolerance threshold.

A more robust method is to sample various depth values in the vicinity of the local extremum. This can be carried out on the basis of predefined positions within the vicinity, within a constant radius of the extremum, or as stochastic sampling with random positions. The depth values are checked at each individual position. If the majority of values are closer to the zero plane, this indicates a user interaction; if the depth values are further away from the surface, this indicates an extremum between several interactions. If the distribution is even, the extremum is discarded. The required ratio of matching points and the number of points can be configured within the framework.

⬆ back to top

Identification of Touch

The unambiguous identification of the points at which the surface is deformed by the user, and their tracking by the sensor across multiple measurement time points, is a prerequisite for the use of gestures on the Elastic Display. Furthermore, the assignment of an ID also enables the recognised positions to be smoothed and filtered over time.

The individual steps for determining the Touch ID for a detected surface deformation are as follows:

steps for determining the Touch ID

After classification removes undefined and opposite extrema, ExtremumConsolidator combines nearby extrema of the same pressure type. It uses a Euclidean radius around each strongest seed, not transitive chaining. The resulting pressure-weighted X/Y centre and strongest depth become one measurement.

InteractionSmoothingBehaviour keeps live tracks separately from the diagnostic InteractionFrames history. Each track stores its last measurement, recent timestamped samples, confidence and optional persistent Butterworth state. Historical frames are copied when exposed to callers; expired IDs cannot be revived from them.

For each observation, matching predicts each track to the capture timestamp using its recent measurements. Without prediction or sufficient samples, matching falls back to the last measured position. A strict Manhattan-distance gate (abs(dx) + abs(dy) < TouchMergeDistance2D) determines eligible pairs. There is no additional gate around the last measured position when prediction is active.

By default, a rectangular Hungarian assignment minimizes normalized matching distances together with configurable miss and birth costs. Each measurement and each track participates in at most one pair. A greedy one-to-one strategy is also available. Unmatched measurements receive fresh IDs; unmatched tracks retain their last measured and smoothed positions during the configured retention interval.

Matched contacts become Confirmed, new contacts are Tentative, and retained missing contacts are Lost. Confidence gains use elapsed capture time between consecutive detections. Missing intervals decay confidence and never add artificial motion or smoothing samples. Confidence is clamped at its ceiling; saturation does not end a contact. Publication requires confidence strictly above the configured minimum.

ContactRetentionSeconds limits retention after a completed observation misses a contact. ObservationTimeoutSeconds separately limits sensor/processing silence and acceptable observation age. Expiry permanently removes the track, independently of diagnostic history capacity. Setting history capacity to zero disables tracking and smoothing, with fresh IDs on every observation.

Smoothing consumes the newest real samples for each track. A push/pull transition starts a new smoothing segment. Polynomial fits and Butterworth use real timestamps; moving averages and Savitzky–Golay use sample windows. Forecasts remain diagnostics and matching targets, never replacement measurements. Observer selection, confidence filtering and final clustering determine which tracked contacts are published.

The historical diagrams above illustrate the motivation for touch identification; the current implementation is described here and in the configuration reference.

⬆ back to top