Got Error Use of undeclared identifier 'ERStat' in XCode.

asked 2014-02-17 03:39:52 -0600

Cat gravatar image

updated 2014-02-17 03:57:33 -0600

berak gravatar image

I'm trying to run textdetection in Xcode. First: I added opencv2.framework 2.4.8 to project. And added file textdetection.mm to my project.

https://github.com/Itseez/opencv/blob/685eceb68ade4b579cdce7cb41e9888e274a7093/samples/cpp/textdetection.cpp

After a few editting, my header changed to this:

#import "ImageProcessor.h"
#include  "opencv2/opencv.hpp"
#include  <opencv2/objdetect/objdetect.hpp>
#include  <opencv2/highgui/highgui.hpp>
#include  <opencv2/imgproc/imgproc.hpp>
#include  <vector>
#include  <iostream>
#include  <iomanip>

using  namespace std;
using  namespace cv;

void show_help_and_exit(const char *cmd);
void groups_draw(cv::Mat &src, vector<cv::Rect> &groups);
void er_show(vector<cv::Mat> &channels, vector<vector<ERStat> > &regions);

But I got error:

/*/textdetection.mm:50:19: Use of undeclared identifier 'ERStat'

/*/textdetection.mm:39:5: Use of undeclared identifier 'computeNMChannels'

/*/textdetection.mm:47:9: Unknown type name 'ERFilter'; did you mean 'CIFilter'?

/*/textdetection.mm:47:50: Use of undeclared identifier 'loadClassifierNM1'

/*/textdetection.mm:48:50: Use of undeclared identifier 'loadClassifierNM2'

I've tried to change ERStat to cv::ERStat, but it still got error. Could you show me what am I missing? Thank you.

edit retag flag offensive close merge delete

Comments

that sample is from the 3.0(master) branch, you're on 2.4.8. i don't think you can use it.

berak gravatar imageberak ( 2014-02-17 04:09:22 -0600 )edit

@berak: I got it. Thank you. Do you know if there is a way to add all temporary OpenCV source to Project? I've asked in stackoverflow but I'm still stuck with this: http://stackoverflow.com/questions/21846773/how-to-add-opencv-source-not-stable-built-framework-to-xcode-project

Cat gravatar imageCat ( 2014-02-18 03:14:21 -0600 )edit

bear with me for not knowing anything about apple, but the only way to get 3.0 is , get the src from github, run cmake, build it.

and afaik, the 2.4 and the 3.0 branch are not binary compatible, so 'cherry-picking' some features from 3.0 into your 2.4 version will not work.

berak gravatar imageberak ( 2014-02-18 08:12:49 -0600 )edit

I tried to compile this sample, but the same ERFilter include problem persists under Ubuntu. The installed 3.0 branch does not seem to contain this header file (although in the downloaded branch the header does exist). Beside manual include, any suggestion to overcome this compilation problem would be appreciated.

fapofa gravatar imagefapofa ( 2014-03-27 09:51:50 -0600 )edit

This file seems to be missing from Github now. Was it removed from the project?

https://github.com/Itseez/opencv/tree...

liquidmetal gravatar imageliquidmetal ( 2015-12-29 13:25:37 -0600 )edit