converting OpenCV not working with Python-for-android - opencv

I have a pretty solidly-functioning Kivy app, written in python and using the OpenCV2 library. having gotten it working on my laptop (windows) I then tried to convert it into an android APK using the python-for-android VM. after some issues (including adding more space to the VM and installing OpenCV on it) I managed to compile the APK successfully.
however, when running the app on android, the opencv part doesn't seem to be working. the kivy menus and such work fine, but loading the video - the job that opencv handles - simply doesn't happen. I'm going to try and connect the android device to the VM directly in order to try and get some debug information, but for now, can anyone think of any reasons why I might be having these issues?
thanks.

Related

How to Enable NEON in OpenCV by using ndk-build on Android Platform?

I am new to Android platform. I have already included openCV library in my c++ code and successfully built an .so file by using ndk-build command. The app has already successfully run on my android phone. My question is how to enable NEON for a better performance? I have already included "LOCAL_ARM_NEON := true" in my .mk file but it did not seem to work. I will really appreciate your help!

How do I build and install an electron app for raspbian using appimage

I am working on creating an electron appimage for my raspberry pi 4 to use in my car. I want to be able to use auto-updates from electron-builder so that I wont have to take apart the R-PI every time I want to update it.
I have come across many articles,
https://itsfoss.com/use-appimage-linux/
https://www.youtube.com/watch?v=KiehhZ6Wb-4
saying that you can go to the file properties and check "execute file as program" but this is not the case for raspbian. Raspbian does not have this option in its file properties.
It could be how I am building and releasing my program. For more information, here is the project I am working on: https://github.com/bomeers/Piro/releases/tag/v0.0.3
and here is the source code: https://github.com/bomeers/Piro/tree/dev
Is it even worth using electron? Should I choose Qt (python) instead? Anything helps, thanks!
I have been building and running Electron Apps in AppImage format on Raspbian for quite a while and it (mostly) works without any issues. Some advice however:
If possible use the latest Raspbian "Buster" as previous versions can not properly build recent versions of Electron due to a glibc issue
Set the proper target armv7l, this (currently) still applies to the RPI 4
Use at least Electron version 5.0.10 as previous versions of the 5.x branch had a weird issue of AppImage format Apps crashing when you clicked any menu item
If you build your App using electron-builder you may need to manually add a working version of mksquashfs as described here
Other than that I never found any issues and it works just fine on Raspberry 3 / 3+ and 4.
* Edit *
An example how to configure the build target for Linux / Raspberry 4 in package.json:
linux: {
target: {
target: 'appimage',
arch: ['armv7l']
}
}

Kivy on Qpython3 (Android)

How I can use the Kivy framework in Qpython3 (Python 3.2 for android) app?
I know that Qpython (Python 2.7 for android) app support this framework.
pip_console don't install kivy. I have an error, when I try to install it. Please help me.
Edit: Kivy now supports python3 on Android, though qpython would still have to include this (or a similar build process) to have kivy work in qpython3.
You can't right now, as kivy does not have a python3-supporting backend on android.
We're working towards adding one, at which point I quess qpython may look at adding support in qpython3.
From kivy documentation http://kivy.org/docs/installation/installation.html
NOTE: Currently, packaging only works with Python 2.7. We are working on Python 3.3+ support, but for now if you plan to distribute your package on any platform you should use Python 2.7.

BeagleBone, OpenCV and webcam issue

I've been trying to get BeagleBone work with OpenCV and a capture camera, but I couldn't manage to do it so far. I use Logitech C270 webcam. Here is what I did so far:
I installed OpenCV binaries and tried my camera. Capture didn't work. I downloaded the latest version from Git and compiled it. Then it worked on my desktop.
Since Ångström have pre-installed OpenCV, I directly tried to connect the webcam. But I had "select timeout" errors and when I saved the captured image, it was all black.
I deleted OpenCV from Ångström (opkg remove opencv and opencv-dev). It said it worked, but libraries were still in /usr. So I deleted them manually and copied libraries that I cross-compiled in my host. But now, I cannot even connect to camera. Capture returns null again.
I checked opkg list-installed, still OpenCV 2.4 is listed there. However, libraries in /usr/lib and include are the ones that I copied. How can I fix this problem?
Note: Webcam is recognized by Ångström, and dmesg shows successful connection to the webcam.
It seems something was wrong on installation of Linux itself. I re-compiled the latest Ångström and installed it to BeagleBone. Everything worked fine as it should. It seems sometimes it's better to take the hard way.

Getting webcam to work in OpenCV 2.3 with Cygwin

I have a problem trying to get a webcam in OpenCV 2.3 to work with Cygwin. I have a Windows 7 64-bit system and I use Notepad++ and cygwin compilers to do my C++ programming. I have seen other posts with similar problems:
Getting Webcam to work in OpenCV
Can't access webcam with OpenCV
I first tried installing OpenCV via the Cygwin Ports. This is rather easy to install, but alas I run into the webcam problem (always returns false when trying to find a device). I have also attempted to build OpenCV and install manually using the command line flavor of CMake. I tried adding the HAVE_VIDEOINPUT and HAVE_DSHOW flags, but no dice. All my programs compile nicely and I have all the functionality of OpenCV aside for this webcam thing.
Has anyone successfully built OpenCV 2.3 on Cygwin with webcam working?
It is unlikely that cygwin build of OpenCV will be able to access a webcam. At least it is not possible without hacking OpenCV cmake scripts. Under cygwin OpenCV build always follows the UNIX branch and videoinput/directshow is excluded from build.

Resources