In this paper, we define and discuss the Moore-Penrose inverses of matrices with quaternion polynomial entries. When the Moore-Penrose inverses exist, we prove that Leverrier-Faddeev algorithm works for these matrices by using generalized characteristic polynomials. Furthermore, after studying interpolations for quaternion polynomials, we give an efficient algorithm to compute the Moore-Penrose inverses. We developed a Maple package for quaternion polynomial matrices. All algorithms in this paper are implemented, and tested on examples. (C) 2015 Elsevier Inc. All rights reserved.