techwestcoastsfosea
techwestcoastsfosea

Reputation: 778

Python OpenCV how to save an image after transforming it

I am new to python. I am using opencv to tranform an image.
Below are the two last lines in the script:

warped = warped.astype("uint8") * 255
cv2.imshow("Scanned", imutils.resize(warped, height = 650))

I would like to save the warped image as a jpeg file.
How do I go about it?

Upvotes: 5

Views: 11169

Answers (1)

biozid bostami
biozid bostami

Reputation: 664

First hold the modified image in a variable, then use the following command:

cv2.imwrite("IMAGE_NAME.png", warpedimage)

Upvotes: 7

Related Questions