Questions tagged [opencv4android]

OpenCV (Open Source Computer Vision) is a library for real-time computer vision, it is free for use under the open source BSD license.

-1
votes
1answer
28 views

How to get X and Y of detected circles?

I want to extract circles in and Image, So I extract them with below code: Mat circles = new Mat(); Imgproc.HoughCircles(adaptiveThresh, circles, Imgproc.HOUGH_GRADIENT, 1.0, (double) ...
2
votes
1answer
26 views

Unexpected output image while adding two numpy array

I am trying to add Gaussian noise to my image using opencv-python. I have created the noise function but adding the noise function to the image is producing unexpected results. I have created a noise ...
0
votes
0answers
13 views

Why OpenCv ask for installing package when depedencies is installed

OpenCV is installed as a dependency in my Android Code but still when running the app, it asks for packaged installation. But the package is not available in playstore (original reason why I installed ...
0
votes
0answers
27 views

How to find the 4 corner points and straight the image using OpenCV perspective transformation?

I am new in OpenCV in android and I am trying to get this image straight but no results. steps that I have done till now 1. //convert the image to gray scale Imgproc.cvtColor(img, imgGray, ...
-2
votes
0answers
28 views

Android automatic document scanner with edge detection and auto capture [closed]

I am building an app which have the requirement of automatic document scanner with edge detection. It would be automatic detect the document and auto capture the image with crop. I have done many R&...
1
vote
0answers
29 views

How to have better results using Opencv Watershed algorithm in android?

I have an image composed of 3 objects and I need to extract those objects. I tried Watershed algorithm but it doesn't work as expected. i don't have a good understanding of how this algorithm work so ...
1
vote
1answer
23 views

I got this error when build opencv with ndk build tool

I got this error when building my app. The app was building fine before, I suddenly got this error when I was rebuilding the app after I made some changes in native-lib.cpp. I deleted the changes I ...
0
votes
0answers
12 views

How to increase FPS in image processing

I'm making an app on Android to do some image processing but unfortunately it is too slow. I get an image from the camera (as a RGBA mat), convert it to HSV, apply a threshold to it and reconvert it ...
0
votes
0answers
14 views

Opencv4android converting white pixelcluster to centeret single line of dots

I'm trying to use the android phone camera as a 3dscanner, with help from a lasercross. i'm using OpenCV to filter out all other colors except the lasers. which leaves me with a thick white lasercross....
0
votes
0answers
23 views

Why Opencv ORB image matching fail randomly for a specific image?

My application is developed using Android and Opencv. I'm trying to match 3 real time images with a 3 reference images using ORB (I should've mentioned the method of features matching because maybe ...
0
votes
0answers
22 views

Android OpenCV using memory address instead of GetByteArrayElements

I'm developing an Android app to use OpenCV. In the newest 4.x OpenCV Android examples, the native c++ function receives the Mat memory address from the Java. The problem is that in my case, I only ...
1
vote
0answers
57 views

How to resolve Fatal signal 11 (SIGSEGV) code 1 in Android?

I am developing an Android application using Opencv for image processing. The processing part is called in java through JNI functions. I am sending to c++ two Opencv Mat objects to find matching ...
0
votes
1answer
62 views

How to investigate random Android native function call error?

First of all I am sorry for the title of the question, I am facing an issue and I can't find anything about the log error I get. I'm developing an Android application using Opencv for image ...
0
votes
1answer
25 views

imwrite opencv function always return false when i want to save frame in sdcard JNI C++

I'm using opencv in android unsing JNI c++ and i want to detect image and save detected face in android sdcard using function provide by opencv in c++ imwrite() but when i compile all thing succeded ...
0
votes
1answer
23 views

Android OpenCV copy ROI to part of bigger image

I get a mat (320x480) from the camera of the phone. Then I need to process a part of that frame. I use ROI for that: mat2 = new Mat(width, 175, CvType.CV_8SC3); Rect roi = new Rect(75, 0, 175, 320); ...
-2
votes
0answers
18 views

How to use getPerspectiveTransform on Android-NDK to transform a perspective image

So i'm trying to detect an square object on android using opencv on ndk, and crop it to a 2D figure, I detect the points of the squares.
0
votes
0answers
11 views

Allow manual adjusting of detected corners of an image after automatic edge detection

I am trying to detect the boundary of a document automatically in OpenCV Android. I have tried Canny->GaussianBlur->Contour->largest 4 point contour, and this gives me the needed boundary in ...
0
votes
1answer
183 views

How to solve Android Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid xxxxx (Thread-X)?

I'm using Opencv sdk for Android to develop a real time processing and matching. The main Opencv traitment logic is in a JNI function. The problem is that sometimes (just sometimes) my app crashes ...
0
votes
0answers
46 views

OpenCV-Android: Storing image using JavaCameraView on click leads to very low quality image and wrong orientation

I am trying to use OpenCV in my android application. What should happen is an image should be captured using OpenCV (JavaCameraView) on a button click and saved to SD Card. While the image which is ...
0
votes
0answers
21 views

Android.mk file missing

My project says Android.mk file is missing, everything was working well till I mistakenly clicked "Rebuild project" and the error started. I am on windows 10 running Android studio 3.3.2 with in which ...
0
votes
0answers
39 views

How to prevent memory leaks using OpenCV?

I developed an Android application using Opencv for heavy image processing. Later in the development I will use some sort of sensors to detect the presence of the object then start the processing. So ...
1
vote
1answer
22 views

opencv onCameraFrame attempt to invoke TextView.setText()

When I try to use setText() inside the onCameraFrame, I experience this crash: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang....
0
votes
0answers
38 views

How to apply Opencv matching algorithm on two different Mat objects?

I created a JNI function developing the OpenCV ORB algorithm for image matching. I tried the function on two images from the Android Assets folder, and it's working as expected. Then I needed it the ...
0
votes
0answers
73 views

How to solve No implementation found for long org.opencv.core.Mat.n_Mat()?

I have strange problem when using Opencv in Android. I must describe my application process to get the hole problem I'm facing since 2 days. First the user take a picture using Camera2 then process ...
-1
votes
0answers
16 views

How to find the number of faces available in the image taken from camera, using opencv?

I want to know if there's a way to identify the number of faces in the image taken. I'm trying to check if the picture have more than one face in it and skip the image from recognition, else if only ...
1
vote
1answer
36 views

How to correct a RotatedRect skew with OpenCV?

I wrote an Android application using Opencv , my image processing algorithm needs a correct rotation for my detected rectangle, so as a beginning of the process, I detect the biggest rectangle as a ...
1
vote
1answer
65 views

How to rotate an image withour cropping it using Opencv in Android?

I am using Opencv in Android to calculate the rotation angle of a detected object then I rotate that object back to its normal position for further image traitment like segmentation and object ...
1
vote
1answer
51 views

How to detect the presence of an object in a non-stationary background using Opencv in Android?

I'm developing an application to process frames and do segmentation and image matching in real time using Opencv in Android. The main problem is that I need to start this image processing only when ...
1
vote
2answers
38 views

How to calculate intersection points based on corners and number of cells

I am trying to find all intersection points (their x and y values) based on 4 corner points that I always have and number of cells (in my case 9, so 9x9 matrix, sudoku puzzle). My 4 corners are ...
1
vote
0answers
40 views

How to detect edges using Canny in Android in low brightness and ignore shadows?

I'm developing an Android application to perform image segmentation using Opencv in real time. The problem is when I applied Canny edge detector, there is always gaps in detected contours even in ...
0
votes
1answer
67 views

unknown type name 'ACameraDevice' in ndk

I want develop opencv programs in android with NDK, for that I tried to build this sample project in android studio but when made project these errors occur : Build command failed. Error while ...
0
votes
0answers
51 views

I get a “Cannot resolve symbol class R” error after adding opencv module dependency to my project and trying to run the application

I'm doing a face recognition android application with opencv. When i try to run the project i get "Error:(3, 18) error: cannot find symbol class R" error. How can i solve this? I'm trying to do a ...
0
votes
1answer
84 views

OpenCV finding corners of contours

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) { ...
0
votes
0answers
33 views

How to detect contours with different brightness using Opencv in Android?

I'm trying to detect all contours in real time from an image using Opencv and Android. The problem is that the detection is perfect in every case only when I turn on phone torch. Here is the result ...
0
votes
0answers
35 views

How to start Opencv real time image processing conditionally using Android?

I'm developing an Android application using Opencv to perform some heavy image processing including detecting the largest contour, crop the detected contour, apply segmentation logic, and match ...
1
vote
0answers
79 views

How to increase Android Opencv camera FPS?

I am developing an Android application and I'm processing frames using Opencv in real time. The image processing is heavy as I'm detecting the largest contour, rotating and cropping it and apply some ...
0
votes
0answers
28 views

Transforming Image for ImageView in Android Java

I am trying to port some code from Python to Android Java. In Python, I use OpenCV (=cv2) and have an image transformed/warped this way: target_points = np.float32([[x1t, y1t], [x2t, y2t], [x3t, y3t]...
0
votes
1answer
47 views

How to detect image edges with different contrast and background color using Opencv?

I'm developing an Android application to detect all image contours and draw them using Opencv. I was testing on the same image and everything was working fine. But as soon as I changed the same ...
0
votes
0answers
26 views

Tracking humans or animals in an thermal image shot form a drone

I am currently working on a project where I am programming a drone to fly over a predefined area and automatically detect living animals or humans. I am using a thermal camera which makes things a ...
0
votes
0answers
29 views

How to extract RotatedRect using getRectSubPix in Android?

I have successfully detected an object using Opencv in Android as a RotatedRect and I need to extract this rectangle to a new Mat in order to apply more processing on it. I am trying to use ...
0
votes
0answers
25 views

Detect color percentage of a specific color

In my app i used to detect the color from the camera like this from the camera iam picking the color magenta and i want to detect the percentage of the color and set the percentage in the seekbar ...
0
votes
0answers
43 views

How to return vector<vector<Point>> from JNI to Java?

I'm developing an Android application to find the largest contour from an input image. I found a working example in c++. I tried to adapt it to my project and I'm trying to make a JNI function to ...
0
votes
1answer
125 views

How to draw a boundingRect with the right rotation angle by using OpenCV?

I am performing Canny edge detector using Android and Opencv on an image to detect the largest contour, extract it using warpPerspective method then find all objects inside that contour. Everything is ...
0
votes
0answers
28 views

How use OpenCV Imgproc.HoughLines in java?

I'm trying to find hough lines in an image using opencv in java. This is my code : public static final double RHO = 2; public static final double THETA = 3 * Math.PI; public static final int ...
0
votes
0answers
38 views

How to extract a contour from Opencv camera preview using Android?

I am developing an Android application using Opencv, its main idea is to compare objects detected from an image from gallery and the frame detected using Opencv preview camera. FOr now I am able to ...
0
votes
0answers
42 views

How can I reduce time to detect bounding rects using Opencv?

I am developing an Android application to detect bounding rects from an images using Android and Opencv then apply ORB to find similarities with other images. Here is what I've done yet: for (...
0
votes
1answer
22 views

opencv4.0.1 for android Stitcher module not found

I am using opencv4.0.1 code, using below steps to build out the sdk: cd opencv-master mkdir build cd build export ANDROID_SDK=~/Library/Android/sdk export ANDROID_NDK=~/Library/Android/sdk/ndk-...
0
votes
1answer
77 views

Build error on Android with OpenCV 3.2.0 and Jni

I am trying to write an Android application using OpenCV and Jni to compare images and find matches. I'm already using OpenCV 3.2.0 (using the official pre-built Android package) in android ...
0
votes
0answers
26 views

Opencv-Android: Getting Null Pointer Exception after adding Cascade Classifier to my code

I am getting Null Pointer Exception in CaseCadeClassifier.java class here: Mat objects_mat = objects; detectMultiScale_4(nativeObj, image.nativeObj, objects_mat.nativeObj, scaleFactor); ...
0
votes
0answers
61 views

How to detect multiple contours from an image using OpenCv?

I am developing an android application. Currently I am stuck at detecting contours from the input image. I think the problem is in image pre-processing. I tried multiple solutions but the one that ...