1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Python。OpenCVのバージョンをエラー発生都合で上げたり下げたりする。

Posted at

OpenCVのバージョンをエラー発生都合で上げたり下げたりする。

タイトルの通り。

事例1

エラーメッセージ

TypeError: Expected cv::UMat for argument 'array'

全体としては、以下。

Traceback (most recent call last):
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\multiprocessing\pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\multiprocessing\pool.py", line 47, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "C:\_panorama\_panorama_test01\panoramas-image-stitching-master\src\utils.py", line 75, in cylindrical_projection
    x, y, w, h = cv2.boundingRect(contours[0])
TypeError: Expected cv::UMat for argument 'array'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./main.py", line 29, in <module>
    cylinder_img_list = pool.starmap(utils.cylindrical_projection, [(img_list[i], focal_length[i]) for i in range(len(img_list))])
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\multiprocessing\pool.py", line 276, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\multiprocessing\pool.py", line 657, in get
    raise self._value
TypeError: Expected cv::UMat for argument 'array'

エラーが発生した作業内容

エラー発生時のバージョン

opencv-python-4.1.0.25

エラー解決時のバージョン

opencv-python-3.4.15.55

python -m pip install "opencv < 4.0.0"

まとめ

特にありません。エラーを分析してくれるツールを作りたいとは思っているのですが。。。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?