![]() New_image = cv2.resize(image, dimensions, interpolation=cv2.INTER_LINEAR)Īs you can see, the new image is a bit distorted because we didn't take into account the aspect ratio. We can downscale or upscale an image when resizing it. Let's downscale the original image to 300x300 pixels: import cv2 Resizing with a Specific Width and Height (Don't Preserve Aspect Ratio) Edge and Contour Detection with OpenCV and Python.Morphological Operations with OpenCV and Python.Image Thresholding with OpenCV and Python. ![]() Image Filtering and Blurring with OpenCV and Python.Bitwise Operations and Image Masking with OpenCV and Python.How to Annotate Images with OpenCV and Python (coming soon).How to Rotate Images with OpenCV and Python.How to Crop Images with OpenCV and Python.How to Resize Images with OpenCV and Python (this article).How to Read and Write Videos with OpenCV and Python.How to Read, Write, and Save Images with OpenCV and Python. ![]() This article is part 3 of the tutorial series on computer vision and image processing with OpenCV: See InterpolationFlags for the list of options available.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |