From 991a551dc17ed2cab98bb9a09a71ddf4cafa08e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LZANE=20=7C=20=E6=9D=8E=E6=B3=BD=E5=B8=86?= Date: 2019年2月12日 11:27:21 +0800 Subject: [PATCH 1/3] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e6f2ada --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 LZANE | 李泽帆 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From c467c33a193c8328bbdab71b1d914c4ae00284fa Mon Sep 17 00:00:00 2001 From: Vinay Kumar Verma <31174918+vermavinay982@users.noreply.github.com> Date: 2019年4月23日 11:45:19 +0530 Subject: [PATCH 2/3] Fixed the closing of windows and releasing of camera. after the execution of program the camera is struck and cant be used again. python goes into error and stops responding and the windows remain struck there as they were. this error is repaired now --- new.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/new.py b/new.py index 70182df..efbb028 100644 --- a/new.py +++ b/new.py @@ -122,6 +122,8 @@ def calculateFingers(res,drawing): # -> finished bool, cnt: finger count # Keyboard OP k = cv2.waitKey(10) if k == 27: # press ESC to exit + camera.release() + cv2.destroyAllWindows() break elif k == ord('b'): # press 'b' to capture the background bgModel = cv2.createBackgroundSubtractorMOG2(0, bgSubThreshold) @@ -134,4 +136,4 @@ def calculateFingers(res,drawing): # -> finished bool, cnt: finger count print ('!!!Reset BackGround!!!') elif k == ord('n'): triggerSwitch = True - print ('!!!Trigger On!!!') \ No newline at end of file + print ('!!!Trigger On!!!') From 6aa52befa1275725327fe4a4b5fe677ac717ebb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LZANE=20=7C=20=E6=9D=8E=E6=B3=BD=E5=B8=86?= Date: 2019年8月24日 22:42:42 +0800 Subject: [PATCH 3/3] Update README.md opencv4 api changed --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 50392d3..699242f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ > for people using python2 and opencv2, please check out the [`lzane:py2_opencv2`](https://github.com/lzane/Fingers-Detection-using-OpenCV-and-Python/tree/py2_opencv2) branch. +> for people using opencv4, please change line 96 in the `new.py` to `contours, hierarchy = cv2.findContours(thresh1, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)` according to the [opencv api change](https://github.com/lzane/Fingers-Detection-using-OpenCV-and-Python/issues/7#issuecomment-509925971). + + ## Environment - OS: MacOS El Capitan - Platform: Python 3

AltStyle によって変換されたページ (->オリジナル) /