Ask Your Question

Droidkie's profile - activity

2017-11-11 00:46:47 -0600 received badge  Popular Question (source)
2016-05-19 23:32:03 -0600 received badge  Famous Question (source)
2015-04-30 03:34:42 -0600 received badge  Notable Question (source)
2014-05-14 18:10:10 -0600 received badge  Popular Question (source)
2012-10-29 12:00:10 -0600 received badge  Teacher (source)
2012-10-27 00:48:19 -0600 answered a question OpenCV Color Detection

@ognamdik You can try this: http://berenoune.blogspot.com/2012/10/opencv-android-java-color-detection.html It detects the colors: yellow and blue. There is a screenshot on that link that shows 5 colors being detected. Try to modify the code and see how many colors you can detect.

2012-10-19 22:56:44 -0600 received badge  Editor (source)
2012-10-19 22:22:37 -0600 asked a question Bitmap in Android and Mat in OpenCV

I have this code in OpenCV C++:

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace cv;

int main(){
    Mat src = imread("image.jpg");
    if (src.empty())
        return -1;
    pyrMeanShiftFiltering(src,src,10,20,1);
    imshow("src", src);
    waitKey(0);
    return 0;
}

And there is a Sample1View.java class from OpenCV 2.4.2 as a sample named "OpenCV Tutorial 1 - Add OpenCV". Now I want my code to work on Android so I replaced this line:

case VIEW_MODE_GRAY:
    Imgproc.cvtColor(mGraySubmat, mRgba, Imgproc.COLOR_GRAY2RGBA, 4);
    break;

to this:

case VIEW_MODE_GRAY:
    Imgproc.cvtColor(mGraySubmat, mRgba, Imgproc.COLOR_GRAY2RGBA, 4);
    Imgproc.pyrMeanShiftFiltering(mRgba,mRgba,10,20);
    break;

but I get this:

10-20 11:08:45.929: I/Sample::Activity(12846): Menu Item selected Preview GRAY
10-20 11:08:46.049: W/dalvikvm(12846): threadid=9: thread exiting with uncaught exception (group=0x4013a560)
10-20 11:08:46.059: E/AndroidRuntime(12846): FATAL EXCEPTION: Thread-10
10-20 11:08:46.059: E/AndroidRuntime(12846): CvException [org.opencv.core.CvException: ..\..\modules\imgproc\src\segmentation.cpp:345: error: (-210) Only 8-bit, 3-channel images are supported in function void cvPyrMeanShiftFiltering(const CvArr*, CvArr*, double, double, int, CvTermCriteria)
10-20 11:08:46.059: E/AndroidRuntime(12846): ]
10-20 11:08:46.059: E/AndroidRuntime(12846):    at org.opencv.imgproc.Imgproc.pyrMeanShiftFiltering_1(Native Method)
10-20 11:08:46.059: E/AndroidRuntime(12846):    at org.opencv.imgproc.Imgproc.pyrMeanShiftFiltering(Imgproc.java:7247)
10-20 11:08:46.059: E/AndroidRuntime(12846):    at com.duckie.a.Sample1View.processFrame(Sample1View.java:80)
10-20 11:08:46.059: E/AndroidRuntime(12846):    at com.duckie.a.SampleViewBase.run(SampleViewBase.java:185)
10-20 11:08:46.059: E/AndroidRuntime(12846):    at java.lang.Thread.run(Thread.java:1019)

What seems to be the problem? How can I get my code to work in Android? And, how do I do this without having a delay?

2012-09-29 20:16:16 -0600 commented answer Static Initialization Problem

i still get a black screen. when i press Preview RGA, Preview GRAY or Canny, i get "The application has stopped unexpectedly. Please try again."

2012-09-27 09:35:02 -0600 commented answer Static Initialization Problem

i don't know where i went wrong. using Samsung Galaxy Mini 2 that has Android OS, v2.3.6 (Gingerbread). if it's ok with you, may i have a copy of your project so that i can check what i'm doing wrong? [email protected]

2012-09-27 09:13:14 -0600 commented answer Static Initialization Problem

i did what you posted but it still doesn't work. here is the log: <pre>Trying to get library list OpenCV error: Cannot load info library for OpenCV Library list: "" First attempt to load libs Trying to init OpenCV libs Trying to load library opencv_java Trying to load lib /data/data/org.opencv.samples.tutorial1/lib/libopencv_java.so Shared lib '/data/data/org.opencv.samples.tutorial1/lib/libopencv_java.so' already loaded in same CL OpenCV libs init was ok! First attempt to load libs is OK </pre>

2012-09-27 03:46:33 -0600 commented question Static initialization of OpenCV on Android

i also have a similar problem: http://answers.opencv.org/question/2658/static-initialization-problem/ The prebuilt samples work correctly without static initialization but not with static initialization. i hope you can help me.

2012-09-26 12:28:38 -0600 asked a question Static Initialization Problem

i'm trying to run OpenCV Tutorial 1 - Add OpenCV with static initialization using dev_with_OCV_on_Android.html#application-development-with-static-initialization (i don't want a separate OpenCV Manager application installed) but i get an "OpenCV error: Cannot load info library for OpenCV." i did the following things:

  1. added a libs folder with armeabi, armeabi-v7a, and x86 folders inside of it (from OpenCV-2.4.2-android-sdk/sdk/native/libs/>
  2. added the static{if (!OpenCVLoader.initDebug())} code just below private Sample1View mView;
  3. removed the if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack)) code

what seems to be the problem?

2012-09-26 12:22:53 -0600 commented answer OpenCV Tutorial 1 - Add OpenCV on API 8

thank you! ^_^

2012-09-26 12:22:39 -0600 received badge  Scholar (source)
2012-09-26 10:05:56 -0600 received badge  Supporter (source)
2012-09-26 10:05:24 -0600 commented answer OpenCV Tutorial 1 - Add OpenCV on API 8

thank you for the reply! why will API >= HONEYCOMB have a problem? i thought the later APIs support the older APIs? there's also an error in the codes below. what do these codes do? if(FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)){params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);}

2012-09-24 03:24:00 -0600 received badge  Student (source)
2012-09-24 02:37:40 -0600 asked a question OpenCV Tutorial 1 - Add OpenCV on API 8

i'd like to run OpenCV Tutorial 1 - Add OpenCV (VIEW_MODE_RGBA, VIEW_MODE_GRAY, VIEW_MODE_CANNY) on API 8 and not API 11 but SampleViewBase.java has an import problem (import android.graphics.SurfaceTexture;) because SurfaceTexture did not exist yet on API 8.

is there an object on API 8 that can replace SurfaceTexture so that the code will work? a sample code will help a lot.