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
551d1e68
Commit
551d1e68
authored
Jul 06, 2016
by
Anguelos Nicolaou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GSOC 2016
Implemented Classifier and Wordspotter as two independent classes
parent
44d7339f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
13 deletions
+7
-13
CMakeLists.txt
modules/text/CMakeLists.txt
+1
-1
ocr_holistic.cpp
modules/text/src/ocr_holistic.cpp
+6
-12
No files found.
modules/text/CMakeLists.txt
View file @
551d1e68
...
@@ -24,7 +24,7 @@ if(${Tesseract_FOUND})
...
@@ -24,7 +24,7 @@ if(${Tesseract_FOUND})
target_link_libraries
(
opencv_text
${
Tesseract_LIBS
}
)
target_link_libraries
(
opencv_text
${
Tesseract_LIBS
}
)
endif
()
endif
()
#
anguelos:
Principal source from which adaptation came is the cnn_3dobj module
#Principal source from which adaptation came is the cnn_3dobj module
find_package
(
Caffe
)
find_package
(
Caffe
)
if
(
Caffe_FOUND
)
if
(
Caffe_FOUND
)
...
...
modules/text/src/ocr_holistic.cpp
View file @
551d1e68
...
@@ -15,13 +15,7 @@
...
@@ -15,13 +15,7 @@
#include <utility>
#include <utility>
#include <vector>
#include <vector>
//Lluis:DONT KNOW WHY ITS NOT VISIBLE HERE
//should this be moved elsewhere?
#define CV_StsNotImplemented (-213)
#define CV_StsError (-2)
//Luis: should this be moved elsewhere?
//In precomp.hpp It doesn't work
//In precomp.hpp It doesn't work
#ifdef HAVE_CAFFE
#ifdef HAVE_CAFFE
#include "caffe/caffe.hpp"
#include "caffe/caffe.hpp"
...
@@ -30,7 +24,7 @@
...
@@ -30,7 +24,7 @@
namespace
cv
{
namespace
text
{
namespace
cv
{
namespace
text
{
//
Lluis:
Maybe OpenCV has a routine better suited
//Maybe OpenCV has a routine better suited
inline
bool
fileExists
(
String
filename
)
{
inline
bool
fileExists
(
String
filename
)
{
std
::
ifstream
f
(
filename
.
c_str
());
std
::
ifstream
f
(
filename
.
c_str
());
return
f
.
good
();
return
f
.
good
();
...
@@ -55,7 +49,7 @@ protected:
...
@@ -55,7 +49,7 @@ protected:
input
.
convertTo
(
output
,
CV_32FC1
);
input
.
convertTo
(
output
,
CV_32FC1
);
}
}
}
else
{
}
else
{
CV_Error
(
CV_
StsError
,
"Expecting images with either 1 or 3 channels"
);
CV_Error
(
Error
::
StsError
,
"Expecting images with either 1 or 3 channels"
);
}
}
resize
(
output
,
output
,
this
->
inputGeometry_
);
resize
(
output
,
output
,
this
->
inputGeometry_
);
Scalar
dev
,
mean
;
Scalar
dev
,
mean
;
...
@@ -120,7 +114,7 @@ public:
...
@@ -120,7 +114,7 @@ public:
this
->
outputSize_
=
net_
->
output_blobs
()[
0
]
->
channels
();
this
->
outputSize_
=
net_
->
output_blobs
()[
0
]
->
channels
();
#else
#else
CV_Error
(
CV_
StsError
,
"Caffe not available during compilation!"
);
CV_Error
(
Error
::
StsError
,
"Caffe not available during compilation!"
);
#endif
#endif
}
}
...
@@ -166,7 +160,7 @@ Ptr<DictNet> DictNet::create(String archFilename,String weightsFilename,int mini
...
@@ -166,7 +160,7 @@ Ptr<DictNet> DictNet::create(String archFilename,String weightsFilename,int mini
break
;
break
;
case
OCR_HOLISTIC_BACKEND_NONE
:
case
OCR_HOLISTIC_BACKEND_NONE
:
default
:
default
:
CV_Error
(
CV_
StsError
,
"DictNet::create backend not implemented"
);
CV_Error
(
Error
::
StsError
,
"DictNet::create backend not implemented"
);
return
Ptr
<
DictNet
>
();
return
Ptr
<
DictNet
>
();
break
;
break
;
}
}
...
@@ -208,7 +202,7 @@ public:
...
@@ -208,7 +202,7 @@ public:
CV_Assert
(
fileExists
(
vocabullaryFilename
));
//this fails for some rason
CV_Assert
(
fileExists
(
vocabullaryFilename
));
//this fails for some rason
std
::
ifstream
labelsFile
(
vocabullaryFilename
.
c_str
());
std
::
ifstream
labelsFile
(
vocabullaryFilename
.
c_str
());
if
(
!
labelsFile
){
if
(
!
labelsFile
){
CV_Error
(
CV_
StsError
,
"Could not read Labels from file"
);
CV_Error
(
Error
::
StsError
,
"Could not read Labels from file"
);
}
}
std
::
string
line
;
std
::
string
line
;
while
(
std
::
getline
(
labelsFile
,
line
)){
while
(
std
::
getline
(
labelsFile
,
line
)){
...
...
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