The findHomography()
method will need four points (if using Direct Linear Transformation ). If you need an optimal set, you will need a 4-point set in which DLO homography gives a minimal transcoding error. I mean, you need a method that detects sheets / outliers for a particular mathematical model with DLT .
This method is RANSAC , and OpenCV implemented it. You will find findHomography()
examples in combination with RANSAC .
I personally find one problem with this, and this is the number of RANSAC iterations in OpenCV that is too large. If you are looking for the best speed, you have to dig into the codes.
source share