Opencv4をOpencv3にダウングレードする。
- pipでインストールしたOpenCVのVersionは4.0であった。
- 4.0は一部関数で変更がある(findCountoursの戻り値が換わっていた)
- 現状は使い慣れたほうが良いので3.4.4にダウングレードした。
目次
OpenCV4.0をアンインストール
pip3 uninstall opencv-python opencv-contrib-python
以下の様になればOK。
Proceed (y/n)? y Successfully uninstalled opencv-python-4.0.0.21 Proceed (y/n)? y Successfully uninstalled opencv-contrib-python-4.0.0.21
OpenCV3.4.4をインストール
- Verは何でもいい。今回はなんとなく3.4.4を選択。
- パッケージの管理番号?がないためエラーになった。
エラー
pip3 install opencv-python==3.4.4
うまく行かなかったが、
エラーを確認するとversion番号の後に管理No?が必要。
3.4.4の場合は「19」。
Collecting opencv-python==3.4.4 Could not find a version that satisfies the requirement opencv-python==3.4.4 (from versions: 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18, 3.4.4.19, 3.4.5.20, 4.0.0.21) No matching distribution found for opencv-python==3.4.4
解決
contribも同じversionでインストールしてます。
pip3 install opencv-python==3.4.4.19 opencv-contrib-python==3.4.4.19
ダウングレード完了。
以上。