 <p>Ok after some trial and error I appear to have solved this issue now. </p> <p>I have changed the drawMatches method to swap the "roiImg" and key points with "compare" and key points.</p> <pre><code>drawMatches(compare, keypoints_scene, roiImg, keypoints_object, good_NNmatches, img_matches, Scalar::all(-1), Scalar::all(-1), vector&lt;char&gt;(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS ); </code></pre> <p>This stopped the assertion error. But due to swapping the values around when it came to retrieving the key points I also had to make some changes. trainIdx and queryIdx have also been swapped to account for the previous changes made.</p> <pre><code>obj.push_back( keypoints_object[ good_NNmatches[i].trainIdx ].pt ); scene.push_back( keypoints_scene[ good_NNmatches[i].queryIdx ].pt ); </code></pre>