Skip to content
Snippets Groups Projects
Commit 6c1617c7 authored by Yash Shah's avatar Yash Shah
Browse files

Removing unnecessary files

parent 1b337917
No related branches found
No related tags found
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
import cv2
from picamera import PiCamera
from picamera.array import PiRGBArray
name = 'Yash_1' #replace with your name
cam = PiCamera()
cam.resolution = (512, 304)
cam.framerate = 10
rawCapture = PiRGBArray(cam, size=(512, 304))
img_counter = 0
while True:
for frame in cam.capture_continuous(rawCapture, format="bgr", use_video_port=True):
image = frame.array
cv2.imshow("Press Space to take a photo", image)
rawCapture.truncate(0)
k = cv2.waitKey(1)
rawCapture.truncate(0)
if k%256 == 27: # ESC pressed
break
elif k%256 == 32:
# SPACE pressed
img_name = "dataset/"+ name +"/image_{}.jpg".format(img_counter)
cv2.imwrite(img_name, image)
print("{} written!".format(img_name))
img_counter += 1
if k%256 == 27:
print("Escape hit, closing...")
break
cv2.destroyAllWindows()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment