LoginSignup
0
0

cv2.error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp:696: error: (-2:Unspecified error) could not find a writer for the specified extension in function 'cv::imwrite_'

Posted at

エラー内容の共有

circle.py
import numpy as np
import cv2

img = np.zeros((400,400,3), np.uint8)
cv2.circle(img, (200, 200), 50, (255, 0, 0), 1)
cv2.imwrite(r'C:\Users\tmasa\OpenCV4_Programming_Getting_Started_in_Python\circle1.img', img)
cv2.imshow('img1',img)

これの実行時にエラーが出ました。

解決方法

拡張子が.imgになってました。.pngですね…

0
0
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
0
0