Ask Your Question

Revision history [back]

error: (-2:Unspecified error) could not find a writer for the specified extension in function cv::imwrite

'''prediciton using distance''' for embedding in embeds: diff = np.subtract(saved_embeds, embedding) dist = np.sum(np.square(diff), 1) idx = np.argmin(dist) if dist[idx] < threshold: predictions.append(names[idx]) cv2.imwrite(names[idx],frame)

why the image is not saved ?? getting this error : error: OpenCV(4.3.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-b460jg4o\opencv\modules\imgcodecs\src\loadsave.cpp:667: error: (-2:Unspecified error) could not find a writer for the specified extension in function 'cv::imwrite_'

error: (-2:Unspecified error) could not find a writer for the specified extension in function cv::imwrite

'''prediciton using distance''' distance'''

for embedding in embeds:
      diff = np.subtract(saved_embeds, embedding)
      dist = np.sum(np.square(diff), 1)
      idx = np.argmin(dist)
      if dist[idx] < threshold:
           predictions.append(names[idx])
                        cv2.imwrite(names[idx],frame)

cv2.imwrite(names[idx],frame)

why the image is not saved ?? getting this error : :

error: OpenCV(4.3.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-b460jg4o\opencv\modules\imgcodecs\src\loadsave.cpp:667: error: (-2:Unspecified error) could not find a writer for the specified extension in function 'cv::imwrite_'

'cv::imwrite_'