Comments (5)
gesture folder are made but cant save any image over that
from emojinator.
The problem related to not being able to run CreateGest.py is due different versions of OpenCV as cv2.findContours() has varying return signatures in OpenCV 3.4.X, OpenCV 2.X and 4.1.X.
using the code below
contours = cv2.findContours(thresh.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
contours = contours[0] if len(contours) == 2 else contours[1]
instead of
contours = cv2.findContours(thresh.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE) [1]
runs CreateGest.py and saves 1200 images in the folder. However, the images are still not generating good hand contours.
I am using opencv-contrib-python==4.1.1.26
@akshaybahadur21 which opencv version did you use in this project ?
from emojinator.
anyway, the above method in opencv == 4.1.1.26 had contour problem as it was finding black object from white background. This is incorrect because in OpenCV, object to be found should be white and background should be black. So the image needs to be inverted using THRESH_BINARY_INV
as shown below:
ret, thresh = cv2.threshold(opening, 30, 255, cv2.THRESH_BINARY_INV)
instead of :
ret, thresh = cv2.threshold(opening, 30, 255, cv2.THRESH_BINARY)
so the code after all changes is :
# ret, thresh = cv2.threshold(opening, 30, 255, cv2.THRESH_BINARY)
ret, thresh = cv2.threshold(opening, 30, 255, cv2.THRESH_BINARY_INV)
thresh = thresh[y:y + h, x:x + w]
#contours = cv2.findContours(thresh.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)[1]
contours = cv2.findContours(thresh.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
contours = contours[0] if len(contours) == 2 else contours[1]
CreateGest.py runs correctly using above changes in code for opencv version 4.1.1.26
from emojinator.
It is still not creating the gestures
from emojinator.
my create gesture file is completely working but it is not saving the images
from emojinator.
Related Issues (20)
- Please Help HOT 3
- ValueError: invalid literal for int() with base 10: 'es\\3' HOT 2
- got error in get_hand_images.py HOT 2
- Issue with running emojinator.py HOT 1
- Program not working HOT 3
- CreateGest.py and get_hand_images.py both are not working HOT 4
- Got error in CreateGest.py HOT 3
- Error in creategesture
- Index Error during keras predict class
- how use hand_detection_inference_graph for training
- Issue in code HOT 5
- Not able to create new images. I am using code present in CreateGest to create new images. The code is running and the camera is switching ON as well but when i show my hand to create new images the new images are not being added to the folder. The counter present on the left bottom of the screen when camera is opened is also not increasing
- Error in Creategest.py
- Issue: Saving Image
- ERROR: Emojinator v2 is not running HOT 2
- Error in Emojinator_V2.py (label_map_util.py)
- Error in Emojinator_V2.py (detector_utils.py), GraphDef error
- Error in Emojinator_V2.py (detector_utils.py), Session error
- What version of tensorflow and keras works for this code? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emojinator.