Artificial intelligence and computer science and technology developed rapidly. Computer vision technology has also made considerable progress. Human eye detection, human eye recognition and tracking also have significant application value and research significance. Based on OPENCV platform, this paper implements human face detection. The edge of the eye and pupil was extracted by sobel edge detection algorithm. According to the position of the pupil in the eye, the attention of the human eye can be obtained.