From f0044c29c9eeee77458a5f907b74be03761265b5 Mon Sep 17 00:00:00 2001 From: Mohd Afzal Khan <79896602+AFZL210@users.noreply.github.com> Date: Tue, 4 Oct 2022 20:20:28 +0530 Subject: [PATCH 1/7] Create main.py --- scripts/OpenCV GrayImage/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/OpenCV GrayImage/main.py diff --git a/scripts/OpenCV GrayImage/main.py b/scripts/OpenCV GrayImage/main.py new file mode 100644 index 0000000..352e56b --- /dev/null +++ b/scripts/OpenCV GrayImage/main.py @@ -0,0 +1,10 @@ +import cv2 + +cap = cv2.VideoCapture(0) + +while True: + success, img = cap.read() + grayImg = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) + cv2.imshow("Grayimage", grayImg) + cv2.imshow("image",img) + cv2.waitKey(10) From 2386b980b5b82dc32e46aaa02866b4000441fbec Mon Sep 17 00:00:00 2001 From: Mohd Afzal Khan <79896602+AFZL210@users.noreply.github.com> Date: Tue, 4 Oct 2022 20:22:57 +0530 Subject: [PATCH 2/7] Create readme.md --- scripts/OpenCV GrayImage/readme.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/OpenCV GrayImage/readme.md diff --git a/scripts/OpenCV GrayImage/readme.md b/scripts/OpenCV GrayImage/readme.md new file mode 100644 index 0000000..01facf9 --- /dev/null +++ b/scripts/OpenCV GrayImage/readme.md @@ -0,0 +1,17 @@ + +## Run Locally + +Clone the project + +Install dependencies + +```bash + pip install opencv-python +``` + +Run the main.py file + +```bash + python main.py +``` + From a3ee5241566d1f011e1b9edc158a4ad489f6ffb8 Mon Sep 17 00:00:00 2001 From: lordvader501 <60027612+lordvader501@users.noreply.github.com> Date: Wed, 5 Oct 2022 10:40:16 +0530 Subject: [PATCH 3/7] code to resize images --- scripts/Image_resizer/readme.md | 21 +++++++++++++++++++++ scripts/Image_resizer/resize.py | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 scripts/Image_resizer/readme.md create mode 100644 scripts/Image_resizer/resize.py diff --git a/scripts/Image_resizer/readme.md b/scripts/Image_resizer/readme.md new file mode 100644 index 0000000..b9d6920 --- /dev/null +++ b/scripts/Image_resizer/readme.md @@ -0,0 +1,21 @@ +# IMAGE RESIZER +### Resize image to partiular dimensions. + +This python code takes image that needs to be resised and it uses Pillow module to resize the image by given dimensions entered by user and saves the resized image. + +#### Requirements: +* Install Pillow module. +* run `pip install pillow` + +### Usage +* Clone the repo +* open the `Image-resizer` folder +* copy the image that you want to resize to this folder +* open cmd in `image-resizer` folder +##### for windows +* run `python resize.py` +##### for linux +* run `python3 resize.py` +* after that type the name of the image file in images folder (ex: img.jpg, pic.png...) +* enter the dimensions in the format(eg 1024x720 , 600x300...) +* now your resized image is saved in folder. diff --git a/scripts/Image_resizer/resize.py b/scripts/Image_resizer/resize.py new file mode 100644 index 0000000..16b38a4 --- /dev/null +++ b/scripts/Image_resizer/resize.py @@ -0,0 +1,11 @@ +from PIL import Image as img +import os + +file_name = input("Enter anpe of file: ") +name , ext = file_name.split('.') +pic = img.open((os.path.join(os.path.dirname(os.path.abspath(__file__)),file_name))) + +ht, wt= input("Enter dimenstions(eg: 1024x720): ").split('x') +dim = int(ht), int(wt) +img_resize = pic.resize(dim) +img_resize.save((os.path.join(os.path.dirname(os.path.abspath(__file__)),f'{name}_resized.{ext}'))) \ No newline at end of file From 30c4e3790fe6982f9ee6c3e07c7c1e532b418d4e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Oct 2022 05:34:51 +0000 Subject: [PATCH 4/7] docs(contributor): contrib-readme-action has updated readme --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7c6f6ef..4c794a2 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,13 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Aswin Shailajan +