opencv4android

How to detect (Count) Hair from image using OpenCV?

南笙酒味 提交于 2019-11-29 20:32:00
问题 I have try below code using OpenCV functions cvtColor , Canny and HoughLinesP but not able to get accurate result or not work in some cases. private boolean opencvProcessCount(Uri picFileUri) { hairCount = 0; totalC = 0; //Log.e(">>>>>>>>","count " + picFileUri); try { InputStream iStream = getContentResolver().openInputStream(picFileUri); byte[] im = getBytes(iStream); BitmapFactory.Options opt = new BitmapFactory.Options(); opt.inDither = true; opt.inPreferredConfig = Bitmap.Config.ARGB

opencv blend (overlay) two image with different channels

浪子不回头ぞ 提交于 2019-11-29 13:09:36
I want to overlay two images (maybe different format (channels) with opencv. Originally I use addWeighted, however, it fails on two images with different channels. Is there any way in opencv that can handle this case? Thanks No , there is no API in OpenCV that offers this feature nativelly. On the other hand, there's nothing stopping you from writing your own code to do that. A few weeks ago a made some changes to a function I saw somewhere else on the Internet to be able to: Pass two input images: the background as BGR and the foreground as BGRA ; Blend them together according to a simple

OpenCV Service Intent must be explicit, Android 5.0 Lollipop

风流意气都作罢 提交于 2019-11-28 17:18:29
I'm building this application for my bachelor's diploma that uses OpenCV. Everything was going fine until I updated my phone's Android to 5.0. After the update my project stopped working, because of this: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=org.opencv.engine.BIND } I have read and informed myself about the new restrictions regarding implicit intents in Android 5.0, but how can I get around this in order for OpenCV to work? I could modify the AsyncServiceHelper.java file in the OpenCV SDK in order to try and fix this, but how could I get the Class

Trying to detect blue color from image using opencv, and getting unexpected result

痞子三分冷 提交于 2019-11-28 11:46:41
I am new to OpenCV4Android. Here is some code I wrote to detect blue colored blob in an image. Among the following images, image 1 was in my laptop. I run the application and the frame captured by the OpenCV camera is image 2. You can look at the code to see what the rest of the images are. (As you can see in the code, all the images are saved in the SD card.) I have the following questions: . Why hass the color of the light-blue blob turned out to be light-yellow in the rgba frame captured by the camera (shown in image 2). I created a boundingRect around the largest blue colored blob, but

opencv blend (overlay) two image with different channels

时光怂恿深爱的人放手 提交于 2019-11-28 06:06:23
问题 I want to overlay two images (maybe different format (channels) with opencv. Originally I use addWeighted, however, it fails on two images with different channels. Is there any way in opencv that can handle this case? Thanks 回答1: No , there is no API in OpenCV that offers this feature nativelly. On the other hand, there's nothing stopping you from writing your own code to do that. A few weeks ago a made some changes to a function I saw somewhere else on the Internet to be able to: Pass two

opencv4android template matching using camera

Deadly 提交于 2019-11-28 02:23:28
I have downloaded and successfully run the example provided in opencv4android sdk . I am able to simply display the camera frames without any processing, public Mat onCameraFrame(CvCameraViewFrame inputFrame) { return inputFrame.rgba(); } I want to process live frame with some predefined image template to recognize that template. I have taken reference from this post and implemented accordingly. But I get black screen only. private Mat mCameraMat = new Mat(); private Mat mTemplateMat; public Mat onCameraFrame(CvCameraViewFrame inputFrame) { mCameraMat = inputFrame.rgba(); initialize(); int

Undefined Reference To 'cv::initModule_nonfree()' In Android

醉酒当歌 提交于 2019-11-27 13:47:53
I want to create an Android app which uses BOW + SVM in native (using C++) for predicting. Unfortunately I have problem with building the native part. Since the non-free module is not included in the OpenCV SDK for Android, I need to build the module myself, using this tutorial . It seems I built the .so file successfully. Here is the output: [armeabi-v7a] Prebuilt : libopencv_java.so <= /home/crash-id/Development/SDK/OpenCV-2.4.9-android-sdk/sdk/native/jni/../libs/armeabi-v7a/ [armeabi-v7a] SharedLibrary : libnonfree.so [armeabi-v7a] Install : libnonfree.so => libs/armeabi-v7a/libnonfree.so

Can OpenCV for Android leverage the standard C++ Support to get native build support on Android Studio 2.2 for Windows?

。_饼干妹妹 提交于 2019-11-27 07:06:31
There are many questions and answers surrounding getting native opencv for android building properly. Some use gradle, others use external tools. These numerous, complicated, and often conflicting descriptions for native OpenCV builds might be simplified with a consistent starting point; when creating an Android Studio 2.2 Beta project, there is an way to include C++ support: This feature was added around June of 2016. See Android tools technical docs for more information. Using Android Studio 2.2 or higher with the Android plugin for Gradle version 2.2.0 or higher, you can add C and C++ code

Trying to detect blue color from image using opencv, and getting unexpected result

醉酒当歌 提交于 2019-11-27 06:29:09
问题 I am new to OpenCV4Android. Here is some code I wrote to detect blue colored blob in an image. Among the following images, image 1 was in my laptop. I run the application and the frame captured by the OpenCV camera is image 2. You can look at the code to see what the rest of the images are. (As you can see in the code, all the images are saved in the SD card.) I have the following questions: . Why hass the color of the light-blue blob turned out to be light-yellow in the rgba frame captured

OpenCv with Android studio 1.3+ using new gradle - undefined reference

落花浮王杯 提交于 2019-11-27 03:40:47
I'm having trouble using native OpenCv 2.4.11 (3.0.0 is also ok) with Android Studio 1.3+, with new ndk support. All tutorials about .mk files, but I want to use it with new experimental gradle. Using Kiran answer OpenCV in Android Studio I achived to work fine in java. Also I have changed gradle-wrapper.properties: distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip build.gradle(application): classpath 'com.android.tools.build:gradle-experimental:0.2.0' build.gradle(module): apply plugin: 'com.android.model.application' model { android { compileSdkVersion = 23