金子邦彦研究室人工知能Windows で動く人工知能関係 Pythonアプリケーション,オープンソースソフトウエア)chasank/Image-Rectification のインストールと画像補正の実行(画像補正)(Python を使用)(Windows 上)

chasank/Image-Rectification のインストールと画像補正の実行(画像補正)(Python を使用)(Windows 上)

chasank/Image-Rectification をインストールし, 画像補正を行う.

画像補正

画像補正は,画像を射影変換することにより,斜め方向からの撮影画像を正面画像に変換する. 意図しないカメラ回転(ロール、ピッチ、ヨー)を含む画像を正面画像に補正できる.

また,AIの事前学習は,通常,正面画像で行われることが多く,画像補正を使うことで,AIの推論をより精度よく行うことができると期待できる.

[image] [image]

文献

Chaudhury, Krishnendu, Stephen DiVerdi, and Sergey Ioffe. "Auto-rectification of user photos." 2014 IEEE International Conference on Image Processing (ICIP). IEEE, 2014.

資料

PDFファイル, パワーポイントファイル

サイト内の関連ページ

関連する外部ページ

GitHub のページ: https://github.com/chsasank/Image-Rectification

1. Google Colab へのリンク

Google Colaboratory のページ:

次のリンクをクリックすると,Google Colaboratoryノートブックが開く. そして,Google アカウントでログインすると,Google Colaboratory のノートブック内のコード等を編集したり再実行したりができる.編集した場合でも,他の人に影響が出たりということはない.そして,編集後のものを,各自の Google ドライブ内に保存することもできる.

https://colab.research.google.com/drive/11VNfE_9fEZ3IDAh-jSwVkrRVE6ZGJ4iM?usp=sharing

2. 前準備

Git のインストール(Windows 上)

Gitは,バージョン管理システム.ソースコードの管理や複数人での共同に役立つ.

サイト内の関連ページ

Windows での Git のインストール: 別ページ »で説明している.

関連する外部ページ

Git の公式ページ: https://git-scm.com/

Python のインストール(Windows 上)

サイト内の関連ページ

関連する外部ページ

Python の公式ページ: https://www.python.org/

3. chasank/Image-Rectification のインストール

  1. Windows で,コマンドプロンプト管理者として実行

    コマンドプロンプトを管理者として実行: 別ページ »で説明

  2. pip更新と,chasank/Image-Rectification のインストール

    ※ 「 python -m pip install ...」は,Python パッケージをインストールするためのコマンド.

    python -m pip install -U --ignore-installed pip
    cd %HOMEPATH%
    rmdir /s /q Image-Rectification
    git clone --recursive https://github.com/chsasank/Image-Rectification
    

    [image]
  3. 同封の画像ファイル shelf.jpg を使って実行してみる.

    次のコマンドを実行

    cd %HOMEPATH%
    cd Image-Rectification
    del results\shelf_warped.png
    python rectification.py results\shelf.jpg
    

    [image]
  4. 実行の結果,result\shelf_warped.png ができる.

    results\shelf.jpg と result\shelf_warped.png

    [image]

    [image]