This commit is contained in:
glmdev 2019-02-10 01:00:14 -06:00
parent f0b35991e8
commit 5a8940da7b
2 changed files with 17 additions and 12 deletions

View File

@ -16,7 +16,7 @@
<entry file="file://$PROJECT_DIR$/index.py"> <entry file="file://$PROJECT_DIR$/index.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450"> <state relative-caret-position="450">
<caret line="42" column="46" lean-forward="true" selection-start-line="42" selection-start-column="46" selection-end-line="42" selection-end-column="46" /> <caret line="42" column="46" selection-start-line="42" selection-start-column="46" selection-end-line="42" selection-end-column="46" />
<folding> <folding>
<element signature="e#0#21#0" expanded="true" /> <element signature="e#0#21#0" expanded="true" />
</folding> </folding>
@ -32,8 +32,8 @@
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/camera.py"> <entry file="file://$PROJECT_DIR$/camera.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150"> <state relative-caret-position="240">
<caret line="10" column="9" lean-forward="true" selection-start-line="10" selection-start-column="9" selection-end-line="10" selection-end-column="9" /> <caret line="16" column="29" selection-start-line="16" selection-start-column="29" selection-end-line="16" selection-end-column="29" />
<folding> <folding>
<element signature="e#0#13#0" expanded="true" /> <element signature="e#0#13#0" expanded="true" />
</folding> </folding>
@ -191,7 +191,7 @@
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" /> <window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" /> <window_info anchor="bottom" id="Version Control" order="7" />
<window_info active="true" anchor="bottom" id="Terminal" order="8" visible="true" weight="0.32972974" /> <window_info anchor="bottom" id="Terminal" order="8" weight="0.32972974" />
<window_info anchor="bottom" id="Python Console" order="9" /> <window_info anchor="bottom" id="Python Console" order="9" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" /> <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" /> <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
@ -254,7 +254,7 @@
<entry file="file://$PROJECT_DIR$/index.py"> <entry file="file://$PROJECT_DIR$/index.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450"> <state relative-caret-position="450">
<caret line="42" column="46" lean-forward="true" selection-start-line="42" selection-start-column="46" selection-end-line="42" selection-end-column="46" /> <caret line="42" column="46" selection-start-line="42" selection-start-column="46" selection-end-line="42" selection-end-column="46" />
<folding> <folding>
<element signature="e#0#21#0" expanded="true" /> <element signature="e#0#21#0" expanded="true" />
</folding> </folding>
@ -277,8 +277,8 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/camera.py"> <entry file="file://$PROJECT_DIR$/camera.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150"> <state relative-caret-position="240">
<caret line="10" column="9" lean-forward="true" selection-start-line="10" selection-start-column="9" selection-end-line="10" selection-end-column="9" /> <caret line="16" column="29" selection-start-line="16" selection-start-column="29" selection-end-line="16" selection-end-column="29" />
<folding> <folding>
<element signature="e#0#13#0" expanded="true" /> <element signature="e#0#13#0" expanded="true" />
</folding> </folding>

View File

@ -4,12 +4,17 @@ import time
import cv2 import cv2
def capture(camera_stream = 0, camera_res = (1920, 1080)): from SimpleCV import Image, Camera
cam = cv2.VideoCapture(camera_stream)
s, img = cam.read()
if s: def capture(camera_stream = 0, camera_res = (1920, 1080)):
cv2.imwrite('./capture.jpg', img) # cam = cv2.VideoCapture(camera_stream)
# s, img = cam.read()
#
# if s:
# cv2.imwrite('./capture.jpg', img)
cam = Camera()
img = cam.getImage()
img.save('./capture.jpg')
# pygame.camera.init() # pygame.camera.init()
# pygame.camera.list_cameras() # pygame.camera.list_cameras()
# cam = pygame.camera.Camera(camera_stream, camera_res) # cam = pygame.camera.Camera(camera_stream, camera_res)