default res
This commit is contained in:
parent
5a8940da7b
commit
0a76d0099e
@ -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="240">
|
<state relative-caret-position="75">
|
||||||
<caret line="16" column="29" selection-start-line="16" selection-start-column="29" selection-end-line="16" selection-end-column="29" />
|
<caret line="5" column="65" selection-start-line="5" selection-start-column="65" selection-end-line="5" selection-end-column="65" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="e#0#13#0" expanded="true" />
|
<element signature="e#0#13#0" expanded="true" />
|
||||||
</folding>
|
</folding>
|
||||||
@ -41,6 +41,11 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
|
<file pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/capture.jpg">
|
||||||
|
<provider selected="true" editor-type-id="images" />
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/.gitignore">
|
<entry file="file://$PROJECT_DIR$/.gitignore">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
@ -277,8 +282,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="240">
|
<state relative-caret-position="75">
|
||||||
<caret line="16" column="29" selection-start-line="16" selection-start-column="29" selection-end-line="16" selection-end-column="29" />
|
<caret line="5" column="65" selection-start-line="5" selection-start-column="65" selection-end-line="5" selection-end-column="65" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="e#0#13#0" expanded="true" />
|
<element signature="e#0#13#0" expanded="true" />
|
||||||
</folding>
|
</folding>
|
||||||
|
29
camera.py
29
camera.py
@ -2,27 +2,16 @@ import pygame
|
|||||||
import pygame.camera
|
import pygame.camera
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import cv2
|
|
||||||
|
|
||||||
from SimpleCV import Image, Camera
|
def capture(camera_stream = "/dev/video0", camera_res = (640, 480)):
|
||||||
|
pygame.camera.init()
|
||||||
def capture(camera_stream = 0, camera_res = (1920, 1080)):
|
pygame.camera.list_cameras()
|
||||||
# cam = cv2.VideoCapture(camera_stream)
|
cam = pygame.camera.Camera(camera_stream, camera_res)
|
||||||
# s, img = cam.read()
|
cam.start()
|
||||||
#
|
time.sleep(5)
|
||||||
# if s:
|
img = cam.get_image()
|
||||||
# cv2.imwrite('./capture.jpg', img)
|
pygame.image.save(img, './capture.jpg')
|
||||||
cam = Camera()
|
cam.stop()
|
||||||
img = cam.getImage()
|
|
||||||
img.save('./capture.jpg')
|
|
||||||
# pygame.camera.init()
|
|
||||||
# pygame.camera.list_cameras()
|
|
||||||
# cam = pygame.camera.Camera(camera_stream, camera_res)
|
|
||||||
# cam.start()
|
|
||||||
# time.sleep(5)
|
|
||||||
# img = cam.get_image()
|
|
||||||
# pygame.image.save(img, './capture.jpg')
|
|
||||||
# cam.stop()
|
|
||||||
return './capture.jpg'
|
return './capture.jpg'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user