Skip to content

Commit fdeed9a

Browse files
committed
Image Diver code using opencv in python added
1 parent 3c25885 commit fdeed9a

File tree

7 files changed

+30
-0
lines changed

7 files changed

+30
-0
lines changed

ImageDivider/ImageDivider.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import cv2
2+
3+
img = cv2.imread('imaag.jpg')
4+
height,width,channels= img.shape
5+
6+
left = img[:,:width//2]
7+
right = img[:,width//2:]
8+
9+
cv2.imshow('original', img)
10+
cv2.imshow('Left Half', left)
11+
cv2.imshow('Right half', right)
12+
13+
cv2.imwrite('Left.jpg', left)
14+
cv2.imwrite('Right.jpg', right)
15+
cv2.waitKey(0)

ImageDivider/Left.jpg

16.4 KB
Loading

ImageDivider/Readme.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Dividing an image into euqal halves using OpenCV
2+
3+
### Requirements
4+
```python
5+
pip install opencv-python
6+
```
7+
8+
### Steps
9+
- Navigate to this folder.
10+
- Upload an image of your choice.
11+
- Tweak the code by changing the file name to your name
12+
- Hit run and you are done!!
13+
14+
Note: This code will divide the images vertically.

ImageDivider/Right.jpg

26.9 KB
Loading

ImageDivider/Screenshot .png

611 KB
Loading

ImageDivider/imaag.jpg

57.1 KB
Loading

ImageDivider/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
opencv-python

0 commit comments

Comments
 (0)