Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vilib/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.12"
__version__ = "0.3.13"
15 changes: 14 additions & 1 deletion vilib/vilib.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
# print(f"user: {user}")
# print(f"user_home: {user_home}")

# init picamera2 reference
pi_camera_2 = None

# Default path for pictures and videos
DEFAULLT_PICTURES_PATH = '%s/Pictures/vilib/'%user_home
DEFAULLT_VIDEOS_PATH = '%s/Videos/vilib/'%user_home
Expand Down Expand Up @@ -225,15 +228,25 @@ class Vilib(object):
objects_detection_labels = None
qrcode_detect_sw = False
traffic_detect_sw = False


@staticmethod
def get_instance():
global pi_camera_2
return pi_camera_2


@staticmethod
def camera():
global pi_camera_2
Vilib.camera_width = Vilib.camera_size[0]
Vilib.camera_height = Vilib.camera_size[1]

# init picamera
picam2 = Picamera2()

# set global reference
pi_camera_2 = picam2

preview_config = picam2.preview_configuration
# preview_config.size = (800, 600)
preview_config.size = Vilib.camera_size
Expand Down