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
878258bc
Commit
878258bc
authored
Sep 17, 2017
by
Suman Ghosh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified initializers
parent
887e6e5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
ocr_holistic.cpp
modules/text/src/ocr_holistic.cpp
+11
-11
text_detectorCNN.cpp
modules/text/src/text_detectorCNN.cpp
+4
-4
No files found.
modules/text/src/ocr_holistic.cpp
View file @
878258bc
...
...
@@ -271,9 +271,9 @@ protected:
//Size outputGeometry_;//= Size(1,1);
//int channelCount_;
// int inputChannel_ ;//=1;
int
_inputHeight
;
int
_inputWidth
;
int
_inputChannel
;
//
int _inputHeight;
//
int _inputWidth ;
//
int _inputChannel ;
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
,
int
inputWidth
=
100
,
int
inputHeight
=
32
,
int
inputChannel
=
1
)
:
minibatchSz_
(
maxMinibatchSz
)
,
_inputWidth
(
inputWidth
),
_inputHeight
(
inputHeight
),
_inputChannel
(
inputChannel
)
DeepCNNOpenCvDNNImpl
(
String
modelArchFilename
,
String
modelWeightsFilename
,
Ptr
<
ImagePreprocessor
>
preprocessor
,
int
maxMinibatchSz
,
int
inputWidth
,
int
inputHeight
,
int
inputChannel
)
:
minibatchSz_
(
maxMinibatchSz
)
{
CV_Assert
(
this
->
minibatchSz_
>
0
);
...
...
@@ -326,8 +326,8 @@ public:
}
this
->
inputGeometry_
=
Size
(
_inputWidth
,
_
inputHeight
);
// Size(inputLayer->width(), inputLayer->height());
this
->
channelCount_
=
_
inputChannel
;
//inputLayer->channels();
this
->
inputGeometry_
=
Size
(
inputWidth
,
inputHeight
);
// Size(inputLayer->width(), inputLayer->height());
this
->
channelCount_
=
inputChannel
;
//inputLayer->channels();
//inputLayer->Reshape(this->minibatchSz_,this->channelCount_,this->inputGeometry_.height, this->inputGeometry_.width);
Ptr
<
Layer
>
outLayer
=
net_
->
getLayer
(
net_
->
getLayerId
(
net_
->
getLayerNames
()[
net_
->
getLayerNames
().
size
()
-
2
]));
...
...
@@ -408,7 +408,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag
return
Ptr
<
DeepCNN
>
(
new
DeepCNNCaffeImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
));
#elif defined(HAVE_DNN)
return
Ptr
<
DeepCNN
>
(
new
DeepCNNOpenCvDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
));
return
Ptr
<
DeepCNN
>
(
new
DeepCNNOpenCvDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
,
100
,
32
,
1
));
#else
CV_Error
(
Error
::
StsError
,
"DeepCNN::create backend not implemented"
);
return
Ptr
<
DeepCNN
>
();
...
...
@@ -419,7 +419,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag
return
Ptr
<
DeepCNN
>
(
new
DeepCNNCaffeImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
));
break
;
case
OCR_HOLISTIC_BACKEND_DNN
:
return
Ptr
<
DeepCNN
>
(
new
DeepCNNOpenCvDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
));
return
Ptr
<
DeepCNN
>
(
new
DeepCNNOpenCvDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
,
100
,
32
,
1
));
break
;
case
OCR_HOLISTIC_BACKEND_NONE
:
default
:
...
...
@@ -440,7 +440,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i
return
Ptr
<
DeepCNN
>
(
new
DeepCNNCaffeImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
100
));
#elif defined(HAVE_DNN)
return
Ptr
<
DeepCNN
>
(
new
DeepCNNOpenCvDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
100
));
return
Ptr
<
DeepCNN
>
(
new
DeepCNNOpenCvDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
100
,
100
,
32
,
1
));
#else
CV_Error
(
Error
::
StsError
,
"DeepCNN::create backend not implemented"
);
return
Ptr
<
DeepCNN
>
();
...
...
@@ -451,7 +451,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i
return
Ptr
<
DeepCNN
>
(
new
DeepCNNCaffeImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
100
));
break
;
case
OCR_HOLISTIC_BACKEND_DNN
:
return
Ptr
<
DeepCNN
>
(
new
DeepCNNOpenCvDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
100
));
return
Ptr
<
DeepCNN
>
(
new
DeepCNNOpenCvDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
100
,
100
,
32
,
1
));
break
;
case
OCR_HOLISTIC_BACKEND_NONE
:
default
:
...
...
modules/text/src/text_detectorCNN.cpp
View file @
878258bc
...
...
@@ -376,7 +376,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorCaffeImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
));
#elif defined(HAVE_DNN)
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
));
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
,
700
,
700
,
3
));
#else
CV_Error
(
Error
::
StsError
,
"DeepCNNTextDetector::create backend not implemented"
);
return
Ptr
<
DeepCNNTextDetector
>
();
...
...
@@ -387,7 +387,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String
break
;
case
OCR_HOLISTIC_BACKEND_DNN
:
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
));
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
minibatchSz
,
700
,
700
,
3
));
break
;
case
OCR_HOLISTIC_BACKEND_NONE
:
...
...
@@ -420,7 +420,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::createTextBoxNet(String archFilena
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorCaffeImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
1
));
#elif defined(HAVE_DNN)
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
1
));
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
1
,
700
,
700
,
3
));
#else
CV_Error
(
Error
::
StsError
,
"DeepCNNTextDetector::create backend not implemented"
);
return
Ptr
<
DeepCNNTextDetector
>
();
...
...
@@ -430,7 +430,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::createTextBoxNet(String archFilena
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorCaffeImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
1
));
break
;
case
OCR_HOLISTIC_BACKEND_DNN
:
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
1
));
return
Ptr
<
DeepCNNTextDetector
>
(
new
DeepCNNTextDetectorDNNImpl
(
archFilename
,
weightsFilename
,
preprocessor
,
1
,
700
,
700
,
3
));
break
;
case
OCR_HOLISTIC_BACKEND_NONE
:
default
:
...
...
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