lzane / Fingers-Detection-using-OpenCV-and-Python

A simple Fingers Detection (or Gesture Recognition) using OpenCV and Python with background substraction 简单手势识别
https://www.lzane.com
MIT License
437 stars 176 forks source link

Deprecated code #4

Closed shakram02 closed 6 years ago

shakram02 commented 6 years ago

This line

 bgModel = cv2.BackgroundSubtractorMOG2(0, bgSubThreshold)

should be

cv2.createBackgroundSubtractorMOG2(0, bgSubThreshold)

and

contours, hierarchy = cv2.findContours(thresh1, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

should be

x, contours, y = cv2.findContours(thresh1, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
lzane commented 6 years ago

Thank you for pointing this out. But I don't have time to make modify the code.

Could you please change the code and then create a pull request? Thx~

shakram02 commented 6 years ago

Done, I edited it in the browser, couldn't re-check the code. but it's working on my machine

uw

lzane commented 6 years ago

Actually I just find out that this "Deprecated code" problem has already been solved by other contributors. You can find it in branch lzane:py3_opencv3.

I have the following announcement in the very beginning of the README

for people using python3 and opencv3, please check out the lzane:py3_opencv3 branch.

I leave the original code just for people who use python2 and OpenCV2.

I closed your issue and pull request. Anyway, thanks for your contribution.

shakram02 commented 6 years ago

I suggest that you swap the python3 branch to be master. Thanks a lot :+1:

lzane commented 6 years ago

@shakram02 I agree with you, done.