Ask Your Question

Nawara's profile - activity

2017-12-21 08:14:15 -0600 received badge  Notable Question (source)
2016-05-21 09:08:44 -0600 received badge  Popular Question (source)
2015-10-17 14:02:42 -0600 received badge  Student (source)
2015-03-13 02:49:58 -0600 asked a question The opencv Mat object (java)

I'am new to opencv I want to understand the opencv Mat class

For the get method

I try the first one int get(int row, int col, byte[] data) with this example

  Mat mat = Mat.eye( 3, 3, CvType.CV_8UC1 );
  System.out.println(mat.dump());
  byte[] data = new byte[mat.cols() * mat.rows() * (int)mat.elemSize()];
  System.out.println(data.length);-->9
  System.out.println( mat.get(0, 0, data)); -->9

but I can't understand

1) the role of the third argument byte[] data

2) and the result

2015-02-27 07:09:11 -0600 received badge  Enthusiast
2015-02-24 03:49:20 -0600 asked a question Fatal signal 11 when using SUFR detector from opencv4android

I try to use the SURF Feature detector from Opencv4Android

This is my code

       public void onManagerConnected(int status) {
        switch (status) {
            case LoaderCallbackInterface.SUCCESS:
            {

   fileimage = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/Pictures/263.jpg");

                if (fileimage.exists())



                image = Highgui.imread(fileimage.getAbsolutePath() ,Highgui.CV_LOAD_IMAGE_COLOR);

                else Log.i("activity","dont exit")       ;


                FeatureDetector fd = null ;

              try
              {
                fd= FeatureDetector.create(FeatureDetector.SURF);

                }
              catch (NullPointerException e)
              {
                    e.printStackTrace();
                }


            MatOfKeyPoint keypoints= new MatOfKeyPoint(); 




            try 
                {

                fd.detect(image, keypoints);


                } catch (Exception e) {

                    e.printStackTrace();
            }

My log file is the following

       02-24 09:40:19.235: D/OpenCVManager/Helper(12695): Init finished with status 0
      -24 09:40:19.235: D/OpenCVManager/Helper(12695): Unbind from service
      -24 09:40:19.284: D/OpenCVManager/Helper(12695): Calling using callback
       -24 09:40:19.636: A/libc(12695): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0  in tid 12695 (mples.tutorial2)
2015-02-16 04:55:49 -0600 commented question SURF & SIFT feature detector and descriptor on OpenCV android

no.. the program is blocked in this instruction

2015-02-16 03:39:39 -0600 commented question SURF & SIFT feature detector and descriptor on OpenCV android

there is no results and the app crash

2015-02-16 03:36:33 -0600 received badge  Editor (source)
2015-02-16 03:33:51 -0600 asked a question SURF & SIFT feature detector and descriptor on OpenCV android

I want to detect image keypoints. I tried the following code with differents feature detectors from the OpenCV library.

It work for ORB , BRISK , FAST , etc. But not for SURF/SIFT and even MSER detector !

 public class ReadImaageActivity extends ActionBarActivity {

 Mat image ; File fileimage ;
 TimePicker time ; 
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
        @Override
        public void onManagerConnected(int status) {
            switch (status) {
                case LoaderCallbackInterface.SUCCESS:
                {
                    Log.i("activity", "OpenCV loaded successfully");

                    fileimage = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/7.jpg");

                    if (fileimage.exists())

                    image = Highgui.imread(fileimage.getAbsolutePath() ,Highgui.CV_LOAD_IMAGE_COLOR);

                    else Log.i("activity","dont exit")       ;


                //  

                    long startTime = System.nanoTime();

                    FeatureDetector fd= FeatureDetector.create(FeatureDetector.SURF);

                    MatOfKeyPoint keypoints= new MatOfKeyPoint(); 
                    try 
                    {

                    fd.detect(image, keypoints);

                } catch (Exception e) {
                    e.printStackTrace();
                }

                    long endTime = System.nanoTime();

                    long duration = (endTime - startTime)/1000000;  //divide by 1000000 to get milliseconds.



                    if (!keypoints.empty())
                    {   

                        Log.i("Keypoints", "is not empty"); 


                        System.out.println("duration"+""+duration);


                        System.out.println("size"+""+keypoints.size());
                }
                    else
                            Log.i("Keypoints", "is not empty");
                /*
                    Mat descriptors=new Mat();
                    DescriptorExtractor dex =DescriptorExtractor.create(DescriptorExtractor.SURF);


                    {   


                    dex.compute(image, keypoints, descriptors);

                    long endTime = System.nanoTime();

                    long duration = (endTime - startTime)/1000000;  //divide by 1000000 to get milliseconds.
                    System.out.println(descriptors.size());
                    System.out.println("duration"+duration);
                    }
                    else System.out.println("a3");

                    */










                } break;
                default:
                {
                    super.onManagerConnected(status);
                } break;
            }
        }
    };
@SuppressLint("NewApi") @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_read_imaage);


 }

@Override
public void onResume()
{
    super.onResume();
    OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this, mLoaderCallback);
}

          }

the code is tested with my debvice ZTE Blade android 2.3.7