私は画像保存機能を作成しようとしています。以下のコードでは、元の画像のコピーをsaved-test-image.jpgとして作成する予定です。OpenCV-Python:imgは整数配列ではなく、スカラーではありません
originalImage = "test-image.jpg"
savedImage = cv2.imwrite("saved-test-image.jpg",originalImage)
ラインの実行は、バックfollwing与える:
Traceback (most recent call last):
File "UnitTest.py", line 159, in test_save_and_delete_image
savedImage = cv2.imwrite('unittest-images/saved-test-image.jpg', originalImage)
TypeError: img is not a numpy array, neither a scalar
ここで変更する必要がありますか?
イメージを最初に '読み込み(..) 'する必要があります。 –