Skip to content

Commit 9a84f04

Browse files
authored
Flip Images
1 parent eac4eaa commit 9a84f04

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

flip_images.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import cv2, os
2+
3+
def flip_images():
4+
gest_folder = "gestures"
5+
images_labels = []
6+
images = []
7+
labels = []
8+
for g_id in os.listdir(gest_folder):
9+
for i in range(1200):
10+
path = gest_folder+"/"+g_id+"/"+str(i+1)+".jpg"
11+
new_path = gest_folder+"/"+g_id+"/"+str(i+1+1200)+".jpg"
12+
print(path)
13+
img = cv2.imread(path, 0)
14+
img = cv2.flip(img, 1)
15+
cv2.imwrite(new_path, img)
16+
17+
flip_images()

0 commit comments

Comments
 (0)