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
ca2a2abe
Commit
ca2a2abe
authored
Jul 21, 2017
by
sghoshcvc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed white space errors and platform specific warnings
parent
a617059f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
26 deletions
+23
-26
CMakeLists.txt
modules/text/CMakeLists.txt
+0
-1
FindTesseract.cmake
modules/text/FindTesseract.cmake
+0
-2
README.md
modules/text/README.md
+0
-0
ocr.hpp
modules/text/include/opencv2/text/ocr.hpp
+14
-18
deeptextdetection.py
modules/text/samples/deeptextdetection.py
+0
-1
textbox_demo.cpp
modules/text/samples/textbox_demo.cpp
+2
-2
text_detectorCNN.cpp
modules/text/src/text_detectorCNN.cpp
+7
-2
No files found.
modules/text/CMakeLists.txt
View file @
ca2a2abe
...
...
@@ -67,4 +67,3 @@ if()
else
()
message
(
STATUS
"TEXT CAFFE CONFLICT"
)
endif
()
modules/text/FindTesseract.cmake
View file @
ca2a2abe
...
...
@@ -20,5 +20,3 @@ set(Tesseract_LIBS ${Tesseract_LIBRARY} ${Lept_LIBRARY})
if
(
Tesseract_LIBS AND Tesseract_INCLUDE_DIR
)
set
(
Tesseract_FOUND 1
)
endif
()
modules/text/README.md
View file @
ca2a2abe
modules/text/include/opencv2/text/ocr.hpp
View file @
ca2a2abe
...
...
@@ -277,8 +277,7 @@ class CV_EXPORTS_W OCRHMMDecoder : public BaseOCR {
* for the individual text elements found (e.g. words).
* @param component_texts If provided the method will output a list of text
* strings for the recognition of individual text elements found (e.g. words)
* .
* strings for the recognition of individual text elements found (e.g. words).
* @param component_confidences If provided the method will output a list of
* confidence values for the recognition of individual text elements found
...
...
@@ -314,8 +313,7 @@ class CV_EXPORTS_W OCRHMMDecoder : public BaseOCR {
* for the individual text elements found (e.g. words).
* @param component_texts If provided the method will output a list of text
* strings for the recognition of individual text elements found (e.g. words)
* .
* strings for the recognition of individual text elements found (e.g. words).
* @param component_confidences If provided the method will output a list of
* confidence values for the recognition of individual text elements found
...
...
@@ -596,34 +594,32 @@ public:
int
mode
=
OCR_DECODER_VITERBI
,
// HMM Decoding algorithm (only Viterbi for the moment)
int
beam_size
=
500
);
// Size of the beam in Beam Search algorithm
/** @brief This method allows to plug a classifier that is derivative of TextImageClassifier in to
* OCRBeamSearchDecoder as a ClassifierCallback.
@param classifier A pointer to a TextImageClassifier decendent
@param alphabet The language alphabet one char per symbol. alphabet.size() must be equal to the number of classes
of the classifier. In future editinons it should be replaced with a vector of strings.
/** @brief Creates an instance of the OCRBeamSearchDecoder class. Initializes HMMDecoder from the specified path.
@overload
@param filename path to a character classifier file
@param vocabulary The language vocabulary (chars when ASCII English text). vocabulary.size()
must be equal to the number of classes of the classifier..
@param transition_probabilities_table Table with transition probabilities between character
pairs. cols == rows ==
alphabet
.size().
pairs. cols == rows ==
vocabulary
.size().
@param emission_probabilities_table Table with observation emission probabilities. cols ==
rows ==
alphabet
.size().
rows ==
vocabulary
.size().
@param windowWidth The width of the windows to which the sliding window will be iterated. The height will
be the height of the image. The windows might be resized to fit the classifiers input by the classifiers
preprocessor.
@param windowStep The step for the sliding window
@param mode HMM Decoding algorithm (only Viterbi for the moment)
@param beam_size Size of the beam in Beam Search algorithm
*/
/** @brief Creates an instance of the OCRBeamSearchDecoder class. Initializes HMMDecoder from the specified path.
@overload
*/
CV_WRAP
static
Ptr
<
OCRBeamSearchDecoder
>
create
(
const
String
&
filename
,
// The character classifier file
...
...
modules/text/samples/deeptextdetection.py
View file @
ca2a2abe
...
...
@@ -29,7 +29,6 @@ if (len(sys.argv) < 2):
if
not
os
.
path
.
isfile
(
'textbox.caffemodel'
)
or
not
os
.
path
.
isfile
(
'textbox_deploy.prototxt'
):
print
" Model files not found in current directory. Aborting"
print
" Model files should be downloaded from https://github.com/sghoshcvc/TextBox-Models"
quit
()
cv2
.
text
.
cnn_config
.
caffe_backend
.
setCaffeGpuMode
(
True
);
...
...
modules/text/samples/textbox_demo.cpp
View file @
ca2a2abe
...
...
@@ -61,7 +61,7 @@ int main(int argc, const char * argv[]){
exit
(
1
);
}
//set to true if you have a GPU with more than 3GB
cv
::
text
::
cnn_config
::
caffe_backend
::
setCaffeGpuMode
(
fals
e
);
cv
::
text
::
cnn_config
::
caffe_backend
::
setCaffeGpuMode
(
tru
e
);
if
(
argc
<
3
){
std
::
cout
<<
getHelpStr
(
argv
[
0
]);
...
...
@@ -100,7 +100,7 @@ int main(int argc, const char * argv[]){
std
::
vector
<
float
>
outProbabillities
;
textSpotter
->
textDetectInImage
(
image
,
bbox
,
outProbabillities
);
// textbox_draw(image, bbox,outProbabillities);
float
thres
=
0.6
;
float
thres
=
0.6
f
;
std
::
vector
<
cv
::
Mat
>
imageList
;
for
(
int
imageIdx
=
0
;
imageIdx
<
(
int
)
bbox
.
size
();
imageIdx
++
){
if
(
outProbabillities
[
imageIdx
]
>
thres
){
...
...
modules/text/src/text_detectorCNN.cpp
View file @
ca2a2abe
...
...
@@ -19,6 +19,9 @@
#ifdef HAVE_CAFFE
#include "caffe/caffe.hpp"
#endif
#define CV_WARN(message) fprintf(stderr, "warning: %s (%s:%d)\n", message, __FILE__, __LINE__)
namespace
cv
{
namespace
text
{
inline
bool
fileExists
(
String
filename
)
{
...
...
@@ -33,6 +36,9 @@ protected:
void
process_
(
Mat
inputImage
,
Mat
&
outputMat
)
{
// do forward pass and stores the output in outputMat
CV_Assert
(
outputMat
.
isContinuous
());
if
(
inputImage
.
channels
()
!=
this
->
inputChannelCount_
)
CV_WARN
(
"Number of input channel(s) in the model is not same as input"
);
#ifdef HAVE_CAFFE
...
...
@@ -204,7 +210,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String
if
(
preprocessor
.
empty
())
{
// create a custom preprocessor with rawval
Ptr
<
ImagePreprocessor
>
preprocessor
=
ImagePreprocessor
::
createImageCustomPreprocessor
(
255
);
preprocessor
=
ImagePreprocessor
::
createImageCustomPreprocessor
(
255
);
// set the mean for the preprocessor
Mat
textbox_mean
(
1
,
3
,
CV_8U
);
...
...
@@ -264,4 +270,3 @@ void DeepCNNTextDetector::preprocess(const Mat& input,Mat& output)
}
}
//namespace text namespace cv
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