Skip to content

Commit efc864c

Browse files
committed
removed hard coding height and width
1 parent af536b1 commit efc864c

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

modules/text/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ if(HAVE_CAFFE AND HAVE_GLOG AND HAVE_PROTOBUF)
5959
list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES})
6060
find_package(Boost 1.46 REQUIRED COMPONENTS system thread filesystem)
6161
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
62-
include_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/include/ usr/local/cuda-8.0/include/ /usr/local/cuda-7.5/targets/x86_64-linux/include/ )
63-
link_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/lib/ usr/local/cuda-8.0/lib/ /usr/local/cuda-7.5/targets/x86_64-linux/lib/ /usr/lib/openblas-base/lib /usr/local/cuda-8.0/lib64)
62+
include_directories(SYSTEM ${CUDA_INCLUDE_DIR})
63+
link_directories(SYSTEM ${CUDA_LIBS})
64+
# include_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/include/ usr/local/cuda-8.0/include/ /usr/local/cuda-7.5/targets/x86_64-linux/include/ )
65+
#link_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/lib/ usr/local/cuda-8.0/lib/ /usr/local/cuda-7.5/targets/x86_64-linux/lib/ /usr/lib/openblas-base/lib /usr/local/cuda-8.0/lib64)
6466
list(APPEND Caffe_LINKER_LIBS ${Boost_LIBRARIES})
6567
target_link_libraries(opencv_text atlas blas ${Caffe_LIBS} ${Glog_LIBS} ${Protobuf_LIBS} ${HDF5_LIBRARIES} ${Boost_LIBRARIES})
6668
add_definitions(-DHAVE_CAFFE)

modules/text/src/ocr_holistic.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ class DeepCNNOpenCvDNNImpl: public DeepCNN{
271271
//Size outputGeometry_;//= Size(1,1);
272272
//int channelCount_;
273273
// int inputChannel_ ;//=1;
274-
const int _inputHeight =32;
275-
const int _inputWidth =100;
276-
const int _inputChannel =1;
274+
//const int _inputHeight =32;
275+
//const int _inputWidth =100;
276+
//const int _inputChannel =1;
277277
public:
278278
DeepCNNOpenCvDNNImpl(const DeepCNNOpenCvDNNImpl& dn):
279279
minibatchSz_(dn.minibatchSz_),outputSize_(dn.outputSize_){
@@ -300,8 +300,8 @@ class DeepCNNOpenCvDNNImpl: public DeepCNN{
300300
//Implemented to supress Visual Studio warning "assignment operator could not be generated"
301301
}
302302

303-
DeepCNNOpenCvDNNImpl(String modelArchFilename, String modelWeightsFilename,Ptr<ImagePreprocessor> preprocessor, int maxMinibatchSz)
304-
:minibatchSz_(maxMinibatchSz)
303+
DeepCNNOpenCvDNNImpl(String modelArchFilename, String modelWeightsFilename,Ptr<ImagePreprocessor> preprocessor, int maxMinibatchSz,int inputWidth =100,int inputHeight = 32)
304+
:minibatchSz_(maxMinibatchSz),_inputWidth(inputWidth),_inputHeight(inputHeight)
305305
{
306306

307307
CV_Assert(this->minibatchSz_>0);
@@ -612,13 +612,13 @@ class OCRHolisticWordRecognizerImpl: public OCRHolisticWordRecognizer{
612612
this->classifier_->classifyBatch(inputImageList,netOutput);
613613

614614
for(int k=0;k<netOutput.rows;k++)
615-
{
615+
{https://www.google.es/?gfe_rd=cr&dcr=0&ei=4fq7We8Bk9jyB8zPp5AL
616616
int classNum;
617617
double confidence;
618618
NetOutput::getClassification((float*)(netOutput.row(k).data),this->classifier_->getOutputSize(),classNum,confidence);
619619
transcriptionVec.push_back(this->labels_[classNum]);
620620
confidenceVec.push_back(confidence);
621-
}
621+
}https://www.google.es/?gfe_rd=cr&dcr=0&ei=4fq7We8Bk9jyB8zPp5AL
622622
}
623623

624624

0 commit comments

Comments
 (0)