keep-loving-pythonのブログ

Pythonを愛し続けたいです(Pythonが流行っている限りですが。。。)

2022-11-01から1ヶ月間の記事一覧

OpenCVによる撮影画像の連結をいろいろ試してみる【4】

OpenCVによる撮影画像の連結をいろいろ試してみる【4】 基本は、GitHub等のコードを動かすだけ。 OpenCV-4-with-Python-Blueprints-Second-Edition これも、比較的シンプルなもの 環境 windows10 python3.7 opencv-python 4.5.3.56 URL https://github.com/P…

解決策。AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d_SURF'

解決策。AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d_SURF' エラーの内容 エラー AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d_SURF' エラーの全体 Traceback (most recent call last): File "panorama.py", line …

解決策。cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'drawMarker'

cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'drawMarker' エラー エラーの内容 cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'drawMarker' エラー全体 Traceback (most recent call last): File "opencv_…

【重要!】Python OpenCV のメソッドの仕様の調べ方 (実演編!)

Python OpenCV のメソッドの仕様の調べ方 (実演編!) 以下の記事の実演編です。 keep-loving-python.hatenablog.com 実演 以下のようなコードを動かしてみます。 画像にマーカを書くコードです。 図形にマーカを書くコードとして、参考にしたのは、コード内…

【重要!】Python OpenCV のメソッドの仕様の調べ方

Python OpenCV のメソッドの仕様の調べ方 これ、重要です。見失うと悶絶します(先ほど、しました!) だから、安全のために、記事に。 調べ方 import cv2 import inspect print(inspect.getdoc(cv2.drawMarker)) 結果の表示は、 drawMarker(img, position, …

OpenCVによる撮影画像の連結をいろいろ試してみる【3】

OpenCVによる撮影画像の連結をいろいろ試してみる【3】 基本は、GitHub等のコードを動かすだけ。 ORB feature based image stitching for UAV images これも、比較的シンプルなもの 環境 windows10 python3.7 ↓ pip opencv-contrib-python 4.6.0.66 URL http…

OpenCVによる撮影画像の連結をいろいろ試してみる【2】

OpenCVによる撮影画像の連結をいろいろ試してみる【2】 基本は、GitHub等のコードを動かすだけ。 Stitch image from drone capture farm area これも、比較的シンプルなもの 環境 windows10 python3.7 cv2.version.opencv_version 4.6.0.66 <--実行時に確認 …

【Python多少深掘り】importどうなってる。(OpenCV編)

importどうなってる。(OpenCV編) 自分の端末で、pip listでみると、以下のようにcontribとそうじゃないのが入っている。 opencv-contrib-python 4.5.3.56 opencv-python 4.6.0.66 何がimportされたかの調べ方 結局、それほど、わかりませんが、自分がいま到…

解決策。cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'imwrite'

解決策。cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'imwrite' エラー エラー cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'imwrite' エラー詳細 Traceback (most recent call last): File "test01.py",…

解決策。cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'cvtColor'

解決策。cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'cvtColor' エラー エラー エラー詳細 環境 解決策 解決策。cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'cvtColor' エラー エラー cv2.error: OpenC…

解決策。cv2.error: OpenCV(4.5.3) ..... error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

解決策。cv2.error: OpenCV(4.5.3) ..... error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor' これは 、ポカに近いもの。 エラー エラー cv2.error: OpenCV(4.5.3) ..... error: (-215:Assertion failed) !_src.empty() in function …

解決策。TypeError: only integer scalar arrays can be converted to a scalar index

解決策。TypeError: only integer scalar arrays can be converted to a scalar index エラー エラー内容 TypeError: only integer scalar arrays can be converted to a scalar index ↓ 詳細 Traceback (most recent call last): File "stitching_detailed.…

解決策。AttributeError: 'Namespace' object has no attribute 'func'

解決策。AttributeError: 'Namespace' object has no attribute 'func' AttributeError: 'Namespace' object has no attribute 'xxx' xxxの部分は、いろいろ。 エラーの内容 エラー AttributeError: 'Namespace' object has no attribute 'func' エラー詳細 …

OpenCVによる撮影画像の連結をいろいろ試してみる【1】

OpenCVによる撮影画像の連結をいろいろ試してみる【1】 基本は、GitHubのコードを動かすだけ。 ORB feature based image stitching for UAV images 比較的シンプルなもの 環境 windows10 python3.7 cv2.version.opencv_version 4.5.3.56 <--実行時に確認 ↓ p…

(狭い視点ですが)DoxygenでPythonを扱うのは無理です。

(狭い視点ですが)DoxygenでPythonを扱うのは無理です。 検討条件 windows10 python3.7 doxygen1.9.5(2022/11/03にインストール) 検討結果 対象のpythonコード import sys def tasu(aa,bb): c = aa + bb return c d = tasu(10,20) if d > 5: print("d",d) els…

Pythonあるある。何の説明もなく、プロンプトに戻る。

Pythonあるある。何の説明もなく、プロンプトに戻る。 [Pythonあるある]症状 正常に動作すると、例えば、何かのprintがされるようなもので、 下記のように、何も起こらずに、プロンプトに戻る。 C:\_JITAKU_DE_GYOMU\....ing-master>python XXXXching.py C:\…

解決策。cv2.error: OpenCV(4.5.3) C:\Users\......src\alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 148879029 bytes in function 'cv::OutOfMemoryError'

解決策。cv2.error: OpenCV(4.5.3) C:\Users......src\alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 148879029 bytes in function 'cv::OutOfMemoryError' エラー 環境 windows10 python3.7 エラー cv2.error: OpenCV(4.5.3) C:\Users…