Many life applications are extremely depending on using the robots, thus the human are seeking to develop efficient robots. Robot learning is to acquire extra knowledge in order to achieve objective configuration. In addition, robot learning from demonstration is about teaching the robot how to do specific task by the guidance of the human. Till now, learning from demonstration depends on discrete data which may cause distortion in the learning outcome. So that, preprocessing phase for the data is necessarily to handle this distortion. In this paper, we propose a new scheme for generating a generalized trajectory by employing set of demonstrated trajectories. Such that preprocessed data is used initially instead of the raw data, the preprocessing is done using posterior hidden Markov model state distribution. The rest of the model is based on set of key points identified for each demonstration. Our proposed scheme is experimentally compared to the previous works. The results show that our proposed scheme is able to reduce the error in comparison to other recent schemes with insignificant added computational cost.