diff --git a/MANIFEST b/MANIFEST index 34da653..8b7a659 100644 --- a/MANIFEST +++ b/MANIFEST @@ -10,3 +10,8 @@ imutils/meta.py imutils/object_detection.py imutils/paths.py imutils/perspective.py +imutils/video/__init__.py +imutils/video/fps.py +imutils/video/pivideostream.py +imutils/video/videostream.py +imutils/video/webcamvideostream.py diff --git a/imutils/contours.py b/imutils/contours.py index 22e54b4..f51dcca 100644 --- a/imutils/contours.py +++ b/imutils/contours.py @@ -4,7 +4,6 @@ # import the necessary packages import cv2 - def sort_contours(cnts, method="left-to-right"): # initialize the reverse flag and sort index reverse = False diff --git a/imutils/video/__init__.py b/imutils/video/__init__.py index 9d2648e..8caf364 100644 --- a/imutils/video/__init__.py +++ b/imutils/video/__init__.py @@ -1,4 +1,4 @@ # import the necessary packages -from fps import FPS -from videostream import VideoStream -from webcamvideostream import WebcamVideoStream \ No newline at end of file +from .fps import FPS +from .videostream import VideoStream +from .webcamvideostream import WebcamVideoStream \ No newline at end of file diff --git a/imutils/video/pivideostream.py b/imutils/video/pivideostream.py index 07d7575..c7c5931 100644 --- a/imutils/video/pivideostream.py +++ b/imutils/video/pivideostream.py @@ -21,7 +21,9 @@ def __init__(self, resolution=(320, 240), framerate=32): def start(self): # start the thread to read frames from the video stream - Thread(target=self.update, args=()).start() + t = Thread(target=self.update, args=()) + t.daemon = True + t.start() return self def update(self): diff --git a/imutils/video/videostream.py b/imutils/video/videostream.py index 29d7d76..f5d761c 100644 --- a/imutils/video/videostream.py +++ b/imutils/video/videostream.py @@ -1,5 +1,5 @@ # import the necessary packages -from webcamvideostream import WebcamVideoStream +from .webcamvideostream import WebcamVideoStream class VideoStream: def __init__(self, src=0, usePiCamera=False, resolution=(320, 240), @@ -10,7 +10,7 @@ def __init__(self, src=0, usePiCamera=False, resolution=(320, 240), # explicity told to do so -- this helps remove the # requirement of `picamera[array]` from desktops or # laptops that still want to use the `imutils` package - from pivideostream import PiVideoStream + from .pivideostream import PiVideoStream # initialize the picamera stream and allow the camera # sensor to warmup diff --git a/imutils/video/webcamvideostream.py b/imutils/video/webcamvideostream.py index b879c37..37bfc07 100644 --- a/imutils/video/webcamvideostream.py +++ b/imutils/video/webcamvideostream.py @@ -15,7 +15,9 @@ def __init__(self, src=0): def start(self): # start the thread to read frames from the video stream - Thread(target=self.update, args=()).start() + t = Thread(target=self.update, args=()) + t.daemon = True + t.start() return self def update(self): diff --git a/setup.py b/setup.py index 127dce5..ccbdf1a 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='imutils', packages=['imutils', 'imutils.video'], - version='0.3.3', + version='0.3.4', description='A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeletonization, displaying Matplotlib images, sorting contours, detecting edges, and much more easier with OpenCV and both Python 2.7 and Python 3.', author='Adrian Rosebrock', author_email='adrian@pyimagesearch.com',