5,323
edits
(→Usage) |
|||
Line 22: | Line 22: | ||
# Write your output image | # Write your output image | ||
cv2.imwrite("my_modified_image.png", my_image) | cv2.imwrite("my_modified_image.png", my_image) | ||
</syntaxhighlight> | |||
===Resizing an Image=== | |||
[https://docs.opencv.org/master/da/d6e/tutorial_py_geometric_transformations.html Reference] | |||
<syntaxhighlight lang="bash"> | |||
import numpy as np | |||
import cv2 | |||
img = cv2.imread('messi5.jpg') | |||
new_img = cv2.resize(img, (500,200), interpolation = cv.INTER_CUBIC) | |||
</syntaxhighlight> | </syntaxhighlight> | ||