opencv4android

Human body detection using OpenCV in Android

耗尽温柔 提交于 2019-12-21 05:35:20
问题 I want to create an Android application in which i want to detect human body from an image. I haven't started coding yet(its just an idea), so i am not able to show you any codes. I heard about OpenCV face detection for android. I have tried to use OpenCV face detection, But since i am newbie in android, i am not able to do so. My question is "Is there anything in OpenCV that can help me to detect whole human body rather than just face?", if YES then "is there any tutorials regarding this?"

Using Android Studio's C++ support to build nonfree OpenCV modules

为君一笑 提交于 2019-12-17 19:33:32
问题 Background Although older versions of OpenCV (ie 2.4) allow Android projects to utilize SIFT functionality, the separation of that functionality into opencv_contrib makes the task more difficult; integrating a OpenCV-3.x.x-android-sdk module into a project leaves you without the ability to use the SIFT functionality. FeatureDetector.create(FeatureDetector.DYNAMIC_SIFT); // Fails //OpenCV Error: Bad argument (Specified feature detector type is not supported.) Using External Tools Although

opencv4android template matching using camera

天涯浪子 提交于 2019-12-17 17:33:10
问题 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

How to fix gradle task ':app:mergeDebugJniLibFolders' in flutter gradle build for opencv native with NDK?

非 Y 不嫁゛ 提交于 2019-12-14 02:20:15
问题 I'm setting up a new flutter app and I want to add opencv native (c++) plugin using NDK. I've installed and configured OpenCV and NDK (using differents tutorials) and I got this error while I'm trying to build my project ( flutter run ): FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugJniLibFolders'. > java.lang.NullPointerException (no error message) * Try: Run with --stacktrace option to get the stack trace. Run with --info or -- debug

Retrieve exact RGB value from touch event in camera preview

耗尽温柔 提交于 2019-12-14 01:20:47
问题 I've been working on an Android app that simply needs to retrieve and display the coordinates and RGB values of a touch event on the camera preview. I'm a beginner at this programming language and I just wanted to try this but the app keeps crashing during a touch event. Here is the code I tried in Android: /* When copying this code set Permissions: CAMERA * Do this by adding to AndroidManifest.xml: * <uses-permission android:name="android.permission.CAMERA" /> */ import android.app.Activity;

OpenCV4Android - Blank Image After Using MorphologyEX

江枫思渺然 提交于 2019-12-13 06:13:53
问题 So I'm attempting to get a BlackHat Morph of an image but after applying the Morph operation I'm getting a Blank image and I'm not sure why. private coid convertToBlackHat( Mat passedImage ) { // Create a structuring element (SE) int morph_size = 2; Mat element = Imgproc.getStructuringElement( Imgproc.MORPH_RECT, new Size( 2*morph_size + 1, 2*morph_size+1 ), new Point( morph_size, morph_size ) ); Mat dst = new Mat(); // result matrix // Apply the specified morphology operation Imgproc

Java OpenCV - Using knnMatch with findHomography shows duplicates

给你一囗甜甜゛ 提交于 2019-12-13 03:38:44
问题 I am new to OpenCV java and I have an android app that will match two images using ORB FeatureDetector and DescriptorExtractor. I use DescriptorMatcher BRUTEFORCE_HAMMING. All the time the matcher works but other times it shows duplicates of Keypoints. When Image on the Scene is too bright or too dark, it shows duplicate key points which is not what I wanted. The image that accurately matches: The image that is bad matches: try { bmpObjToRecognize = bmpObjToRecognize.copy(Bitmap.Config.ARGB

Opencv4Android grabcut's output image has different colors(brighter colors) than the input image

自作多情 提交于 2019-12-13 02:51:57
问题 public class Grabcut extends Activity { ImageView iv; Bitmap bitmap; Canvas canvas; Scalar color = new Scalar(255, 0, 0, 255); Point tl, br; int counter; Bitmap bitmapResult, bitmapBackground; Mat dst = new Mat(); final String pathToImage = Environment.getExternalStorageDirectory()+"/gcut.png"; public static final String TAG = "Grabcut demo"; static { if (!OpenCVLoader.initDebug()) { // Handle initialization error } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

How to sort List of MatOfPoints according to contour (x,y)

混江龙づ霸主 提交于 2019-12-12 06:45:11
问题 I have a list that contains MatOfPoints which are nothing but contours that I detected from a image using opencv . How do I sort a List<MatOfPoints> according to x and y coordinate of those contours? I know that List has a sort method but I am confused by the Comparator parameter. 回答1: It depends how do you want to compare it, on of solution could be: @Override public int compare(MatOfPoints mop1, MatOfPoints mop2) { long sumMop = 0; long sumMop2 = 0; for( Point p: mop1.toList() ){ sumMop1 +=

java.lang.NullPointerException: Attempt to read from field 'long org.opencv.core.Mat.nativeObj' on a null object reference

情到浓时终转凉″ 提交于 2019-12-12 05:42:31
问题 I am new to openCV and android. I am trying to load an image from Resources using bitmap and process the image using open CV. It gave me this error: java.lang.NullPointerException: Attempt to read from field 'long org.opencv.core.Mat.nativeObj' on a null object reference Code: Bitmap bm = BitmapFactory.decodeResource(getResources(),R.drawable.a1); ((ImageView)findViewById(R.id.imageView)).setImageBitmap(bm); Mat trainImage = new Mat(bm.getHeight(),bm.getWidth(),CvType.CV_32S); Utils