The invention relates to a non local stereopair dense matching method based on image gray scale guiding. The non local stereopair dense matching method based on image gray scale guiding includes the steps: performing cost computation: taking an improved HOG operator as a cost measure, computing the cost between homonymous pixels, taking the cost as the means of describing the similarity between the homonymous pixels, and establishing a cost matrix; performing cost accumulation based on image gray scale guiding, and obtaining a stable cost accumulation result; according to a WTA strategy, obtaining an initial disparity image, rejecting a mis-matching point and an occulsion point, and obtaining a refined disparity image; and finally according to the disparity image, generating a dense high-precision three dimensional point cloud. The non local stereopair dense matching method based on image gray scale guiding fully considers the edge gray scale characteristics, has relatively high matching precision on the disparity edge, uses an eight-direction iterative cost accumulation mode so as to increase the matching robustness of a texture lacking area, and can quickly obtain a dense high-precision three dimensional point cloud, thus having great application prospect in the field of aerospace photogrammetry, low altitude photogrammetry and close-range photogrammetry, automatic driving of unmanned vehicle.