Python 3 Webcam - python

im trying to make a face detection program and I need to access my webcam. Im strictly using python 3 for this project. I have tried OpenCv and video capture, but those only work for python 2.7. Is there any way that I can code this manually in python to,
A.use command line to do this,
Manually code this in python somehow, or
Any other modules(that work with 3).
Any help would be appreciated!

VideoCapture has worked really well for me in the past. The sourceforge page only shows support through python 2.7, but this page has pre-built installers through python 3.4. Simple, lightweight, and works.

Related

Dynamic Gesture Recognition and Kinect with Python?

I am working on "Kinect for XBox One" on my HP Laptop with Windows 10 and 64-bit operating system. I have worked on python before and want to work in it only with jupyter notebok or python command line.
The topic of my project is Dynamic Sign Language Recognition and till now I have worked on only static images. I found many tutorials for working with kinect camera but every tutorial has been done with C++, C# or Sketch in Processing 3. I have downloaded Processing 3 and tried some programs in Sketch also by following this link: https://www.youtube.com/watch?v=XKatPT3HlqA
But even after 2 days, I am not able to run a simple program in it and only a black picture is there as an output, kinect is detected though.
I have also tried Pykinect and python example from this link: https://github.com/Kinect/PyKinect2
It was good and I was able to track the skeleton of the body. I want to learn Pykinect and many more such examples but I am not getting any source from where I can learn all these. My aim is to use all the three cues:RGB, Depth, and Skeleton for my work.
Even for dynamic gesture recognition, there are projects in C++ and languages other than python.
If you have any suggestions regarding kinect with python and dynamic gesture recognition, then you are welcome.
After searching for days, I figured out that there are no tutorials on Kinect using Python. Those who want to learn kinect with python and Windows should go to this link first: https://github.com/Kinect/PyKinect2
Go by the instructions and run the example programs whether in Visual studio, python command line or jupyter notebook. There are no tutorials defining the programming functions of Pykinect library. The only way to learn it is through one more link:
https://github.com/Microsoft/PTVS
Explore this link as it has one or two more examples which will help in understanding the functions. I am not done yet so I will keep updating my answer if I find any more sources.

Running a python 3.x script on a web server [duplicate]

I wrote an applet in Python using the Tkinter library. I finished writing the applet but now I want to make it public on my website. Does anyone know a way to get the python script to work on my website? I don't want it to have to be something that needs to be downloaded, but can just run in the browser if possible.
Thanks!
What you ask is not possible. Several years ago there was a Tcl/Tk browser plugin, but the last time anyone touched that sourceforge project was back in 2006. I seriously doubt it could be made to work with tkinter. For that matter, I doubt it works for tcl/tk either. Browsers have advanced quite a bit since then.
And no, getting it to work in jython so you can run it via a java plugin won't help. Tkinter works by working directly with a tcl/tk interpreter. The tcl/tk interpreter won't run in the JVM.

Accessing a webcam with Python 3.X

For a school project I am using a Raspberry Pi to detect certain colours in a webcam image. However, I can't seem to find any way to access the webcam using Python 3.X. Are there any libraries out there that work with python 3.X that work for both windows and linux (I'm creating the program on windows 7 but going to be using it on the R-Pi)?
If not, I suppose I could end up settling for Python 2.7 simply because the R-Pi has both versions installed on it (Although I don't know 2.7 so it may not go too well).
There are several ways to do this:
You can use OpenCV which has support for getting data from a webcam and there are Python wrappers for it;
gstreamer has python bindings too;
Also, on GNU/Linux, you can use v4l2.

Is there any Image processing library for Python 2.5 that does not require external dependencies under Windows?

I observed that there are (too) many ImageMagick libraries for Python but I found none that can just be installed and that will include the ImageMagick libraries.
I am looking for something can be be easily installed and that has to work with Python 2.5 (please, don't ask me why 2.5!)
Did you try the Python Imaging Library (PIL)? They have got an installer for Python 2.5 and I don't think there are further dependencies.
I won't ask you why 2.5, don't worry - but I am pretty happy with Python Imaging Library.
I work mostly on Windows, and while PIL has its glitches, it works just fine. Up to now I haven't had any compatibility problems BMPs, JPGs and PNGs.
I suggest you look into PIL once again, I just tried to make a BMP in Paint and it works fine.
BTW, a thing that can make stuff seem inoperable is forgetting to put "wb" as file output mode when saving using the Image.save() function.

Why is OpenCV python crashing in Windows?

I am running OpenCV2.2 on Windows 7 64-bit.
I built OpenCV using cmake with MinGW 32-bit.
I have no problem with the C/C++ build. However the python bindings seem to have some problems. Most of the python samples are crashing.
The HighGui functions seem to cause trouble. Python crashes when I try to read an image (using imread, LoadImage or LoadImageM), display an image (imshow or ShowImage) or even create and manipulate windows (NamedWindow, MoveWindow, etc).\
WaitKey doesn't crash python but it always returns a -1 immediately, no matter how long the delay I provide. Similarly imgproc functionality listed under "Image Filtering" in the reference seem to crash python. I haven't been able to test it with too many other functions, mainly because I can't load in images and I am forced to test it with matrices i have built myself.
I am currently using python 2.6.6 (32-bit) , but I got the same problem with python 2.7 (32-bit). I also tried building the python wrappers for OpenCV2.1, and I got the same problem. It's very likely a problem specific to my setup. I've been cracking my head against this problem for quite some time now, I would appreciate any help.
Thanking you in advance.
Regards,
Anush.

Categories