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

The following error occurred while running the imwrite function

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

What’s the reason for this

cv.imwrite(**'skeleton',**skeleton)

No suffixes, JPG, PNG, etc… Change it to the following

cv.imwrite('skeleton.jpg',skeleton)

Read More: