I don't know OpenCV well enough to know if it specifically offers routines to help. That said, the math to DIY isn't too bad if you have a numerical library for SVD e.g. numpy. In Lowe's 2004 paper, a match is determined by the ratio of the two closest matches. If you compute all keypoints in your 'query image' and then apply this criteria you will very easily return multiple results if they are present (any 2 keypoints in the database with the same ratio +/- epsilon are a match). However, this can result in spurious matches. So, in addition to the basic test from the Lowe paper, RANSAC can be used to discard candidate matches that are not consistent with a homography between your 'training image' and the 'query image'. See 'Distinctive Image Features from Scale-Invariant Keypoints' by David Lowe and google "RANSAC homography" for details. I'm not sure if your desire to match 4 keypoints specifically is critical. The technique I'm referring to will use 4 points to calculate the candidate homography at each RANSAC iteration, but the total number that match can easily be >4 if it so happens that they match and are consistent with the homography. Using 4 points only will be possible using only the ratio test, but will not be possible using RANSAC.