Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
image capture with  draw pattern
  • Loading branch information
redashu authored Jun 23, 2018
1 parent 8708cc0 commit 3e704ac
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions camera.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/python

import cv2
import random
# now starting cam

cap=cv2.VideoCapture(0)

while cap.isOpened() :
print "camera is working"
status,frame=cap.read()
bwimg=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
cv2.rectangle(frame,(100,100),(200,200),(0,0,255),2)
font=cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(frame,'classroom',(100,100),font,2,(255,0,0),cv2.line_AA)
cv2.imshow("camera1",frame)
x=random.random()
y=str(x)[2:6]
cv2.imwrite('adhoc'+y+'.jpg',frame)
#cv2.imshow("camera2",bwimg)
if cv2.waitKey(1) & 0xFF == ord('q') :
break

cv2.destroyAllWindows()
cap.release()


0 comments on commit 3e704ac

Please sign in to comment.