Ask Your Question

lobi's profile - activity

2019-12-19 00:29:36 -0600 received badge  Famous Question (source)
2019-01-17 01:01:35 -0600 received badge  Popular Question (source)
2018-10-21 12:06:31 -0600 received badge  Popular Question (source)
2017-06-29 07:35:11 -0600 received badge  Notable Question (source)
2016-04-25 06:33:39 -0600 received badge  Famous Question (source)
2016-01-22 09:05:09 -0600 received badge  Popular Question (source)
2015-12-23 03:47:55 -0600 received badge  Notable Question (source)
2015-12-07 02:09:10 -0600 received badge  Popular Question (source)
2015-07-17 12:28:32 -0600 received badge  Student (source)
2015-06-17 10:01:38 -0600 received badge  Notable Question (source)
2015-04-29 10:42:36 -0600 received badge  Famous Question (source)
2014-12-05 01:11:25 -0600 asked a question After installation I can't use OpenCV adfadsfasdfsda

Hello,

I follow this tutorial how to install openCV. After installation I tried to run this two sampels, but I get the following errors:

include <highgui.h>

int main(int argc, char ** argv) {

IplImage* img = cvLoadImage(argv[1]);
cvNameWindow("Example1", CV_WINDOW_AUTOSIZE);
cvShowImage("Example1", img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("Example1");

return 0;

}

e1.cpp:1:21: fatal error: highgui.h: No such file or directory
 #include <highgui.h>
                     ^
compilation terminated.

include <stdio.h>

#include <opencv2/opencv.hpp>

using namespace cv;

int main(int argc, char** argv )
{
    if ( argc != 2 )
    {
        printf("usage: DisplayImage.out <Image_Path>\n");
        return -1;
    }

    Mat image;
    image = imread( argv[1], 1 );

    if ( !image.data )
    {
        printf("No image data \n");
        return -1;
    }
    namedWindow("Display Image", WINDOW_AUTOSIZE );
    imshow("Display Image", image);

    waitKey(0);

    return 0;
}

/tmp/ccVkJxtd.o: In function `main':
ex2.cpp:(.text+0x92): undefined reference to `cv::imread(std::string const&, int)'
ex2.cpp:(.text+0x12a): undefined reference to `cv::namedWindow(std::string const&, int)'
ex2.cpp:(.text+0x15b): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
ex2.cpp:(.text+0x19b): undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'
ex2.cpp:(.text+0x1c3): undefined reference to `cv::waitKey(int)'
/tmp/ccVkJxtd.o: In function `cv::Mat::~Mat()':
ex2.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to `cv::fastFree(void*)'
/tmp/ccVkJxtd.o: In function `cv::Mat::operator=(cv::Mat const&)':
ex2.cpp:(.text._ZN2cv3MataSERKS0_[_ZN2cv3MataSERKS0_]+0x111): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
/tmp/ccVkJxtd.o: In function `cv::Mat::release()':
ex2.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x47): undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status

What I did wrong?

Thanks.

2014-10-25 15:32:35 -0600 received badge  Notable Question (source)
2014-09-09 07:54:16 -0600 received badge  Popular Question (source)
2014-06-02 11:19:25 -0600 received badge  Popular Question (source)
2013-11-03 16:03:55 -0600 received badge  Scholar (source)
2013-11-01 19:52:23 -0600 commented answer I can't compile JNI file

I find my mistake

my name of Application.mk file was Aplication.mk

f.... PPPPPPPPPPPPPPPPPPPPPPPPPPPP

Thomas THANKS for your help!!!!!!

2013-11-01 17:02:13 -0600 commented answer I can't compile JNI file

slani@user:~/code/androCV/RgbToHsv$ ../../android-ndk-r9/ndk-build Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 10 in ./AndroidManifest.xml

Compile++ thumb : testLibrary <= detect.cpp In file included from /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv/cv.h:64:0, from jni/detect.cpp:2: /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv2/core/core.hpp:56:21: fatal error: algorithm: No such file or directory compilation terminated. make: * [obj/local/armeabi/objs/testLibrary/detect.o] Error 1

your and my Android.mk and Aplication.mk files are the same.

2013-11-01 17:00:26 -0600 commented answer I can't compile JNI file

This si youre inlcudes in jni .cpp file

include <jni.h>

include <opencv/cv.h>

include <opencv2/imgproc/imgproc.hpp>

include <opencv2/features2d/features2d.hpp>

include <android/log.h>

and I run ndk-build on your test project

that what I get slani@user:~/Downloads/testApp$ ../../code/android-ndk-r9/ndk-build Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml

Compile++ thumb : testLibrary <= detect_jni.cpp SharedLibrary : libtestLibrary.so Install : libtestLibrary.so => libs/armeabi/libtestLibrary.so

and this is my includes in my jni .cpp file

include <jni.h>

include <opencv/cv.h>

include <opencv2/imgproc/imgproc.hpp>

include <opencv2/features2d/features2d.hpp>

and what I get

2013-11-01 16:49:40 -0600 commented answer I can't compile JNI file

/home/slani/code/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.8/include

here I can find algorithm.

Very strange is, that tutorial .cpp inlcude same OpenCV file and nkd-build just fine (so it must finds algorithm file). But in my project not.

Thanks for download

2013-10-30 18:38:22 -0600 commented answer I can't compile JNI file

If I like to use JNI I should convert my android project to C/C++ poject and this automaticaly adds C/C++ Nature in Eclipse

2013-10-30 18:29:04 -0600 commented answer I can't compile JNI file

Can you please send me your project?

Thanks

2013-10-30 18:25:03 -0600 commented answer I can't compile JNI file

I use all of your posted coode. I get the same error.

~/code/androCV/Test$ ../../android-ndk-r9/ndk-build

Compile++ thumb : testLibrary <= detect_jni.cpp In file included from /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv/cv.h:64:0, from jni/detect_jni.cpp:10: /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv2/core/core.hpp:56:21: fatal error: algorithm: No such file or directory compilation terminated. make: * [obj/local/armeabi/objs/testLibrary/detect_jni.o] Error 1

And I get the same errors. How can ndk-build now in which files it should looks for header files? If we are using ndk-build comand in terminal I still don't know how can ndk-build comand on tutorial poject build libs, but in my porject wont do this.

2013-10-30 14:21:03 -0600 commented answer I can't compile JNI file

Thanks for your answer. I try to use oure Android.mk but dosen't work. I get the same error. In file included from /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv/cv.h:64:0, from jni/detect_jni.cpp:2: /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv2/core/core.hpp:56:21: fatal error: algorithm: No such file or directory compilation terminated. make: * [obj/local/armeabi/objs/testLibrary/detect_jni.o] Error 1

I don't get it. If run ndk-build in tutorial-2-mixedprocessing folder. It's build normaly.

But when I run in ndk-build in myproject folder. I get erros. But Android.mk filse is the same. Bouth .cpp files include the same things. What I did wrong.

P.S. I remove one bracket

2013-10-30 05:29:53 -0600 commented question I can't compile JNI file

I'm very frustrated. I don't know what to do. I went through all steps thousand times.

I don.t know why ndk-build wont find android file. Very strange is, if I compile with ndk-build OpencCv samples it's build normaly. ndk-build finds all file. I also try include complete path to algorithme file in core file. But then I get error to find next file include in algorithm file.

2013-10-30 04:15:25 -0600 commented question I can't compile JNI file

Please help me

2013-10-29 17:38:59 -0600 commented question I can't compile JNI file

Should I rewrite the same question???

2013-10-29 17:12:21 -0600 asked a question I can't compile JNI file

Hello,

This is the question I asked on stackoverflow., but nobody can help me.

http://stackoverflow.com/questions/19631634/cant-compile-android-project-wiht-jni-code-algorithm-not-found

I will ask the same question here. I'm trying to build simple android app with some JNI code. I already try this [suggestion][1], but isn't help

When I press build project in eclipse I get this error:

Description Resource    Path    Location    Type
fatal error: algorithm: No such file or directory   Tracker     line 56, external location: /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv2/core/core.hpp  C/C++ Problem
make: *** [obj/local/armeabi/objs/detect_jni/detect_jni.o] Error 1  Tracker         C/C++ Problem

Line 56 in core.hpp contains the relevant include.

This is my Android.mk file jni folder:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

include /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/OpenCV.mk

LOCAL_MODULE    := detect_jni
LOCAL_SRC_FILES := detect_jni.cpp

include $(BUILD_SHARED_LIBRARY)

This is my Aplication.mk file in jni folder:

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

This is my .cpp file:

#include <jni.h>
#include <opencv/cv.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>

using namespace cv;

extern "C"{
    JNIEXPORT void JNICALL Java_com_slani_tracker_OpenCamera_findObject((JNIEnv *env, jlong addRgba, jlong addHsv);
    JNIEXPORT void JNICALL Java_com_slani_tracker_OpenCamera_findObject((JNIEnv *env, jlong addRgba, jlong addHsv)
    {

        Mat& rgba = *(Mat*)addRgba;
        Mat& hsv = *(Mat*)addHsv;

        cvtColor(rgba, hsv,CV_RGBA2HSV);

    }
}

![This is my path and symbols in eclipse

This is path to my ndk-build

Thanks

2013-10-27 09:28:46 -0600 commented answer Convert rgba to hsv in android (JNI)

Ok. I made a mistake in Android.mk file. I misspell my cpp file. But now I get this error

In file included from /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv/cv.h:64:0, from jni/detect_jni.cpp:2: /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv2/core/core.hpp:56:21: fatal error: algorithm: No such file or directory compilation terminated. make: * [obj/local/armeabi/objs/detect_jni/detect_jni.o] Error 1

2013-10-27 07:53:40 -0600 commented answer Convert rgba to hsv in android (JNI)

Thanks for your answer, but I'm not sure if I understand it. I implement findObject method in .cpp file in jni folder.

When I run my project ndk build successfully. * Build of configuration Debug for project Tracker *

/home/slani/code/android-ndk-r9

* Build Finished *

I also include this in my java file

public native void findObject(long rgbaAdd, long hsvAddr);

2013-10-27 04:44:09 -0600 asked a question Convert rgba to hsv in android (JNI)

Hello,

i'm trying to learn OpenCV with JNI.

I made a program which tracks an object in Java for android, but now I like to make the same code in C++.

Firstly I would like to convert RGBA to HSV and show this on my screen, but when I run my application I get this error.

Sorry!
The Application Trcker (process com.slani.tracker) has stopped unexpectedly. Please try again.
Force Close

Here is my onCameraFrame method.

@Override
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {

    Mat rgba = inputFrame.rgba();
    Mat hsv = new Mat()

    findObject(rgba.getNativeObjAddr(), hsv.getNativeObjAddr());
    return hsv;
}

Here is my JNI

#include <jni.h>
#include <opencv2/highgui/highgui.hpp">
#include <opencv/cv.h">


extern ā€œCā€ {
    JNIEXPORT void JNICALL Java_com_slani_tracker_OpenCamera_findObject(JNIEnv * jenv, jclass, jlong addRgba, jlong addHsv)
    {

        Mat& rgba = *(Mat*)addRgba;
        Mat& hsv = *(Mat*)addHsv;

        cvtColor(rgba, hsv,CV_RGBA2HSV);

}
}

Here is my log file http://bpaste.net/show/21RTfuqxs8wtIMaH2jNL/

Can someone please tell me what I'm doing wrong?

Thanks

2013-10-25 16:08:30 -0600 asked a question Smart phones Camera captures speed

Hello,

What is the average camera captures speed of smart phones? Is this depending from software (using java or native C++ OpenCV) or only hardware?

Thanks,

Best

2013-10-17 17:55:19 -0600 commented question "unfortunately helloopencv has stopped"

The same thins is happened with sample android project, which include c++ code. Sample project written only in Java works Ok.

2013-10-17 17:07:56 -0600 commented question "unfortunately helloopencv has stopped"

how can I do debug? were can I find error file?

2013-10-15 19:54:41 -0600 asked a question "unfortunately helloopencv has stopped"

Hello,

I tired to run Hello OpenCv project from official tutorial (http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html#dev-with-ocv-on-android)

But when I try to run a code I get error msg from my android emulator "unfortunately helloopencv has stopped"

I can run sample project from opencv4android folder.

Here is the code:

package com.example.helloopencv;

import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Mat;


import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceView;
import android.view.WindowManager;

public class HelloOpenCvActivity extends Activity {

    private static final String  TAG = "Sample: Hello OpenCv";
    private CameraBridgeViewBase mOpenCvCameraView;

    private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
        @Override
        public void onManagerConnected(int status) {
            switch (status) {
                case LoaderCallbackInterface.SUCCESS:
                {
                    Log.i(TAG, "OpenCV loaded successfully");
                    mOpenCvCameraView.enableView();
                } break;
                default:
                {
                    super.onManagerConnected(status);
                } break;
            }
        }
    };


     @Override
     public void onCreate(Bundle savedInstanceState) {
         Log.i(TAG, "called onCreate");
         super.onCreate(savedInstanceState);
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
         setContentView(R.layout.activity_hello_open_cv);
         mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.HelloOpenCvView);
         mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
         mOpenCvCameraView.setCvCameraViewListener((CvCameraViewListener2) this);
     }

     @Override
     public void onPause()
     {
         super.onPause();
         if (mOpenCvCameraView != null)
             mOpenCvCameraView.disableView();
     }

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

     public void onDestroy() {
         super.onDestroy();
         if (mOpenCvCameraView != null)
             mOpenCvCameraView.disableView();
     }

     public void onCameraViewStarted(int width, int height) {
     }

     public void onCameraViewStopped() {
     }

     public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
         return inputFrame.rgba();
     }

}

Best

2013-10-15 16:24:39 -0600 commented answer Android OpenCv lib are missing

Now ti works. Thanks for your time. Best

2013-10-14 09:59:54 -0600 commented answer Android OpenCv lib are missing

there is no opencv-android-sdk/sdk/java in opencv-2.4.6.1

2013-10-14 09:57:09 -0600 commented answer Android OpenCv lib are missing

*CAN'T add it.

2013-10-14 09:45:11 -0600 commented answer Android OpenCv lib are missing

Yes, I tried. But there is no library in opencv-2.4.6.1 in sampels (not in others folders). So I can add it. This is the problem. I relay need help.

I folow all instructions from official tutorials

2013-10-14 08:05:32 -0600 edited question Android OpenCv lib are missing

Hello,

I tried to import sample android project into Eclipse. But I get an error. All android lib are missing

import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener;
import org.opencv.android.JavaCameraView;

Where can I find this lib? I can run OpenCv Java project, but I don't know why android lib are missing.

Can some one help me.

Thanks