やること
前回の続きで、免許証の認識精度が向上しました。
これを

こうします。寸分の狂いもない、完璧な平行です。

実行環境
WinPython3.6をおすすめしています。
WinPython - Browse /WinPython_3.6/3.6.7.0 at SourceForge.net
Portable Scientific Python 2/3 32/64bit Distribution for Windows
参考にさせていただいたサイト
本当にありがとうございます。
領域(輪郭)の特徴 — OpenCV-Python Tutorials 1 documentation
モルフォロジー変換 — OpenCV-Python Tutorials 1 documentation

OpenCVを使って画像の射影変換をしてみるwithPython - Qiita
はじめにOpenCVを使ったパターンマッチングで画像中の物体抽出 with Python上記の記事を作成するにあたりOpenCVについて調べてみると、本当にいろいろなことができるみたいなので、と…
第1段階(領域検出)
モルフォロジー変換までは前回と一緒です。

領域を検出する際、カーブを許容しながら輪郭を滑らかに検出します。よく見ると、手の肉が少し食い込んでいるのが見えます。

重心を求め、重心からもっとも遠い4点を四隅とします。

第2段階(台形補正)
あとは台形補正して、領域を抽出します。

