Learning OpenCV Day one

运行demo文件:

import cv2
image = cv2.imread('MyPic.png')
cv2.imwrite('MyPic.jpg', image)

出现如下错误

cv2.error: OpenCV(4.5.1) /tmp/opencv-20210108-6455-1src644/opencv-4.5.1/modules/imgcodecs/src/loadsave.cpp:753: error: (-215:Assertion failed) !_img.empty() in function 'imwrite'

修改mypic.png为绝对路径(/Users/m…/Study/learningOC/MyPic.png),修复完成。