Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
efc864c5
Commit
efc864c5
authored
Sep 15, 2017
by
Suman Ghosh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed hard coding height and width
parent
af536b13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
CMakeLists.txt
modules/text/CMakeLists.txt
+4
-2
ocr_holistic.cpp
modules/text/src/ocr_holistic.cpp
+7
-7
No files found.
modules/text/CMakeLists.txt
View file @
efc864c5
...
...
@@ -59,8 +59,10 @@ if(HAVE_CAFFE AND HAVE_GLOG AND HAVE_PROTOBUF)
list
(
APPEND Caffe_LINKER_LIBS
${
HDF5_LIBRARIES
}
)
find_package
(
Boost 1.46 REQUIRED COMPONENTS system thread filesystem
)
include_directories
(
SYSTEM
${
Boost_INCLUDE_DIR
}
)
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/
)
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
)
include_directories
(
SYSTEM
${
CUDA_INCLUDE_DIR
}
)
link_directories
(
SYSTEM
${
CUDA_LIBS
}
)
# 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/ )
#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)
list
(
APPEND Caffe_LINKER_LIBS
${
Boost_LIBRARIES
}
)
target_link_libraries
(
opencv_text atlas blas
${
Caffe_LIBS
}
${
Glog_LIBS
}
${
Protobuf_LIBS
}
${
HDF5_LIBRARIES
}
${
Boost_LIBRARIES
}
)
add_definitions
(
-DHAVE_CAFFE
)
...
...
modules/text/src/ocr_holistic.cpp
View file @
efc864c5
...
...
@@ -271,9 +271,9 @@ protected:
//Size outputGeometry_;//= Size(1,1);
//int channelCount_;
// int inputChannel_ ;//=1;
const
int
_inputHeight
=
32
;
const
int
_inputWidth
=
100
;
const
int
_inputChannel
=
1
;
//
const int _inputHeight =32;
//
const int _inputWidth =100;
//
const int _inputChannel =1;
public
:
DeepCNNOpenCvDNNImpl
(
const
DeepCNNOpenCvDNNImpl
&
dn
)
:
minibatchSz_
(
dn
.
minibatchSz_
),
outputSize_
(
dn
.
outputSize_
){
...
...
@@ -300,8 +300,8 @@ public:
//Implemented to supress Visual Studio warning "assignment operator could not be generated"
}
DeepCNNOpenCvDNNImpl
(
String
modelArchFilename
,
String
modelWeightsFilename
,
Ptr
<
ImagePreprocessor
>
preprocessor
,
int
maxMinibatchSz
)
:
minibatchSz_
(
maxMinibatchSz
)
DeepCNNOpenCvDNNImpl
(
String
modelArchFilename
,
String
modelWeightsFilename
,
Ptr
<
ImagePreprocessor
>
preprocessor
,
int
maxMinibatchSz
,
int
inputWidth
=
100
,
int
inputHeight
=
32
)
:
minibatchSz_
(
maxMinibatchSz
)
,
_inputWidth
(
inputWidth
),
_inputHeight
(
inputHeight
)
{
CV_Assert
(
this
->
minibatchSz_
>
0
);
...
...
@@ -612,13 +612,13 @@ public:
this
->
classifier_
->
classifyBatch
(
inputImageList
,
netOutput
);
for
(
int
k
=
0
;
k
<
netOutput
.
rows
;
k
++
)
{
{
https
:
//www.google.es/?gfe_rd=cr&dcr=0&ei=4fq7We8Bk9jyB8zPp5AL
int
classNum
;
double
confidence
;
NetOutput
::
getClassification
((
float
*
)(
netOutput
.
row
(
k
).
data
),
this
->
classifier_
->
getOutputSize
(),
classNum
,
confidence
);
transcriptionVec
.
push_back
(
this
->
labels_
[
classNum
]);
confidenceVec
.
push_back
(
confidence
);
}
}
https
:
//www.google.es/?gfe_rd=cr&dcr=0&ei=4fq7We8Bk9jyB8zPp5AL
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment