Java with usb cam on linux: device not opening - linux

I am trying to make pictures with a java programm under linux.
I have a normal usb cam, eclipse, java 7
....
i tried nearly all of the thread
Capturing image from webcam in java?
but nothing want to show me something....
With the Java Webcam SDK library
http://www.smaxe.com/product.jsf?id=juv-webcam-sdk
i came to the point where i can choose my usb-cam out of a list. But than the source tells me:
Failed to open device.
== same with the running... app under eclipse????
How to see something.
I like to use this pics... in a neural net...this is good ...this i like ....
Thx a lot Andy

Related

catalina: emacs, python and keyboard input (using psychopy)

i'm facing the following problem.
I use python with emacs on a mac with Catalina OS.
I try to get input from the keyboard in my python script (trhough psychopy library). It does not work, and i receive the following message:
HIDBuildMultiDeviceList: Couldn’t open IOHIDManager.PsychHID-ERROR: Could not enumerate and attach to all HID devices (HIDBuildDeviceList(0,0) failed)!
PsychHID-ERROR: One reason could be that some HID devices are already exclusively claimed by some 3rd party device drivers
I have a similar problem when i try to access the microphone. However, it works from within another editor. It seems that the problem is that i'm denied access to the keyboard (and mic) when running a python script.
Any help would be most welcome.
Best
thibault
I was experiencing the same problem, and restarting solved it!
I had code to play audio files and wait for a key on the keyboard to be hit. This code used to work, and then when I made some changes elsewhere in the code I started for the first time to experience this problem. Using the Python debugger in Terminal (python -m pdb myPsychopyCode.py) I tracked it down to occurring in the 2nd of these lines:
from psychopy.hardware import keyboard
kb = keyboard.Keyboard() # Set up a keyboard device
The error occurred replicably, whether I ran from the whole script or used it interactively in the python debugger. My fix was simply to restart! Thereafter the error messages stopped. I don't like this fix because it means I don't know what caused it or when it might happen again.
2017 MacBook Pro, macOS Big Sur 11.4, external LG monitor, bluetooth external Magic Keyboard, bluetooth external Magic Trackpad.

how to input Japanese to TextArea in JavaFX on Linux

I'm beginner of JavaFX, I'm developing JavaFX Application using CentOS7(I use KDE), but I can't input Japanese to TextArea/TextField.
when I type some word, TextArea/TextField show only English even if I set "KEY-MAP=jp106".
there is same JavaFX Application on Windows, I can input Japanese to TextField/TextArea when I execute that JavaFX application on Windows.
I use ibus-kkc on CentOS7, I can input Japanese on website(FireFox), memo(KWrite), and I can input Japanese Comment in my Eclipse on CentOS7.
I've searched any solution on Website for 1 week but I couldn't find some tips on Website written by Japanese(because I'm Japanese, I apologize my terrible English).
Does anyone know good way to solve?
Thanks!
I use:
CentOS7
jdk-11.0.4
javafx-sdk-11.0.2
Eclipse ide 2018-09
ibus-kkc
VMware Workstation 15 player
I changed from ibus-kkc to fcitx-Anthy but I could not input Japanese on that JavaFX application.
I found that solution by myself.
I read release note about JavaFX11, and I had to input processing of changing GTK version
forcibly when I execute JavaFX application.
https://github.com/javafxports/openjdk-jfx/blob/jfx-11/doc-files/release-notes-11.md#release-notes-for-javafx-11
when I execute it, I put,
$startx
$cd (directory that exist class file)
$java -Djdk.gtk.version=2 ...
I could execute correctly.
Thanks!

Voice to text translator raspberry pi

Hi Im new to programming for Raspberry pi, but i have decided to make a "Voice to text translator" using the Raspberry pi.
So here is what it should do step by step:
press a button to start.
speak to the device via a plugged in microphone.
The device will now take the voice and convert it to a text
document.
Save it to the SD card.
Then press a button to stop.
So what i would like to know is, if this has already been made (I could not find any, for Raspberry pi)
and if this is even possible?
And thanks for the help by the way! :)
Check out jasper I was very impressed that a Raspberry Pi could do such a good job. It only messed up once for me (I said 'mayonnaise' and it put 'many') It is based on CMU Sphinx.

How can I create a button (or hotkey) that will automatically connect my bluetooth headset?

I have a bluetooth headset that I would like to be able to quickly switch between connection from my laptop(running windows 8) to my phone. I downloaded autohotkey to help me make a hotkey that would connect to my bluetooth headset, but I was only able to make a hotkey that would open the bluetooth control panel for my specific headset, which is not what I was trying to accomplish. What I am trying to accomplish is a hotkey that would immediately connect my headset when typed.
The code I used in autohotkey, to open the bluetooth control panel(by clicking Ctrl+Alt+B) is:
^!b:: run "C:\Program Files\WIDCOMM\Bluetooth Software\BTWUIExt.exe" /deviceAddr=445ef3aa5294
this code won't work for you as the numbers and letters on the end are a uniqe idendifier for my specific headset. You can find your unique id by opening bluetooth in the control panel and right clicking your headset, selecting properties, clicking the bluetooth tab (remove the dots and colons).
This worked to connect the first bluetooth device in the list (Windows 10)
#SingleInstance,force
;https://autohotkey.com/board/topic/83571-autohotkey-connect-to-bluetooth/
^F1::
Run, bthprops.cpl
Sleep, 2000
Send, {tab}{tab}{enter}{tab}{enter}
Sleep, 200
Send,!{Tab}
return
There is very little information to give exact solution. But from given information I can say:
You can automate GUI with AutoHotkey so that script will go to the
place where unique id is located. In fact, AutoHotkey allows any
GUI automation (conventional or non conventional GUI).
If the unique id is there as a text and you can copy it, then it
also can be automated by several ways. If unique id cant be coped
and is as image, then it is slightly complicated and you need to use some OCR
techniques. In that case you need to make screenshot of that region
and use some OCR script getting text out of it. Or with AutoHotkey pass image to OCR software and get text from it.
After you have text, you can manipulate it the way you like. Most powerfull solution
is Regular Expressions which are supported by AutoHotkey.
When unique id is ready to use, you can use it in Run
command this way:
^!b:: run "C:\Program Files\WIDCOMM\Bluetooth Software\BTWUIExt.exe" %MyUnicIDVariable%
Turns out that the code I have works on its own. If I just wait for about 10 seconds after typing out the hotkey, the headphones connect, and the control panel that opened automatically closes. Quite convenient actually as I didn't expect it to connect or to auto-close the window.
Thanks for the effort anyway!
Try to install [Broadcom Bluetooth 4.0 Driver for Windows 8.1 ] LINK=>> 1 !
At least works fine on my HP-EliteBook-8570p with stereo "BlueDio 99B" headset. After switching the headset ON the Windows connect the device automatically, and switch Audio-Stream into new-attached device. Optimal!
PS - Unfortunately it is still the Problem with Windows 8.1 + Skype( MIC-Problem) :( Windows 8 is the first OS, than not support Skype at all! ;)

Keyboard input in Qt

I am working on a Qt application running on embedded Linux. I am pretty new to this Qt business since I have just started it a month back, so understand that I'm not that object-oriented ... :P
I have the Qt applications running on my target running Linux. The Qt documentation http://doc.qt.io/archives/qt-4.7/qt-embedded-pointer.html says that we have to enable touchscreen, USB keyboard, keypad, etc. by exporting certain variables. Namely,
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export QWS_KEYBOARD="linuxinput:/dev/input/event0 usb:/dev/input/event2"
well, as you can guess, first line sets the mouse device in QT as touchscreen. "tslib" is the touchscreen library, and the "event1" is the node representing the touchscreen. Similarly, second line is for on-board keypad (event0), and USB keyboard (event2).
Now, the touchscreen work very well. But the problem is with either keyboard. If I do not export the second variable, namely QWS_KEYBOARD , then the application runs fine. But if I do export the second variable, the application goes into stopped state (SIGSTOP) as soon as it is launched. This is evident from ps output. I can not make it work with SIGCONT.
I am going to try and reconfigure Qt from source. Any thoughts are welcome.
Can not believe this but setting the QWS_KEYBOARD variable as null solved the problem.
Found it in the Qt developer FAQ http://developer.qt.nokia.com/faq/answer/why_doesnt_my_keyboard_work_after_i_have_done_an_export_qws_keyboard_dev_tt
export QWS_KEYBOARD=""
Well, it did not completely solve the problem since I still have to include the native keypad along with the USB keyboard.
Anyway, I am able to move to fields using the arrow/TAB keys. Text input works well. Although CAPS-LOCK and NUM-LOCK do not seem to work. SHIFT works. I am able to terminate the application by Ctrl+Alt+Bkspce. So, for the time being, I am able to input text at least.
Will post if any improvements.

Resources