Skip to content

Commit 551d1e6

Browse files
committed
GSOC 2016
Implemented Classifier and Wordspotter as two independent classes
1 parent 44d7339 commit 551d1e6

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

modules/text/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if(${Tesseract_FOUND})
2424
target_link_libraries(opencv_text ${Tesseract_LIBS})
2525
endif()
2626

27-
#anguelos: Principal source from which adaptation came is the cnn_3dobj module
27+
#Principal source from which adaptation came is the cnn_3dobj module
2828
find_package(Caffe)
2929

3030
if(Caffe_FOUND)

modules/text/src/ocr_holistic.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515
#include <utility>
1616
#include <vector>
1717

18-
//Lluis:DONT KNOW WHY ITS NOT VISIBLE HERE
19-
#define CV_StsNotImplemented (-213)
20-
#define CV_StsError (-2)
21-
22-
23-
24-
//Luis: should this be moved elsewhere?
18+
//should this be moved elsewhere?
2519
//In precomp.hpp It doesn't work
2620
#ifdef HAVE_CAFFE
2721
#include "caffe/caffe.hpp"
@@ -30,7 +24,7 @@
3024

3125
namespace cv { namespace text {
3226

33-
//Lluis: Maybe OpenCV has a routine better suited
27+
//Maybe OpenCV has a routine better suited
3428
inline bool fileExists (String filename) {
3529
std::ifstream f(filename.c_str());
3630
return f.good();
@@ -55,7 +49,7 @@ class DictNetCaffeImpl: public DictNet{
5549
input.convertTo(output, CV_32FC1);
5650
}
5751
}else{
58-
CV_Error(CV_StsError,"Expecting images with either 1 or 3 channels");
52+
CV_Error(Error::StsError,"Expecting images with either 1 or 3 channels");
5953
}
6054
resize(output,output,this->inputGeometry_);
6155
Scalar dev,mean;
@@ -120,7 +114,7 @@ class DictNetCaffeImpl: public DictNet{
120114
this->outputSize_=net_->output_blobs()[0]->channels();
121115

122116
#else
123-
CV_Error(CV_StsError,"Caffe not available during compilation!");
117+
CV_Error(Error::StsError,"Caffe not available during compilation!");
124118
#endif
125119
}
126120

@@ -166,7 +160,7 @@ Ptr<DictNet> DictNet::create(String archFilename,String weightsFilename,int mini
166160
break;
167161
case OCR_HOLISTIC_BACKEND_NONE:
168162
default:
169-
CV_Error(CV_StsError,"DictNet::create backend not implemented");
163+
CV_Error(Error::StsError,"DictNet::create backend not implemented");
170164
return Ptr<DictNet>();
171165
break;
172166
}
@@ -208,7 +202,7 @@ class OCRHolisticWordRecognizerImpl: public OCRHolisticWordRecognizer{
208202
CV_Assert(fileExists(vocabullaryFilename));//this fails for some rason
209203
std::ifstream labelsFile(vocabullaryFilename.c_str());
210204
if(!labelsFile){
211-
CV_Error(CV_StsError,"Could not read Labels from file");
205+
CV_Error(Error::StsError,"Could not read Labels from file");
212206
}
213207
std::string line;
214208
while (std::getline(labelsFile, line)){

0 commit comments

Comments
 (0)