Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansalemaos/a_cv2_easy_resize
Different ways of resizing pictures in OpenCV
https://github.com/hansalemaos/a_cv2_easy_resize
images opencv python resize
Last synced: 20 days ago
JSON representation
Different ways of resizing pictures in OpenCV
- Host: GitHub
- URL: https://github.com/hansalemaos/a_cv2_easy_resize
- Owner: hansalemaos
- License: mit
- Created: 2022-11-24T13:13:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-24T13:13:26.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T07:46:54.732Z (about 1 month ago)
- Topics: images, opencv, python, resize
- Language: Python
- Homepage: https://pypi.org/project/a-cv2-easy-resize
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
### Different ways of resizing pictures in OpenCV
```python
pip install a-cv2-easy-resizefrom a_cv2_easy_resize import add_easy_resize_to_cv2
from a_cv_imwrite_imread_plus import add_imwrite_plus_imread_plus_to_cv2
add_imwrite_plus_imread_plus_to_cv2()
add_easy_resize_to_cv2()
import cv2
pic = cv2.imread_plus(r"https://raw.githubusercontent.com/hansalemaos/screenshots/main/splitted1.jpeg")
pic1 = cv2.easy_resize_image(
pic.copy(), width=200, height=None, percent=None, interpolation=cv2.INTER_AREA
)
pic2 = cv2.easy_resize_image(
pic.copy(), width=None, height=200, percent=None, interpolation=cv2.INTER_AREA
)
pic3 = cv2.easy_resize_image(
pic.copy(), width=100, height=200, percent=None, interpolation=cv2.INTER_AREA
)
pic4 = cv2.easy_resize_image(
pic.copy(), width=None, height=None, percent=40, interpolation=cv2.INTER_AREA
)
pic5 = cv2.easy_resize_image(
pic.copy(), width=None, height=None, percent=None, interpolation=cv2.INTER_AREA
) # returns original
cv2.imwrite('f:\\papagei\\pic1.png', pic1)
cv2.imwrite('f:\\papagei\\pic2.png', pic2)
cv2.imwrite('f:\\papagei\\pic3.png', pic3)
cv2.imwrite('f:\\papagei\\pic4.png', pic4)
cv2.imwrite('f:\\papagei\\pic5.png', pic5)```