Gesture modelling and recognition by integrating declarative models and pattern recognition algorithms