opencv4android

OpenCV - canny edge detection not working properly

你离开我真会死。 提交于 2020-01-01 11:50:44
问题 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

How to give Fluid effect / resize bitmap wrt touch events using opencv4android

梦想与她 提交于 2019-12-31 04:15:12
问题 I'm newbie with OpenCV4Android and Android NDK Trying to achieve Stretch the image with respect to Touch Points on Image.(Putting Hair on Face and stretching it accordingly using touch events Like 'Virtual Make Over Application' ) Issues: While using Java Implemented warp function on Touch Events by getting Matrix from Bitmap and recomputing them onTouchEvents. But the Image get distorted and whole Matrix gets upside down. How can use OpenCV4Android to achieve goal like these? Tried to get

How to Iterate in OpenCV4Android

☆樱花仙子☆ 提交于 2019-12-30 07:43:28
问题 I had this piece of code to be converted into Java using OpenCV4Android. But their are no Java-Wrappers for matiterator in OpenCV4Android. void show_result(const cv::Mat& labels, const cv::Mat& centers, int height, int width) { std::cout << "===\n"; std::cout << "labels: " << labels.rows << " " << labels.cols << std::endl; std::cout << "centers: " << centers.rows << " " << centers.cols << std::endl; assert(labels.type() == CV_32SC1); assert(centers.type() == CV_32FC1); cv::Mat rgb_image

Error: “Fatal signal 11 (SIGSEGV), code 1” when passing Mat object from java to jni function

旧城冷巷雨未停 提交于 2019-12-25 11:14:55
问题 I am running the video camera using the OpenCV function. I pass the Mat object to the jni function it works for awhile, them the error: 10-10 13:03:17.978: A/libc(28693): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9 in tid 28791 (Thread-5418) Java code that runs the camera and calls the jni function: package com.adhamenaya; import java.util.ArrayList; import org.opencv.android.BaseLoaderCallback; import org.opencv.android.CameraBridgeViewBase; import org.opencv.android

OpenCV library package not found

那年仲夏 提交于 2019-12-23 08:33:15
问题 I've been trying to run the "OCV 15 Puzzle" sample app for Android provided by OpenCV, but it's not working; every time I try to run the app a message appears saying: "Package Not Found, OpenCV library package was not found! Try to install it? Yes/No". I press, "Yes" and then I get prompted to a new message saying: "OpenCV Manager, Package Installation Failed!". I installed OpenCV manager from Google Play, so in theory I should be able to run the sample app. I've also been searching

OpenCV multi-threading frames on Android

荒凉一梦 提交于 2019-12-23 03:32:41
问题 I am doing some work with OpenCV on Android. My code was all on the Java interface and its performance was very bad, so I implemented almost all the image processing with JNI. So on Java I have: @Override public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) { _imgBgrTemp = inputFrame.rgba(); jniFrame(_imgBgrTemp.nativeObj); return _imgBgrTemp; } So jniFrame() function takes care of all the image processing in C++, and with this there was a good improvement in

Opencv ANN_MLP training in Android

北城以北 提交于 2019-12-23 02:36:57
问题 I have implemented an ANN character classifier in opencv C++. I have created a model: cv::Mat layers(3,1,CV_32S); layers.at<int>(0,0) = ATTRIBUTES;//400 layers.at<int>(1,0)=25;//hidden layer layers.at<int>(2,0) =CLASSES;// eg. 10 CvANN_MLP nnetwork(layers, CvANN_MLP::SIGMOID_SYM,0.6,1); CvANN_MLP_TrainParams params( cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 1000, 0.000001), CvANN_MLP_TrainParams::BACKPROP, 0.1, 0.1); int iterations = nnetwork.train(training_set, training_set

How to add OpenCV lib to AS3.1.2 and NDK 17.0

烂漫一生 提交于 2019-12-22 17:45:07
问题 I need to use OpenCV in Android Studio 3.1.2. I have the last version at 05/20/2018 of this IDE and the NDK (17.0.4754217). I read this post talking about it, and says something about a problem with the NDK version 16, but is not the case. Most of the guides are for older versions of Android (I saw guides talking about Eclipse IDE for Android development) but no one with the last version or one closest, and it is a problem, since the latest version of AS causes many errors with older projects

Why is Android's ImageReader class so slow?

假装没事ソ 提交于 2019-12-22 10:07:28
问题 I tried OpenCV for Android 3.4.1's brand new JavaCamera2View but it was too slow(~15fps for just showing camera view). When I tried the older JavaCameraView instead, it gave me good results(~30fps, which is the limit of my camera). I wondered the reason why Camera2 version was so slow and looked into the implementation. I commented out all processings and renderings of the image (just letting the camera draw to internal ImageReader object and then reading it off using acquireLastImage()

Mask not displayed in OpenCV camera preview

折月煮酒 提交于 2019-12-21 22:20:16
问题 I want to make a simple Android app which put a mask on a detected face with OpenCV such as this example : Mask on face detection tutorial I translate the C++ into Java for my app.The mask is well resized and the white part eliminated (I displayed the result for testing in an ImageView on the Preview) but the mask never appear on the detected face int the green rectangle : Screenshot of the result My code : public Mat onCameraFrame(CvCameraViewFrame inputFrame) { [...] for( int i = 0; i <