Skip to content

Commit 9ce97e2

Browse files
committed
version update
1 parent f3cce24 commit 9ce97e2

File tree

10 files changed

+16
-73
lines changed

10 files changed

+16
-73
lines changed
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def downsize(img, ratio):
88
tuple(dim // ratio for dim in reversed(img.shape[:2])),
99
interpolation = cv2.INTER_AREA)
1010

11-
def channel_options(img, rank=False):
11+
def channel_options(img):
1212
''' Create a composite image of img in all of opencv's colour channels
1313
1414
|img| -> | blue | green | red |
@@ -17,15 +17,6 @@ def channel_options(img, rank=False):
1717
| lightness | green-red | blue-yellow |
1818
| lightness2 | u | v |
1919
20-
'rank' is a boolean? specifying whether to also return a ranking of each
21-
channel by variability/sharpness/contrast/other? !NOT YET IMPLEMENTED!
22-
TODO
23-
-> make a string maybe, with several options available, or select
24-
multiple options in a list and get back an array or dataframe or
25-
something
26-
-> important to make nicely stackable to run on video and determine
27-
statistics on the best option for a given use case
28-
2920
'''
3021
B,G,R = cv2.split(img)
3122
H,S,V = cv2.split(cv2.cvtColor(img, cv2.COLOR_BGR2HSV))

build/lib/pcv/vidIO.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import cv2
44
import signal
55
import numpy as np
6-
from time import time
6+
from time import perf_counter
77
from queue import Queue
88
from threading import Thread, Event
99
from pcv.interact import DoNothing, waitKey
@@ -227,7 +227,7 @@ def __exit__(self, *args):
227227
if self._verbose_exit and not self._write_queue.empty():
228228
print(f'Writing {self._write_queue.qsize()} remaining frames.')
229229
print('Force quitting may result in a corrupted video file.')
230-
waited = time()
230+
waited = perf_counter()
231231

232232
# finish writing all frames
233233
self._write_queue.join()
@@ -237,7 +237,7 @@ def __exit__(self, *args):
237237

238238
# if wait occurred, inform of completion
239239
if waited and self._verbose_exit:
240-
print(f'Writing complete in {time()-waited:.3f}s.')
240+
print(f'Writing complete in {perf_counter()-waited:.3f}s.')
241241

242242

243243
class OutOfFrames(StopIteration):
@@ -458,10 +458,10 @@ def measure_framerate(self, frames):
458458
cv2.imshow(self.display, frame)
459459
count += 1
460460
if count == 1:
461-
start = time() # avoid timing opening the window
461+
start = perf_counter() # avoid timing opening the window
462462
if count > frames:
463463
# desired frames reached, set fps as average framerate
464-
return count / (time() - start)
464+
return count / (perf_counter() - start)
465465

466466
def __repr__(self):
467467
return f"{self.__class__.__name__}(camera_id={repr(self._id)})"
@@ -723,7 +723,7 @@ def _initialise_playback(self, start, end, skip_frames, verbose):
723723
# ensure time between frames is ignored while paused
724724
class LogDict(dict):
725725
def get(this, *args, **kwargs):
726-
self._prev = time() - (self._period - self.MIN_DELAY) / 1e3
726+
self._prev = perf_counter() - (self._period - self.MIN_DELAY) / 1e3
727727
return dict.get(this, *args, **kwargs)
728728

729729
self._pause_effects = LogDict(self._pause_effects)
@@ -918,15 +918,15 @@ def timestamp_to_ms(timestamp):
918918

919919
def __iter__(self):
920920
if self._delay is not None:
921-
self._prev = time()
921+
self._prev = perf_counter()
922922
self._error = 0
923923
self._delay = 1
924924
return self
925925

926926
def __next__(self):
927927
if self._delay is not None:
928928
# auto-adjust to get closer to desired fps
929-
now = time()
929+
now = perf_counter()
930930
diff = 1e3 * (now - self._prev) # s to ms
931931
self._error += diff - self._timestep
932932

dist/pythonic-cv-1.1.1.tar.gz

-24.8 KB
Binary file not shown.

dist/pythonic-cv-1.1.2.tar.gz

24.6 KB
Binary file not shown.
-24.1 KB
Binary file not shown.
23.8 KB
Binary file not shown.

pcv/helpers.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

pythonic_cv.egg-info/PKG-INFO

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
Metadata-Version: 2.1
22
Name: pythonic-cv
3-
Version: 1.1.1
3+
Version: 1.1.2
44
Summary: Performant pythonic wrapper of unnecessarily painful opencv functionality
55
Home-page: https://github.com/ES-Alexander/pythonic-cv
66
Author: ES-Alexander
77
Author-email: sandman.esalexander@gmail.com
88
License: UNKNOWN
99
Description: _________________________________
10-
Version: 1.1.1
10+
Version: 1.1.2
1111
Author: ES Alexander
12-
Release Date: 29/Jul/2020
12+
Release Date: 12/Aug/2020
1313
_________________________________
1414

1515
# About
@@ -90,7 +90,7 @@ Description: _________________________________
9090
### Basic Camera Stream
9191
```python
9292
from pcv.vidIO import Camera
93-
from pcv.helpers import channel_options, downsize
93+
from pcv.process import channel_options, downsize
9494

9595
# start streaming camera 0 (generally laptop webcam/primary camera), and destroy 'frame'
9696
# window (default streaming window) when finished.
@@ -117,7 +117,7 @@ Description: _________________________________
117117
### VideoReader
118118
```python
119119
from pcv.vidIO import VideoReader
120-
from pcv.helpers import downsize
120+
from pcv.process import downsize
121121

122122
# just play (simple)
123123
with VideoReader('my_vid.mp4') as vid:

pythonic_cv.egg-info/SOURCES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
README.md
22
setup.py
33
pcv/__init__.py
4-
pcv/helpers.py
54
pcv/interact.py
5+
pcv/process.py
66
pcv/something_fishy.py
77
pcv/vidIO.py
88
pythonic_cv.egg-info/PKG-INFO

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='pythonic-cv',
8-
version='1.1.1',
8+
version='1.1.2',
99
author='ES-Alexander',
1010
author_email='sandman.esalexander@gmail.com',
1111
description='Performant pythonic wrapper of unnecessarily painful opencv functionality',

0 commit comments

Comments
 (0)