Ask Your Question
0

Am getting NULL without setting an error on cv2.imwrite

asked 2020-02-26 13:07:24 -0500

BStrum gravatar image

updated 2020-02-26 13:28:51 -0500

supra56 gravatar image

Here is the full error:

cv2.imwrite(fx,Out_File_Path,[int(cv2.IMWRITE_JPEG_QUALITY), 90])
SystemError: <built-in function imwrite> returned NULL without setting an error

cv2.imshow("",YOLO_image) Works fine.

print(type(YOLO_image))  
print(YOLO_image.dtype)

Gives:

<class 'numpy.ndarray'>
uint8

cv2.imwrite(fx,Out_File_Path,[int(cv2.IMWRITE_JPEG_QUALITY), 90]) and cv2.imwrite(fx,Out_File_Path) both generate the error message shown above.

Windows 10 Pro CV2 Ver 4.20

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-02-26 13:36:23 -0500

supra56 gravatar image

That is not the way you write filename as first parameter and fx should be second parameter. This should be like this cv2.imwrite(Out_File_Path, fx,[int(cv2.IMWRITE_JPEG_QUALITY), 90])

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-02-26 13:07:24 -0500

Seen: 151 times

Last updated: Feb 26