Gesture recognition is an important component in human-robot interaction. This paper realized a command-gesture recognition architecture based on optical flow PCA and DTW for a stereo vision system SFBinoeye. The recognized gesture command was used to control humanoid robot SFHR's arm to move correspondingly. Optical flow is computed using block relative algorithm, which is then handled with PCA to get continuous projection coefficients with lower dimension. The projection coefficients are combined with the center position of hand as complex feature vector. A new weighted distance is defined in DTW, which is used for gesture pattern match. The proposed gesture recognition architecture is tested on 9 gestures with of recognition 92.4% rate. This architecture is successfully applied in the control of robot arm.