How to deskew an image in an unknown condition? [closed]
I knew that there is a getPerspectiveTransform function in OpenCV to perform the deskew work, it is very useful under a known condition. However, the destination matrix used is well-defined by users.
Suppose that there are different type of cards we want to make a recognition, but those are in different sizes and skew in different angles, which result in the failure of using getPerspectiveTransform. What can I do if I try to use getPerspectiveTransform?
If you have photos of cards in different positions you can use this but this one is detecting the points more correct IMHO.
Thank you, thdrksdfthmn. I have read the first passage before, but the destination image's size used in that code is well-defined as I said, which is ( cv::Mat quad = cv::Mat::zeros(300, 220, CV_8UC3) ). So in my case, when I'm unable to determine the original object's size, using that deskewing way may not work.
I do not really understand your case... Can you post some more info, like a photo of input image or something like that?