Skip to content

Commit

Permalink
Merge pull request #15 from tobybreckon/fps-display
Browse files Browse the repository at this point in the history
update patent status
  • Loading branch information
tobybreckon authored Sep 22, 2023
2 parents c5287de + c0711ee commit 0a3e863
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ If you are making use of this work in any way please reference the following art
}
```

For non-commercial use (i.e. academic, non-for-profit and research) the (very permissive) terms of the MIT free software [LICENSE](LICENSE) must be adhered to.
Free for commercial use and non-commercial use (i.e. academic, non-for-profit and research) under the (very permissive) terms of the MIT free software [LICENSE](LICENSE) that must be adhered to.

For commercial use, the Division of Gaussians (DIVoG / DoG) saliency detection algorithm is patented (WIPO reference: [WO2013034878A3](https://patents.google.com/patent/WO2013034878A3/)) and available for licensing via [Cranfield University](https://www.cranfield.ac.uk/).
The Division of Gaussians (DIVoG / DoG) saliency detection algorithm was filed as a patent (WIPO reference: [WO2013034878A2](https://patents.google.com/patent/WO2013034878A2/) by [Cranfield University](https://www.cranfield.ac.uk/), 2013/14) but this patent application has now lasped.

### Acknowledgements:

Expand Down
10 changes: 9 additions & 1 deletion camera_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def __init__(self, src=None, backend=None,
# set the initial timestamps to zero
self.timestamp = 0
self.timestamp_last_read = 0
self.use_timestamps = False

# set internal framecounters to -1
self.framecounter = -1
Expand All @@ -141,18 +142,24 @@ def __init__(self, src=None, backend=None,
# set some sensible backends for real-time video capture from
# directly connected hardware on a per-OS basis,
# that can we overidden via the open() method
# + remember timestamps only seem to work on linux
if sys.platform.startswith('linux'): # all Linux
self.backend_default = cv2.CAP_V4L
self.use_timestamps = True
elif sys.platform.startswith('win'): # MS Windows
self.backend_default = cv2.CAP_DSHOW
self.use_timestamps = False
elif sys.platform.startswith('darwin'): # macOS
self.backend_default = cv2.CAP_AVFOUNDATION
self.use_timestamps = False
else:
self.backend_default = cv2.CAP_ANY # auto-detect via OpenCV

# if a source was specified at init, proceed to open device
if not (src is None):
self.open(src, backend)
if not (backend == cv2.CAP_V4L):
self.use_timestamps = False

def open(self, src=0, backend=None):

Expand Down Expand Up @@ -212,7 +219,8 @@ def update(self):
if not (self.suspend):
self.camera.grab()
latest_timestamp = self.camera.get(cv2.CAP_PROP_POS_MSEC)
if (latest_timestamp > self.timestamp):
if ((latest_timestamp > self.timestamp)
or (self.use_timestamps is False)):
(self.grabbed, self.frame) = self.camera.retrieve()
self.framecounter += 1
logging.info("GRAB - frame %d @ time %f",
Expand Down

0 comments on commit 0a3e863

Please sign in to comment.