Research Article

Research on Intention Flexible Mapping Algorithm for Elderly Escort Robot

Algorithm 2

Flexible mapping algorithm.
Input: Gesture instructions and objects in the surrounding environment
Output: User intent
(1)Perform gesture segmentation and binarization of the input gesture instructions to obtain the outline of the gesture to prepare for fingertip detection and centroid detection.
(2)Perform gesture recognition and target detection with visual information to obtain the user’s current gesture type r and interaction scene s
(3)hile (gesture recognition starts, get the outline of the gesture):
{
(1) According to Algorithm 1, the fingertip coordinates of the gesture are detected.
(2) The gesture contour moment was calculated according to the obtained gesture contour, and the gesture centroid was obtained by centroid detection.
(3) According to the obtained coordinates of the fingertip point and the gesture centroid point, the distance L between each fingertip and the centroid is calculated by formula (1).
}
(4)The obtained distance L between each fingertip point and the center of mass is compared with the threshold value through formula (2), so as to obtain the corresponding feature intention serial number .
(5)By tracking the centroid of the gesture, use formula (3) to subtract coordinates to obtain displacements and .
(6)While ( > Displacement judgment threshold v or  > Displacement judgment threshold v)
{
(1)Determine the sign of and .
(2)Combine the determination results of and to obtain the gesture movement direction d
}
(7)Combine the obtained finger curvature serial number, gesture direction serial number, gesture type serial number, and interaction scene serial number to form an intention determination set . Finally, compare the intention determination set I with the behavior-intention database; if there is a match, the mapping is successful, and the user intention R is obtained. Otherwise, the mapping does not exist.