Capture image from a Mightex usb camera with opencv-python - python

I am trying to capture images from a Mightex cmos usb camera (SCE-B013-U) with Python 3.6.5 and opencv-python 3.4.3.18. The software came along confirms the camera works fine. But, cv2.VideoCapture(0).isOpened() is false. I am sure I am missing something, but I do not know what. Please help. Thanks a lot in advance.

For testing I have 1 camera installed on my setup that I know is opencv compatible with the command below:
print(cv2.VideoCapture(0).isOpened())
returns True for me, but if I unplug the camera, it returns False. False can imply that there is no camera available....
If the other answer (above) yields no result, perhaps the installed driver may not be compatible with opencv?
From the product description:
In addition, a user-friendly GUI based application software and an SDK
are provided for custom software development. A USB command set
protocol is also provided for non-Windows based application
Cannot help but to think that this company may be following a different standard to the one opencv typically uses. For example, many USB3Vision cameras will not work out of the box in the way you are attempting and require additional programming to return a NumPy style array image.
Additional support for my thinking is in the "EXAMPLE OF GRAPHICAL USER INTERFACE"
Many of the options I've seen in the GeniCam standard (USB3Vision).
Camera Mode (Continuous / Trigger), Exposure Control, Autoexposure Enable, etc
This is not to say that the camera is definitely is or is not one or the other, but the symptoms suggest the camera is not compliant to run out of the box using opencv in the way you want to.
You could try this 3rd party SDK instead to help verify.
I have no affiliation with them, but the ability to use their program for a (free) trial is very useful for helping to troubleshoot this issue.
Best of luck with getting your camera to work.

Maybe this will help, the official documentation states:
Sometimes, cap may not have initialized the capture. In that case,
this code shows error. You can check whether it is initialized or not
by the method cap.isOpened(). If it is True, OK. Otherwise open it
using cap.open().

Related

See if an app is using the Microphone on Windows 10

I'm trying to write a script that let's me check whether the Webcam and Microphone are in use. For the webcam I already managed to write something in Python, however so far I haven't found a good way to do the same for the microphone.
In Windows you have a dedicated setting in the SysTray that is showing up when your microphone is actually used by an app (and even showing which one):
So obviously Windows knows whether it's used at the moment (that's all I would need) and even which application is using it. However I did not find any way to read that information out in any way yet.
Is it possible to somehow get the data from Windows itself?
At this point, I don't even mind which language would be used for it, Python, C#, PowerShell or whatever.
PS: I know there might be ways to access the microphone wihtout it being shown in the SysTray, but this case is not relevant for what I'm trying to achieve.
I managed it now with the following approach - I'm just taking a screenshot of the desktop and check for the icon I expect to appear in the SysTray in case some app is using the microphone.
For this I used the package imagesearch that can be installed via pip:
pip3 install python-imageseach-drov0
Then I take a screenshot via that package and check whether the item is visible on the screen:
from python_imagesearch.imagesearch import imagesearch
pos = imagesearch(imagePath)
microphone_on = pos[0] != -1
if microphone_on:
print("Microphone is in use")
else:
print("Microphone is not in use")
The image defined in imagePath looks like this:
I found infos for the package on following page: https://brokencode.io/how-to-easily-image-search-with-python/
The recognition works very well and fast, but of course this might not be the best solution and works for simple cases where you just want to know whether anything is using the mic or not. It still would be better if there is some API available that could be asked, but it's better than nothing and solves my problem.

Beagle Bone 128x64 Graphic LCD

I have a BeagleBoneBlack and im trying to find a way to control a 128x64 Graphic LCD using python(This display, more specifically http://www.newhavendisplay.com/specs/NHD-12864AZ-NSW-BBW-TR.pdf), and i dont know exactly how to do it.
Last time that i used this display i was working with a PIC16F877A using the MikroC compiler and it has a library specifically for this GLCD display so it was bearly easier. I searched superficially for some solution but i dont find anything, do you guys know some solution or i have to create my own library to this application?
It looks like you should be able to get something working quickly based on the Linux Kernel FBTFT driver subsystem.
Latest upstream sources show a quite wide range of supported displays. At a cursory look the controller seems to be part of the KS0108 family:
KS0107B / KS0108B; S6B0107B / S6B0108A; HD61203 / HD61202; AX6108 / AX6107; PT6608 / PT6607; SBN0064 / SBN6400; KS0708; S6B0708; ST7548; ST7588; NT7108; RA8808; RW1065; and equivalents.
Please note that by default the beagleboard.org Debian images come with an older kernel. At least it looks like the 4.14-ti kernel build config does enable FBTFT as a module. So if you're really lucky it might even work out of the box. Though I'd be prepared to rebuild the kernel.
Feel free to ask me to expand on certain aspects of the above. This is a high level view with some pointers right now.

Programmatic access to Brother ADS-1000W

I've got a Brother ADS-1000W receipt scanner and using the ControlCenter4 software it works great. However I would like to be able automate the scanning process and I can't find any pointers/clues on where to get access to the ADS-1000W specific features. With the ControlCenter4 software, I can have the scanner deskew images. It also scans to an arbitrary length and width (matching the scanned receipt). I'm assuming this is being handled by the scanner, but it may be happening in the ControlCenter4 software. These features specifically don't seem to be accessible in the TWAIN interface. I tried using TWAINCommander 3 and it doesn't show the deskew and arbitrary size features in the TWAIN interface.
I've got both Linux and Windows machines available and I'm cool with a commandline solution or an SDK that I have to write software to implement. If it's an SDK, I prefer Python.
I know this is somewhat open-ended, but hoping someone can point in a direction for further research.
Just in case anyone else stumbles across this question: The ADS-1000W supports scanning to FTP. If PDF is selected, then the scanner supports the de-skew option, so I installed vsftpd on my linux box and used Python to process the files as their uploaded.

How do you capture an image from a webcam in python WITHOUT OpenCV

I'm programming in python on a Raspberry Pi Zero and I want to capture an image from a USB webcam and I can't find a way of doing this without OpenCV. I don't want to use OpenCV because it's way overkill in features and size for what I'm doing (just taking a raw image from a camera, no processing) and it will take 10+ hours to compile on a Pi Zero. Please tell me there is another way. Pygame was mentioned in another similar question but that only works on Windows. Any ideas or must I sacrifice a half GB of flash to the OpenCV gods and spend 10+ hours compiling its code just to take an image?
It looks like there are ctypes bindings to the Video 4 Linux 2 userspace libraries.
ctypes is icky (replace with cffi if you have time, then send that package's authors a patch), but they should work.
Have you taken a look at fswebcam? I used this in the past on a project I had been doing. It was very easy to install and use, which is a good indicator to me that it will be easy and quick to set up on your RPi Zero. The linked docs page should be enough to get you started to see if it works well for you, but it's definitely worth a try if you haven't!

Using python to control a phone with bluetooth

I would like to know if there are any API's for python to programmatically control a phone, like starting and ending calls, but also to record conversations.
I would also like to use the Headphones and Mic of the computer to talk over the phone.
Any info would be great, I tried googling for something, but nothing useful came up.
Be careful when using PyBluez! The results will actually depend on the BT-USB dongle you are using. Depending on the hardware(the BT chip in there), PyBluez will use one or another BT stack - for example there was one from WIDCOMM. Results will vary, as PyBluez is actually wrapping around those stacks - all of which are far from complete.
So, when you have a working project, be sure to know what actual BT stack you were using :)
For Python audio stuff, you could try this.
PyBluez is an effort to create python wrappers around system Bluetooth resources to allow Python developers to easily and quickly create Bluetooth applications.
Unfortunately I've not found a page dedicated to its features, but it could be a good starting point, whether everything you need is in its feature set, or if you could build your application upon it by extending it.
http://code.google.com/p/pybluez/

Categories

Resources