Ask Your Question

mnut's profile - activity

2018-04-24 07:32:32 -0500 received badge  Famous Question (source)
2015-08-13 21:32:11 -0500 received badge  Notable Question (source)
2014-09-26 10:48:00 -0500 received badge  Popular Question (source)
2014-02-20 18:13:23 -0500 received badge  Nice Question (source)
2013-01-27 16:27:37 -0500 asked a question Debugging native openCV code for Android on Eclipse

Is there an easy way to debug native openCV code for Android on Eclipse?

I would like to put breakpoints in the native OpenCV code and step through the code. By default, in Eclipse, breakpoints placed in jni cpp files do not pause the program. Only breakpoints in the java files seem to work. Is there a setting that needs to be changed or a toolbox that needs to be downloaded? Thanks

2013-01-26 23:22:53 -0500 commented answer OpenCV4Android conversion from MatOfKeyPoint to MatOfPoint2f

Thank you very much! This helped immensely. I am new to OpenCV4Android. Is there a description about how data is transferred between java and native memory on OpenCV's website? Knowing that MatOfxxx are native objects would have been very useful for my understanding. @Andrey

2013-01-26 23:18:12 -0500 received badge  Scholar (source)
2013-01-24 16:56:50 -0500 received badge  Editor (source)
2013-01-24 16:52:30 -0500 answered a question Very simple TrainCascade not working

It is not easy to say for sure what is wrong with the cascade you built. Here are some questions that might help you fix the issue. (1) Is the star in the search image /test image roughly the same size as the star in the positive set? I think the boosted cascade is only good until certain amount of scaling. Try making the star in your test image the same size as the stars in your training set. (2) Try fewer cascade stages when training your cascade. You should get a result where you see a lot of "false positive" detections in your test image. If you see this, then you can start increasing the number of stages. Now you should see some false detections vanish. (3) For testing, try to place the star on one of your negative images (instead of a white background) and see what you get as results. (4) Boosting is good when you train it properly. The negative images are important too. It is good if they should represent the negative instances you are likely to come across in your test set.

I have not used createsamples to generate positive samples automatically (with the -img option). I have used manually marked positive samples (-info option). I would try creating a positive set of 20-30 stars by hand and then creating a vec file using -info option. http://docs.opencv.org/doc/user_guide/ug_traincascade.html#positive-samples

I would not suggest using haartraining. train_cascade is the new version of training and should give you the same results as haartraining, but with more options for improving.

Boosting is great when the object does not change much in appearance. It should certainly work for logos on a piece of paper. Whether it will work for logos that are seen from different angles or not is questionable. Boosting also needs lots of training data (both positive and negative) to do a good job. It is certainly a good algorithm that is worth pursuing. It works, as many face detection researchers will tell you.

2013-01-18 07:23:57 -0500 received badge  Student (source)
2013-01-17 17:12:36 -0500 answered a question installing OpenCV manager for emulatur

It should be in the folder <opencv android="" folder="">/apk You should see many .apk files. I would download the SDK again and unzip it. It worked the very first time for me. I am not an expert, but I think the apk files intall the manager on the emulated device that is currently running. adb will check if any emulators are active and install the manager on the active emulator. Also the documentation for OpenCV is not very up-to-date. The apk filenames mentioned in the documentation are not accurate. Use the filenames you see in the apk folder. Good luck!

2013-01-17 16:16:52 -0500 received badge  Supporter (source)
2013-01-17 16:05:25 -0500 commented question installing OpenCV manager for emulatur

I recently did this process. It was straightforward. I cd into the folder where the apk files are and then issued the adb install command. Also, the emulator device must be running when you issue the command - although that cannot be the source of your error

2013-01-17 13:26:02 -0500 asked a question OpenCV4Android conversion from MatOfKeyPoint to MatOfPoint2f

I am trying to use OpenCV for Android (OpenCV 2.4.3) I am writing a program to track keypoints. I am trying to use FeatureDetector to detect keypoints and then Video.calcOpticalFlowPyrLK to track them. The question that has me stumped is that the FeatureDetector function returns a MatOfKeyPoint while calcOpticalFlowPyrLK takes a MatOfPoint2f.

Here is my code so far:

//Feature detector for LKT flow estimation
FeatureDetector cvFeatureDetector;

//Vector of keypoints
MatOfKeyPoint keypoints;
...
//intitialize detector
cvFeatureDetector = FeatureDetector.create(FeatureDetector.GFTT);

keypoints = new MatOfKeyPoint();
...
//mPrevImgMat is a grayscale image - previous frame
//mCurrentImgMat is a grayscale image - current frame

//Run feature detector in previous image
cvFeatureDetector.detect(mPrevImgMat, keypoints);

MatOfPoint2f keypointsFound = new MatOfPoint2f();
MatOfByte keypointsStatus = new MatOfByte();
MatOfFloat err = new MatOfFloat();
Size winSize = new Size(25,25);
int maxLevel = 3;

//Optical flow to find keypoints in current image
Video.calcOpticalFlowPyrLK(mPrevImgMat, mCurrentImgMat, keypoints,
            keypointsFound, keypointsStatus, err, winSize, maxLevel);

//Obviously "keypoints" in the line above does not work. How does one covert
//keypoints to MatOfPoint2f?

Things I have tried unsuccessfully so far:

  1. keypoints.convertTo()
  2. Creating a vector from keypoints and then trying to populate a vector of Point Vector pointList. Then typecast to MatOfPoint2f when calling flow funciton (MatOfPoint2f) pointList
  3. Trying to populate a MatOfPoint2f from scratch. Cant figure out how to do this 4 Using fromArray method in MatOfPoint2f - Not sure what this method does. Documentation is blank for this method. Am I missing something obvious?