Ask Your Question

V.G.'s profile - activity

2012-12-18 08:29:18 -0600 commented answer Running the OpenCV4Android application on my PC

Ok, this "forum" is much more local, than StackOverflow and most people, who give answers here are somehow related to OpenCV development, so they aren't paid to watch and moderate these pages all day long. Mutual respect is one of the key factors for most open source communities out there — I'm trying to notify people about that one more time.

2012-12-18 07:52:49 -0600 answered a question OpenCV Paths Headaches in Eclipse with android

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-15 04:16:45 -0600 received badge  Necromancer (source)
2012-12-15 04:16:08 -0600 received badge  Necromancer (source)
2012-12-14 03:59:22 -0600 answered a question Error building Android OpenCV 2.4.2 Tutorial

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-14 03:58:04 -0600 answered a question Running the OpenCV4Android application on my PC

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-14 03:40:22 -0600 received badge  Critic (source)
2012-12-14 03:38:22 -0600 answered a question how to use opencv in java?

Our introductory tutorials are to the rescue, if that's what you mean.

Especially this one may be useful.

2012-12-14 03:11:29 -0600 answered a question Android java convertTo

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-14 03:10:46 -0600 answered a question Work with function calcOpticalFlowPyrLK

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-14 03:09:02 -0600 answered a question tuto Android 4.1.1 + OpenCV 2.4.2 + Nexus S

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-14 03:05:39 -0600 answered a question How the libopencv_java.so is copy to the apk when it is used the static lib type?

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-14 03:02:06 -0600 answered a question opencv for desktop java

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-14 02:57:12 -0600 answered a question FaceRecognizer.java in Opencv4Android 2.4.3

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-12-14 02:55:59 -0600 answered a question Problem loading the jni lib with OCV Manager

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

2012-10-10 07:37:12 -0600 received badge  Supporter (source)
2012-10-02 06:09:09 -0600 edited answer filter2D and sepFilter2D, specifying the value for a constant border

If you want to use BORDER_CONSTANT, you should manually add border to your image with copyMakeBorder) function (see tutorial)

2012-10-02 06:02:18 -0600 edited answer object detection using SURF & FLANN

Hi, It all depends on your computation time constraints.

Whatever the descriptor (SIFT, SURF, etc.)... each one having its computation time...

Using the FLANN matcher is fast but is approximate so that mismatches happen more often... then, it is common to see more mismatches even if using an accurate descriptor only because the matcher is not that appropriate... then, find the compromise !

Instead of using the FlannBasedMatcher, you should try C++: BFMatcher::BFMatcher(int normType, bool crossCheck=false ) http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_matchers.html?highlight=crosscheck.

This matcher is brute force then it requires much more processing power but... it is more precise.

In addition, you can try different setups : choose the distance (normType parameter) : NORM_L1 is efficient and low cost, NORM_L2 "can" be better but is more expensive.. but you can use NORM_L2SQR which is equivalent to the L2 distance but avoids the square root computation, avoiding some CPU usage.

If you use crossCheck=true, this will allow a more refined matching by trying to match in both directions (img1->img2 and img2->img1) and keep common matches... but this will result in fewer matches. However, take care, a bug report has been sent this summer : on current trunk, crossCheck=true leads to some wrong computations... (see http://code.opencv.org/issues/2292

If you do not use the crossCheck=true setup, then, I recommend to not use directly the BFmatchers object but prefer the static allocation method :

C++: Ptr<descriptormatcher> DescriptorMatcher::create(const string& descriptorMatcherType), then, use "BruteForce-L1", "BruteForce-L2", "BruteForce-SL2" or "FlannBased" to choose the appropriate matching method, this makes your program more flexible.

Have a nice code ;o)

2012-10-02 06:01:11 -0600 edited answer How do I install OpenCV with IPP and TBB?

There is a cool video that if you pay attention to every step there is no chance to get lost.

The key is to download the TBB package to a folder (in the video is called "dep"), and when you click configure in CMake the route will be NOT FOUND, so you have to set it manually and click configure again. The same for IPP.

I think this video tutorial is what you need, there is no chance to fail.

2012-10-02 05:58:42 -0600 edited answer Pose estimation with SIFT and homography

I think you should be a little more specific in your question.

If your asking how to obtain the rotation and translation (extrinsic parameters) of the camera using an homography, this problem is known as Homography Decomposition. For instance, if you want to insert an augmented object in your book, you will need these parameters (simply computing the perpendicular vector to X and Y will lead to errors).

Notice that to estimate the R and t from the homography you will need the instrinsic parameters of the camera, which can obtained using the calibration method present in OpenCV. These parameters will remain the same for all sequences of the camera.

Finally, you need to implement a couple of equations to extract the extrinsic parameters, they are well described in this great paper by Zhang:

A Flexible New Technique for Camera Calibration

Of course, this depends in what you really want to do in your application. I hope this can help.

2012-10-02 05:58:26 -0600 edited answer How to train cascade classifier

Hi KDS,
you have to create a .vec file from your positives file using the opencv_createsamples tool, e.g.

opencv_createsamples -info positives.dat -num 1000 -vec positives.vec -w 24 -h 24

This would create a positives.vec file from 1000 positve samples listed in positives.dat. The sample width and height are 24. This .vec file is than passed to opencv_traincascade for training. For the negatives you just pass a file containing the file names of your negative samples. For further informations i found this, that, and that good resources. But you've probably found them already...

To create the opencv_createsamples tool you should configure OpenCV with BUILD_EXAMPLES=ON (i think).

2012-10-02 05:57:48 -0600 edited answer findCirclesGrid

Have you tried with the actual circle grid image provided by opencv?

You can find it here for example:

http://docs.opencv.org/trunk/_downloads/acircles_pattern.png

2012-10-02 05:56:23 -0600 edited question Using Setters and Getters in AlgorithmInfo::addParam for Algorithm inheritance

I am working on creating my own algorithm inheriting from cv::Algorithm using the reference from the OpenCV docs. I have created my own classes that inherit from cv::Algorithm with success but I am having difficulty with this one since it has a member m_model which is a stuct from a library that can't be modified because the MyAlgorithm class is wrapping the functionality in this struct.

Anyways, I am trying to reference a member within the struct that is a `uchar[3] so I wrapped it in a cv::Ptr. When I compile my program without and getters or setters on the addParam method

obj.info()->addParam<uchar[3]>(obj, "arrPtr",  *arrPtr, false);

the code compiles fine but I get a runtime error when I try to write an MyAlgorithm object to file because it can't get the data. It is looking for a member variable with the arr name but it doesn't exist. So I defined some getter and setter methods for the arr parameter within the m_model class member.

However, I am not sure how to pass the member function pointers into the addParams method. I know that I can't just pass them into the addParams method like a function like I am currently doing in the code below. I have also tried the following:

obj.info()->addParam<uchar[3]>(obj, "arr",  *arrPtr, false, &MyAlgorithm::getArr, &MyAlgorithm::setArr);

but I get a compile error:

cannot convert parameter 5 from 'cv::Ptr<_Tp> (__thiscall MyAlgorithm::* )(void)' to 'cv::Ptr<_Tp> (__thiscall cv::Algorithm::* )(void)'

Below is a stripped down sample of my source code. Any help would be greatly appreciated.

my_algorithm.h

class MyAlgorithm : public cv::Algorithm    {
public:
    //Other class logic
    cv::Ptr<uchar[3]> getArr();
    void setArr(const cv::Ptr<uchar[3]> &arrPtr);

    virtual cv::AlgorithmInfo* info() const;
protected:
    //define members such as m_model
};
cv::Algorithm* createMyAlgorithm();
cv::AlgorithmInfo& MyAlgorithm_info();

my_algorithm.cpp

cv::Algorithm* createMyAlgorithm()
{
   return new MyAlgorithm();
}

cv::AlgorithmInfo& MyAlgorithm_info() 
{
   static cv::AlgorithmInfo MyAlgorithm_info_var("MyAlgorithm", createMyAlgorithm);
   return MyAlgorithm_info_var;
}

cv::AlgorithmInfo* MyAlgorithm::info() const
{
   static volatile bool initialized = false;

   if( !initialized ) 
   { 
      initialized = true;
      MyAlgorithm obj; 
      cv::Ptr<uchar[3]> *arrPtr = new cv::Ptr<uchar[3]>(&(obj.m_model->arr));
      obj.info()->addParam<uchar[3]>(obj, "arr",  *arrPtr, false, &getArr, &setArr);
   } 
   return &MyAlgorithm_info();
}

cv::Ptr<uchar[3]> MyAlgorithm::getArr(){
   //Logic to get arr
}
void MyAlgorithm::setModMin(const cv::Ptr<uchar[3]> &arrPtr){
   //Logic to set arr
}
2012-10-02 05:55:59 -0600 edited question Can't checkout from SVN repository, version 2.4.2

I'm trying to access the SVN repository as stated in the documentation: http://code.opencv.org/svn/opencv/tags/2.4.2 However, I got error when I tried to access it in the browser, and also through the SVN command line.

Should I access the repository somewhere else? This is strange because the official site says that this should work.

2012-10-02 05:48:18 -0600 edited question build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04

Following the tutorial at: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_binary_package.html

*edit* new tutorial is OpenCV 2.4.2 for Android and the updated tutorial in answer below. As per recommendation, a summary of the problems*

Summary of problems building android_binary_package with Eclipse on Ubuntu

  1. Errors following the steps for JDK installation
  2. Errors attempting to build from commandline with Ant and build.xml.
  3. project.properties errors for all sample projects. There is a script in /samples/android/fix_properties.sh . It seems it is missing a #!/bin/bash and, for me, errors of Command not found android: occur. I needed to give a full path to the android executable in adnroid-sdk-linux/tools/ . I just discovered the script, it's not mentioned in the tutorial.
  4. Not sure how to link OpenCV-2.4.0 Library into Eclipse. Which folder should i reference? One containing .jar or AndroidManifest.xml?

[my comments in []s ]

1 Sun JDK 6 [First of all, I'm surprised if only the Sun JDK works that it isn't mentioned in https://developer.android.com/tools/sdk/eclipse-adt.html]

Dependencies: Java 1.6 or higher is required for ADT 20.0.0.

[In fact, i have been using Eclipse Indigo to develop android for a few projects and output from errors in the console say I'm running ]

java.version=1.6.0_24 java.vendor=Sun Microsystems Inc.

but in a terminal shell $ java -version gives

java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

[Following the instructions, i run into problems.]

Visit http://www.oracle.com/technetwork/java/javase/downloads/index.html and download installer for your OS.

[requires a long login, must sudo chmod +x the downloaded file, i get errors when i run the file of dependencies not found like /bin/sh but of course they are there. Exits with Done, but i don't know if it was successful or where it unpacked the files to. No easy checkpoint. Command-line output follows]

rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
many errors ending with...
error: Failed dependencies:
    /bin/sh is needed by sun-javadb-core-10.6.2-1.1.i386
Done.

[Continuing on with the tutorial]

Here is a detailed installation guide for Ubuntu and Mac OS: http://source.android.com/source/initializing.html#installing-the-jdk (only JDK sections are applicable for OpenCV)

[following their instructions I get problems]

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'sun-java6-jdk' has no installation candidate

Note OpenJDK is not usable for Android development because Android SDK supports only Sun JDK. If you use Ubuntu, after installation of Sun JDK you should ... (more)

2012-10-02 05:46:47 -0600 edited question ndk-build deletes native OpenCV library

I tried to create a own OpenCV-2.4.2 android project using Eclipse and OpenCV on Linux. I followed the steps from the tutorials (Tutorial on using native code and static libraries and Tutorial on creating an own OpenCV application) to use static library initialization instead the dynamic approach. Also I am using a small native C++ part wich calls OpenCVs FeatureDetector() method (similar to samples/tutorial-4-mixed).

So when I try to copy the native lib libopencv_java.so into /libs/armeabi-v7a (according to step 3), build and run the application on my device it will throw an ExceptionInitializerError: couldn't load library 'opencv_java'.

The app can't load the file because ndk-build deletes it on creation of the app. My own native code part is built and placed correctly in /libs/armeabi-v7a but opencv_java.so is gone What am I missing?

2012-10-02 05:43:38 -0600 edited answer Stitcher module errors

Hi,

You should use the method stitch instead. The method composePanorama composes images under assumption that motions between the images were estimated earlier using the method estimateTransform. See the stitching module docs.

Alexey

2012-10-02 05:35:38 -0600 edited answer Percentage of color in a frame of video

If you want to use histogram, you will need to get a histogram of monochrome frame by converting the image to grayscale. Or you can convert the image to HSV and compute the histogram of V component.

A tutorial on histograms is available in the documentation at http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.html?highlight=histogram

2012-10-02 05:34:37 -0600 edited question findHomography gives an error libstdc++-6.dll entry point missing

Good day

When using the function findHomography( obj, scene, CV_RANSAC ) the following error occur:

"The procedure entry point __ZNSt8__detail15_List_node_base11_M_transferEPS0_S1_ could not be located in the dynamic link library libstdc++-6.dll."

I am running Windows7, MinGW, Codeblocks and Opencv2.4 and using the code: http://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html

Except for the include which I use:

#include "stdio.h"
#include "iostream"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/legacy/legacy.hpp"

if I use the include in the code the SurfFeatureDetector becomes undeclared with various other functions.

Regards.

2012-10-02 05:32:59 -0600 edited question 'SurfFeatureDescriptor' giving linker errors

Hi I am new to openCV and am trying to do some object detection in 2 images . I am trying out the sample code in this link for object detection. http://docs.opencv.org/trunk/doc/tutorials/features2d/feature_homography/feature_homography.html#explanation I have also included the "nonfree" module as per the change in 2.4 so I am not getting compiler error but am getting errors while running the code.Please suggest what might be wrong. This is the error and the code is below the error Error-

  "cv::DescriptorMatcher::match(cv::Mat const&, cv::Mat const&, __gnu_debug_def::vector<cv::DMatch, std::allocator<cv::DMatch> >&, cv::Mat const&) const", referenced from:

  "cv::FeatureDetector::detect(cv::Mat const&, __gnu_debug_def::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat const&) const", referenced from:
_main in main.o
  "cv::drawMatches(cv::Mat const&, __gnu_debug_def::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, cv::Mat const&, __gnu_debug_def::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, __gnu_debug_def::vector<cv::DMatch, std::allocator<cv::DMatch> > const&, cv::Mat&, cv::Scalar_<double> const&, cv::Scalar_<double> const&, __gnu_debug_def::vector<char, std::allocator<char> > const&, int)", referenced from:

  "cv::DescriptorExtractor::compute(cv::Mat const&, __gnu_debug_def::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat&) const", referenced from:

symbols not found

Here is the code

/**
 * @file SURF_Homography
 * @brief SURF detector + descriptor + FLANN Matcher + FindHomography
 * @author A. Huaman
 */

#include <stdio.h>
#include <iostream>
#include <vector>
#include <opencv2/core/core.hpp>

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include <opencv2/features2d/features2d.hpp>
using namespace cv;
void readme();

/**
 * @function main
 * @brief Main function
 */
int main( int argc, char** argv )
{
    if( argc != 3 )
    { readme(); return -1; }

    cv::Mat img_object = cv::imread( "/user/gaurav_kl/Desktop/sample/p1.tif", CV_LOAD_IMAGE_GRAYSCALE );
    cv::Mat img_scene = cv::imread( "/user/gaurav_kl/Desktop/sample/p2.tif", CV_LOAD_IMAGE_GRAYSCALE );

    if( !img_object.data || !img_scene.data )
    { std::cout<< " --(!) Error reading images " << std::endl; return -1; }

    //-- Step 1: Detect the keypoints using SURF Detector
    int minHessian = 400;

    SurfFeatureDetector detector(minHessian);

    std::vector<KeyPoint> keypoints_object, keypoints_scene;

    detector.detect( img_object, keypoints_object );
    detector.detect( img_scene, keypoints_scene );

    //-- Step 2: Calculate descriptors (feature vectors)
    SurfDescriptorExtractor extractor;

    Mat descriptors_object, descriptors_scene;

    extractor.compute( img_object, keypoints_object, descriptors_object );
    extractor.compute( img_scene, keypoints_scene, descriptors_scene );

    //-- Step 3: Matching descriptor vectors using FLANN matcher
    FlannBasedMatcher matcher;
    std::vector< DMatch > matches;
    matcher.match( descriptors_object, descriptors_scene, matches );

    double max_dist = 0; double min_dist = 100;

    //-- Quick calculation of max and min distances between keypoints
    for( int i = 0; i < descriptors_object.rows; i++ )
    { double dist = matches[i].distance;
        if( dist < min_dist ) min_dist = dist;
        if( dist > max_dist ) max_dist = dist;
    }

    printf("-- Max dist : %f \n", max_dist );
    printf("-- Min dist : %f \n", min_dist );

    //-- Draw only "good" matches (i.e. whose distance is less than 3*min_dist )
    std::vector< DMatch > good_matches;

    for( int i = 0; i < descriptors_object.rows; i++ )
    { if( matches[i].distance < 3*min_dist )
    { good_matches.push_back( matches[i]); }
    }  

    Mat img_matches;
    drawMatches( img_object, keypoints_object, img_scene, keypoints_scene, 
                good_matches, img_matches, Scalar::all(-1), Scalar::all(-1), 
                vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS ); 


    //-- Localize the object from img_1 in img_2 
    std ...
(more)
2012-10-02 05:30:52 -0600 edited question svn authentification failed

I am trying to install opencv and I followed the steps mentioned here http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html when trying to download opencv sources from https://code.ros.org/svn/opencv/trunk get the following error Unable to connect to a repository at URL 'https://code.ros.org/svn/opencv/trunk' OPTIONS of 'https://code.ros.org/svn/opencv/trunk': authorization failed: Could not authenticate to server: rejected Basic challenge (https://code.ros.org)

thank you for any help

2012-10-02 05:19:54 -0600 edited answer HOG latent SVM obj detection doesn't seem to work

Hello, I'll try to answer some of your questions.

  1. Nobody says that algorithm provides exact detection outcome. If you open Felzenschwalb's article you see that average precision for object class 'person' equals 0,342. Evidently it's not so good as you waiting for. Concerning too many false positives you can decrease number of false positives decreasing detection threshold in function cvLatentSvmDetectObjects (by default thershold equals 0.5).
  2. Have you tried to execute Felzenshwalb's implementation? If you haven't done I'm ready to do that and compare results to satisfy results similarity or to find out a bag. Please, choose image from VOC2007.
  3. Execution time depends on many conditions, first of all: what version you use (sequential or parallel), how many threads you create during execution if you have multi-core processor, size of test image.

Note that Felzenschwalb's implementation is a multi-threading implementation. Besides authors don't tell about infrastructure in their paper. That's why it's not quite correct to compare execution time of those implementations. OpenCV implementation in 4 threads works about 4 seconds in average (on VOC2007 data, where image size is about 640x480, OS - Microsoft Windows Server 2008 Standard SP1 x64, RAM - 4Gb, Processor - 2 processors Intel Xeon 5150 (2.66 GHz)).

Latent SVM documentation you can find here. More over there are two samples (latentsvm_multidetect, latentsvmdetect) and comments to source code in accordance to the notation of the paper.

2012-10-02 05:17:37 -0600 edited answer How to draw irregular outline of MSER region?

If I understand correctly, you do not want to draw the nested contours. In this case the line where you draw the contours should be changed to,

drawContours(box,regions,i,Scalar(0,255,255),1,8, vector<Vec4i>(), 0, Point());//this was used to draw irregular  outlines of MSER regions

Refer to drawContours for more information.

2012-10-02 05:16:24 -0600 edited answer OpenCV Stitching module for iOS

Hi,

You can find the stitching module documentation here. There are two samples in OpenCV dedicated to the stitching module: opencv/samples/cpp/stitching.cpp and opencv/samples/cpp/stitching_detailed.cpp.

Alexey

2012-10-02 05:15:04 -0600 edited answer Error: msvcr90d.dll can not be find

Hi, Your error seems to be windows dll related but it can also come from some library install problems, is your dll corrupted ?
Also, when dealing with video processing, you need a video file decoder. FFMPEG is required. Then, check your installation/configuration. If you recompile from sources, check if FFMPEG is found when configuring with the cmake tool.
Have a look at install guide for more details.

Hope it helps.

2012-10-02 05:14:08 -0600 edited question tbb_debug.dll missing, but it's there...

I used to work with OpenCV 1.4 under Visual Studio, now I'm learning how to use OpenCv 2.4. I noticed it is waaaayyy more complicated to configure.

I'm using VS2010 over Win7 x64.

I configured all the project settings following this tutorial which is by the way, the only one that partially worked.

So I had the tbb_debug.dll missing error. The problem is that it is already there. Why does my project cannot see the DLL? The only way I manage to make my project work was by copying tbb_debug.dll under the x64\vc10\bin folder.

What should I do to make my project look inside the common folder?

Thanks

2012-10-02 05:11:42 -0600 edited question Can't run OpenCV4Android samples in emulator

Hi, I'm trying simply to use opencv jni functionality for android. I've followed this: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_binary_package.html (Windows vista)

Installed:

  1. opencv 2.4.2 for android.(changed 2.4.2lib from API 9 to 11)
  2. eclipse hellio with ADT and CDT.
  3. NDK (last version)
  4. SDK platform (API 11)
  5. emulator with camera for API 11
  6. All opencv projects are at API 11.

Works:

  1. NDK examples ,compiled and run.

problems with opencv samples:

Compilation just fine, but no sample succeed run on emulator. I load the sample and asked to install the manager it fails(noo connection to google play) and I'm installing it by 'android' command line from cmd(arm7 too) but still after openning the applicaion still don't recognize the manager!

any idea?

2012-10-02 05:10:14 -0600 edited question Static initialization of OpenCV on Android

Hello people,

i have a problem with openCV on Android. I need to use static initialization, i followed this tutorial

http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_binary_package.html#application-development-with-static-initialization

I have linked the correct library to my project, but when I run the application, I get a black screen

This is the code of the MainActivity

package org.opencv.samples.tutorial2;

import org.opencv.android.OpenCVLoader;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;

public class Sample2NativeCamera extends Activity {
    static {
        if (!OpenCVLoader.initDebug())
            Log.d("ERROR", "Unable to load OpenCV");
        else
            Log.d("SUCCESS", "OpenCV loaded");
    }
    private static final String TAG = "Sample::Activity";

    public static final int VIEW_MODE_RGBA = 0;
    public static final int VIEW_MODE_GRAY = 1;
    public static final int VIEW_MODE_CANNY = 2;

    private MenuItem mItemPreviewRGBA;
    private MenuItem mItemPreviewGray;
    private MenuItem mItemPreviewCanny;

    public static int viewMode = VIEW_MODE_RGBA;

    private Sample2View mView;

    public Sample2NativeCamera() {
        Log.i(TAG, "Instantiated new " + this.getClass());
    }

    @Override
    protected void onPause() {
        Log.i(TAG, "onPause");
        super.onPause();
        if (null != mView)
            mView.releaseCamera();
    }

    @Override
    protected void onResume() {
        Log.i(TAG, "onResume");
        super.onResume();
        if ((null != mView) && !mView.openCamera()) {
            AlertDialog ad = new AlertDialog.Builder(this).create();
            ad.setCancelable(false); // This blocks the 'BACK' button
            ad.setMessage("Fatal error: can't open camera!");
            ad.setButton("OK", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                    finish();
                }
            });
            ad.show();
        }
    }

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        Log.i(TAG, "onCreate");
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        Log.i(TAG, "onCreateOptionsMenu");
        mItemPreviewRGBA = menu.add("Preview RGBA");
        mItemPreviewGray = menu.add("Preview GRAY");
        mItemPreviewCanny = menu.add("Canny");
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        Log.i(TAG, "Menu Item selected " + item);
        if (item == mItemPreviewRGBA)
            viewMode = VIEW_MODE_RGBA;
        else if (item == mItemPreviewGray)
            viewMode = VIEW_MODE_GRAY;
        else if (item == mItemPreviewCanny)
            viewMode = VIEW_MODE_CANNY;
        return true;
    }
}

2012-10-02 05:10:14 -0600 received badge  Editor (source)
2012-09-03 01:28:15 -0600 commented question 0xc000007b error when trying the sample programs.
2012-07-31 15:50:00 -0600 commented answer Can't checkout from SVN repository, version 2.4.2

willowgarage and http://opencv.itseez.com (update: closed) will be closed soon. opencv.org will be maintained on a regular basis, but the developer's wiki at code.opencv.org will be updated by occasion. You can help us here: http://opencv.org/contribute.html :)

2012-07-31 01:16:11 -0600 commented answer Can't checkout from SVN repository, version 2.4.2

Thanks for the info. It wasn't clear from the site. I suspect something like that. Maybe, all the site should be checked, as new people coming to the wiki may get confused.

2012-07-23 04:08:38 -0600 commented answer How can I debug into function like "cvCreateTreeCascadeClassifier "?

@Maria: Yes! For example In my opinio you should mention it here: http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html