Linux script that captures mouse movement, and snaps a webcam shot: libraries? - mouse

I'd like to write a script that once run on Ubuntu, captures any mouse movement and immediately uses the installed webcam to save a snapshot to the desktop. I'd like to know which libraries are standard for this sort of programming.
Thanks!

Found the answer. opencv for python (highgui) takes care of the webcam, and Xlib takes care of the events.
Use python DBUS to send a Lock signal to a screensaver.

Related

Stream video from Raspberry Pi 4 while another program uses the pi camera as well

I have a raspberry pi 4 with a camera module on it and a pan-tilt hat.
I've made a project which when started, it uses the feed from the RPI camera, detects a face and center around it. If the person moves, the camera tracks him.
When I run the .py file through the terminal, it works.
Now I want to use it with my PC. Therefore, I need to simultaneously run my project in the background AND to steam the feed to my PC somehow.
From the methods I searched online, I saw that it's possible to use flask and get a URL to use as an IP camera.
My question is, is it possible to stream the camera feed while my projects runs and tracks the face?
Thank you.

Execute Python Script on Motion Eye on event of Motion Detection

I have installed motioneye on a raspberry pi and it's working perfectly (images and videos are recording which I can access through FTP). Motion detection is enabled with a mask.
I have written a .py script that will open a new web browser displaying the streamed video so colleagues around the office can see at a glance who has entered the building (the script works perfectly when exectued in PyCharm)
I have placed the executbale .py file in /home/data/browse.py
However, it doesn't seem to execute when motion has been detected and captured/recorded.
Can anyone help please?

How to capture player moment with webcam and use that as an input in a game?

I want to make a boxing game and move the player with the help of capturing moment of the player by using image processing. I have tried capturing moment in python using OpenCV but how could i use that input in a game environment ?
and which tool i should use for that ??
This is my first question here please cooperate.
Thanks
Just buy a kinect and use Microsoft's SDK. It has skeleton tracking built into it.
As far as game input, you can build standard serial stuff in unity3d in its background scripts. Either implement the camera directly into unity or else create a serial forwarder that runs on the computer, which reads the camera data, processes it, and then streams computed information to unity.

No sound output when running jsyn on raspberry pi (Raspbian Jessie)

I've started writing a java synthesizer using the jsyn library. It works well in windows and osx, but when I run it on Raspbian. When starting the program i notice some activity in the headphone output though, it starts to output some silent noise, but no clear loud sawtooth wave like it does on Windows and OSX. Which sound device is the correct one to select as output when starting the synthesizer if I want to use the headphone jack? There are 4 avaliable when I run the AudioDeviceManager.getDeviceCount()
It is hard to know which of the 4 devices to use. This example will list them by name and also indicate which one is the default input or output.
https://github.com/philburk/jsyn/blob/master/tests/com/jsyn/examples/ListAudioDevices.java
It is also possible that the CPU cannot keep up. Try just playing a single oscillator. A sine wave is good because then you can easily hear any click or distortion. Here is an example that does that:
https://github.com/philburk/jsyn/blob/master/tests/com/jsyn/examples/PlayTone.java

What Webcam is Compatible with MATLAB

I am working on a project of mine which requires a webcam and MATLAB. I have a Logitech Webcam, and I dont know if I could talk to it through MATLAB because Im trying to work with images and image processing, so I just want to know if there is a way to find out if the webcam is combatible with matlab or if I need to get some other type of webcam to get the job done, if I do need to get another one, it would be helpful if you suggest a certain cam that is cheap and available around.
Thank you.
I've used several Logitech webcams with the Image Acquisition Toolbox on Windows. You'll find a list of supported hardware here.