opencv4android

Getting RGB Value Live Camera, Error NullPointerException

为君一笑 提交于 2020-01-14 10:09:13
问题 [UPDATE]: Screenshot has been added. I was following basic tutorial tutorial-1-camerapreview from opencv-3.4.1-android-sdk_4. I want to click on screen and get RGB Color of that x y position. I got help from HERE (Retrieve exact RGB value from touch event in camera preview) : Getting x y coordinates: @SuppressWarnings("deprecation") @Override public boolean onTouchEvent(MotionEvent event) { x = (int)event.getX(); y = (int)event.getY(); return super.onTouchEvent(event); } onCameraFrame as:

openCV4Android features2d error

醉酒当歌 提交于 2020-01-13 19:48:48
问题 I want to use features2d to draw good matches (not all matches) between two images.So I used this snippet of code: Mat gray1 = //image1 converted to gray Mat gray2 = //image2 converted to gray MatOfDMatch matches = new MatOfDMatch(); MatOfDMatch gm = new MatOfDMatch(); LinkedList<DMatch> good_matches = new LinkedList<DMatch>(); MatOfKeyPoint keypoints_object = new MatOfKeyPoint(); MatOfKeyPoint keypoints_scene = new MatOfKeyPoint(); Mat descriptors_object = new Mat(); Mat descriptors_scene =

openCV4Android features2d error

我们两清 提交于 2020-01-13 19:48:08
问题 I want to use features2d to draw good matches (not all matches) between two images.So I used this snippet of code: Mat gray1 = //image1 converted to gray Mat gray2 = //image2 converted to gray MatOfDMatch matches = new MatOfDMatch(); MatOfDMatch gm = new MatOfDMatch(); LinkedList<DMatch> good_matches = new LinkedList<DMatch>(); MatOfKeyPoint keypoints_object = new MatOfKeyPoint(); MatOfKeyPoint keypoints_scene = new MatOfKeyPoint(); Mat descriptors_object = new Mat(); Mat descriptors_scene =

Execution failed for ':app:ndkBuild'. Process 'command ndk-build.cmd' finished with non-zero exit value 2

旧街凉风 提交于 2020-01-11 05:44:26
问题 I have been stuck on this problem for 2 days and have tried out all possible solutions given on stackoverflow. Below is my build.gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.3" sourceSets.main.jni.srcDirs = [] sourceSets.main.jniLibs.srcDir 'src/main/libs' defaultConfig { applicationId "com.example.anannyauberoi.testingcam" minSdkVersion 15 targetSdkVersion 25 versionCode 1 versionName "1.0" ndk { moduleName "app" cFlags "-std=c+

OpenCV Service Intent must be explicit, Android 5.0 Lollipop

扶醉桌前 提交于 2020-01-09 12:36:30
问题 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

Why isn't inRange function detecting blue color when I have given it the entire possible Hue range for the blue color?

早过忘川 提交于 2020-01-07 08:46:51
问题 On the website colorizer.org, they have an HSV range of H=0-360, S=0-100, V=0-100. We are also aware that the HSV range in OpenCV is H=0-180, S=0-255, V=0-255. I wanted to select a range for any shade of (what we perceive as) blue color, so I looked at colorizer.org, and saw that blue Hue ranges roughly from 170 to 270. So I scaled this Hue range to OpenCV by dividing by 2, which gives 85-135. Now, I took the following screenshot of color [H=216, S=96, V=67] from the preview at the website

OpenCV finding corners of contours

╄→гoц情女王★ 提交于 2020-01-06 08:14:20
问题 I am completely new to OpenCV. For practice I decided to do a "Sudoku Solver". So far I was able to do this : public Mat processImage(final Mat originalImage, final CvCameraViewFrame frame) { image = originalImage.clone(); image = frame.gray(); /* We load the image in grayscale mode. We don't want to bother with the colour information, so just skip it. Next, we create a blank image of the same size. This image will hold the actual outer box of puzzle. */ Mat outerBox = new Mat(image.size(),

Parallel Processing with camera2 api android and opencvcamera2

半腔热情 提交于 2020-01-06 05:47:30
问题 I am developing an app where I want to process each frame from the camera and apply some Image processing algorithms on it. I am getting image feed from ImageReader inside onImageAvailable callback and passing it to my cpp code with JNI interface for further processing. This works fine until I perform heavy operations inside my cpp code, after that it starts adding delay and lag to camera preview. is it possible to process on feed images in parallel so I can achieve real-time results? I am

OpenCV+Eclipse+Android: Error org.opencv.video Video.java

旧城冷巷雨未停 提交于 2020-01-02 04:24:06
问题 I have been installing OpenCV (this is the tutorial), I read the tutorial but this error appeared (error in Video.java (PHOTO)). I have installed the last version. I don't understand. Anybody can help me and explain me what happened? thanks 回答1: If someone have this problem, do this: In OpenCV project.properties change target=android-11 (or in some cases 14) to target=android-17 . Edit: For the newer OpenCV-2.4.10-android-sdk you will need to change it to target=android-20 . 回答2: In each

OpenCV - canny edge detection not working properly

核能气质少年 提交于 2020-01-01 11:51:02
问题 I am new to OpenCV with Android. I am currently working on document detection demo app. What I did so far is as below: Original image -> Gray scale image -> GaussianBlur -> Canny edge detection -> finding contours -> draw Contours I am able to detect paper sheet perfectly as you can see in below image . But it does not detect some documents. Below is one of them I researched a lot about that and found that the problem lies in canny edge detection and below is the canny image : As you can see