While the existing quaternion principal component analysis (QPCA) is a linear tool developed mainly for processing linear quaternion signals, the quaternion representation (QR) used in QPCA creates redundancy when representing a color image signal of three components by a quaternion matrix having four components. In this paper, the kernel technique is used to improve the QPCA as kernel QPCA (KQPCA) for processing nonlinear quaternion signals; in addition, both RGB information and depth information are considered to improve QR for representing RGB-D images. The improved QR fully utilizes the four-dimensional quaternion domain. We first provide the basic idea of three types of our KQPCA and then propose an algorithm for RGB-D object recognition based on bidirectional two-dimensional KQPCA (BD2DKQPCA) and the improved QR. Experimental results on four public datasets demonstrate that the proposed BD2DKQPCA-based algorithm achieves the best performance among seventeen compared algorithms including other existing PCA-based algorithms, irrespective of RGB object recognition or RGB-D object recognition. Moreover, for all compared algorithms, consideration of both RGB and depth information is shown to achieve better performance in object recognition than considering only RGB information.