Ask Your Question

Some One's profile - activity

2020-11-06 08:20:15 -0600 received badge  Notable Question (source)
2020-11-06 08:20:15 -0600 received badge  Popular Question (source)
2020-11-04 09:24:17 -0600 received badge  Popular Question (source)
2017-04-19 09:36:50 -0600 commented question SVM predicting '1' for every test image.

@Akash have you solved your problem i facing the same error?

2017-03-21 05:08:11 -0600 asked a question How to use opencv_xfeature2d in opencv 3.1 in Android studio?

Based on this solution i was able to build the xfeature2d module of opencv 3.1. And now i want to use the xfeature2d in android NDK so added the libopencv_java3.so and libnonfree.so into the jniLibs folder of android studio. In many question like this and this they suggest "don't forget to link opencv_xfeatures2d" How do you link opencv_xfeature2d? I used cmake build and here is the cmake file

cmake_minimum_required(VERSION 3.4.1)
    add_library(native-lib
               SHARED
               src/main/cpp/native-lib.cpp )
    add_library( # Sets the name of the library
             nonfree
             # Sets the library as shared library.
             SHARED
             # indicate the library is prebuilt.
             IMPORTED )
    set_target_properties( # Specifies the targeted library.
                         nonfree
                       # Specifies the parameter you want to define.
                          PROPERTIES IMPORTED_LOCATION
                        # Specifies the location of the library.
             ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libnonfree.so )
    include_directories(C:/Users/what/Documents/OpenCV-android-  
    sdk/sdk/native/jni/include)
    add_library( lib-opencv SHARED IMPORTED )
    set_target_properties(lib-opencv PROPERTIES IMPORTED_LOCATION    
    ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libopencv_java3.so)
    find_library(log-lib
                  log )
    target_link_libraries( native-lib
                       # prebuilt library nonfree.
                       nonfree
                       # prebuilt library opencv java.
                       lib-opencv
                       ${log-lib} )

Then in my MainActivity.java i have

static {
    System.loadLibrary("native-lib");
    if (!OpenCVLoader.initDebug()) {
        // Handle initialization error
        Log.d(TAG, "static initializer: failed");
    } else {
        Log.d(TAG, "static initializer: successful");
        System.loadLibrary("opencv_java3");
        System.loadLibrary("nonfree");
    }

//to load the opencv and the nonfree prebuilt library. And this line code to call to the native method.

MainActivity.processImage(image.getNativeObjAddr(),finalResult.getNativeObjAddr()); But when i use sift in the .cpp file the application crashes without no error. Here is the native-lib.cpp file

#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/xfeatures2d/nonfree.hpp>
#include <opencv2/xfeatures2d.hpp>
using namespace std;

extern "C"
{
JNIEXPORT void JNICALL
Java_com_the_example_opencv31cmake_MainActivity_processImage(JNIEnv *env, jclass type,
                                                             jlong imagesAddress_,
                                                             jlong resultAddress) {

    cv::Mat input=*(cv::Mat*)imagesAddress_;
     vector<cv::KeyPoint> keypoint;
     cv::Ptr<cv::xfeatures2d::SIFT> sift=cv::xfeatures2d::SIFT::create();
      cv::Mat siftDetectedImage;
      cv::cvtColor(input,siftDetectedImage,CV_BGRA2BGR);
      sift->detect(siftDetectedImage,keypoint);
      cv::Mat imageDescriptor;
      sift->compute(siftDetectedImage,keypoint,imageDescriptor);
      cv::drawKeypoints(siftDetectedImage,keypoint,siftDetectedImage,cv::Scalar(255,0,0),cv::DrawMatchesFlags::DRAW_OVER_OUTIMG);
      cv::Mat image3;
       cv::cvtColor(imageDescriptor,image3,CV_BGR2BGRA);
      cv::Mat &resultImage=*(cv::Mat*)resultAddress;
      resultImage=image3;

}
}
2017-01-04 00:51:30 -0600 received badge  Enthusiast
2017-01-03 01:17:34 -0600 asked a question Error:(45) *** Android NDK: Aborting . Stop?

There are many similar question but none of them help and some of them are not answered like this. I am integrating opencv 3.1 with into android studio 2.2.2 to use c++ code in android i have android NDK downloaded by the android studio and i have Android.mk and Application.mk files.

Android.mk file

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#opencv
OPENCVROOT:=C:\Users\The\Documents\OpenCV-android-sdk
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on
OPENCV_LIB_TYPE:=SHARED
include ${OPENCVROOT}\sdk\native\jni\OpenCV.mk
LOCAL_SRC_FILES :=print.cpp
LOCAL_LDLIBS += -llog
LOCAL_MODULE := MyLib
include $(BUILD_SHARED_LIBRARY)

Application.mk file

 APP_STL := gnustl_static
 APP_CPPFLAGS := -frtti -fexceptions
 APP_ABI :=all
APP_PLATFORM := android-25

This worked but i need the opencv extera-module i followed many tutorials like this but i am unable to build opencv from source with extera-module then i decided to use opencv 2.4 but when i change the above Android.mk openc-android-sdk location to opencv 2.4 the Error:(45) * Android NDK: Aborting . Stop error occurring. What is wrong it worked for opencv 3.1 but it doesn't work in opencv 2.4?

2016-12-28 11:49:06 -0600 commented question Generalized hough transform implementation in Opencv?

i don't know i just take a random image

2016-12-27 05:38:39 -0600 commented answer Generalized hough transform implementation in Opencv?

Thanks can you suggest me any tutorial or book on how to use the Generalized Hough transform the documentation doesn't have clear how to use instruction.

2016-12-27 05:38:17 -0600 received badge  Scholar (source)
2016-12-27 05:17:32 -0600 received badge  Supporter (source)
2016-12-26 00:38:32 -0600 asked a question Generalized hough transform implementation in Opencv?

From this question on stack overflow i know there is no opencv implementation for generalized hough tranform but in the opencv documentation here there is cv::GeneralizedHough class what does this class do? I know SIFT and SURF are good at object recognition but recognize small and specific shaped objects in image i think generalized hough tranform is good. Example for the image below which algorithm is good? image description