Face and Objects tracking with OpenCV and Python
mjrovai / opencv-object-face-tracking Goto Github PK
View Code? Open in Web Editor NEWTracking objects and Face with OpenCV and Python
Tracking objects and Face with OpenCV and Python
I set up everything fine. even matched with you. but when I compile the program an error is shown that no module called cv2 found. What is the solution?
Dear All,
i have try to running code by command promp and below error has been occured.
==================
(cv) pi@raspberrypi:~/Documents/LatOpenCV $ python object_detection_position.py
[INFO] waiting for camera to warmup...
Positioning servos to initial position ==> Press 'q' to quit Program
Traceback (most recent call last):
File "object_detection_position.py", line 111, in
if len(cnts) > 0:
But while running py file by Mu python editor, no error was found.
looking forward any advices, thank you
Arief (Beginner raspberry hobbyist)
Hi,
This code is awesome!
I added some feature: MySQL, Web interface and I planning to merge the Data Gathering and the Recognize processes.
But I found some bug:
RPI3, Python 3 and OpenCV 3.3
There are no cv2.face.LBPHFaceRecognizer_create() function
I modified:
recognizer = cv2.face.createLBPHFaceRecognizer()
There are no write() only the save() function:
recognizer.save('trainer/trainer.yml') # recognizer.save() worked on Mac, but not on Pi
The predict function gives back only one variable, the id:
id = recognizer.predict(gray[y:y+h,x:x+w])
This code is awesome!
However,I have a problem that when I use this program in VNC, there will be the following error:
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/pi/opencv-3.3.0/modules/highgui/src/window.cpp, line 325
Traceback (most recent call last):
File "simpleCamTest.py", line 18, in <module>
cv2.imshow('frame', frame)
cv2.error: /home/pi/opencv-3.3.0/modules/highgui/src/window.cpp:325: error: (-215) size.width>0 && size.height>0 in function imshow
How can I solve this problem?
THX :-)
Hello and thank you for your guide and codes!
I'm having a type error as cnts being a "NoneType" and cannot use with len() function.
This is the original error:
TypeError: object of type 'NoneType' has no len()
Hi.
I really love the project and i'm using it as a template for a school project. I only have one problem that keeps occurring and it's when i try to import cv2. I'm doing all the programming on a Raspberry Pi 3 Model B with Rasbian installed. I can import the cv2 in the normal python IDLE, in the terminal. Can't get it to work with any IDE Editors though, only gets the error "ImportError: No module named cv2". Even when i try running the simpleCamTest.py i get the same error. If i type the code manually the import works but i get a new error.
"OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/pi/opencv-3.3.0/modules/imgproc/src/color.cpp, line 10638
Traceback (most recent call last):
File "", line 5, in
cv2.error: /home/pi/opencv-3.3.0/modules/imgproc/src/color.cpp:10638: error: (-215) scn == 3 || scn == 4 in function cvtColor"
Was really hoping to get the project going, but can't really get anywhere when even the template itself isn't working :D
Thanks in advance
Hi Marcelo
Thanks for your example code, I came across a problem when I try Python simpleCamTest.py, the error is as below, can you give me some suggestion, the OpenCV version is 3.4.1
OpenCV(3.4.1) Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/pi/opencv-3.4.1/modules/imgproc/src/color.cpp, line 11147
Traceback (most recent call last):
File "simpleCamTest.py", line 16, in
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(3.4.1) /home/pi/opencv-3.4.1/modules/imgproc/src/color.cpp:11147: error: (-215) scn == 3 || scn == 4 in function cvtColor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.