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
27961cd8
Commit
27961cd8
authored
Oct 11, 2017
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text: fix wrong channel swap in TestDetectorCNN
parent
7031316c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
text_recognition_cnn.cpp
modules/text/samples/text_recognition_cnn.cpp
+0
-1
text_detectorCNN.cpp
modules/text/src/text_detectorCNN.cpp
+3
-5
No files found.
modules/text/samples/text_recognition_cnn.cpp
View file @
27961cd8
...
...
@@ -106,4 +106,3 @@ int main(int argc, const char * argv[])
waitKey
();
return
0
;
}
modules/text/src/text_detectorCNN.cpp
View file @
27961cd8
...
...
@@ -74,22 +74,20 @@ public:
void
detect
(
InputArray
inputImage_
,
std
::
vector
<
Rect
>&
Bbox
,
std
::
vector
<
float
>&
confidence
)
{
CV_Assert
(
inputImage_
.
channels
()
==
inputChannelCount_
);
Size
inputSize
=
inputImage_
.
getMat
().
size
();
Mat
inputImage
=
inputImage_
.
getMat
();
Bbox
.
resize
(
0
);
confidence
.
resize
(
0
);
for
(
size_t
i
=
0
;
i
<
sizes_
.
size
();
i
++
)
{
Size
inputGeometry
=
sizes_
[
i
];
Mat
inputImage
=
inputImage_
.
getMat
().
clone
();
resize
(
inputImage
,
inputImage
,
inputGeometry
);
net_
.
setInput
(
blobFromImage
(
inputImage
,
1
,
inputGeometry
,
Scalar
(
123
,
117
,
104
)),
"data"
);
net_
.
setInput
(
blobFromImage
(
inputImage
,
1
,
inputGeometry
,
Scalar
(
123
,
117
,
104
),
false
,
false
),
"data"
);
Mat
outputNet
=
net_
.
forward
();
int
nbrTextBoxes
=
outputNet
.
size
[
2
];
int
nCol
=
outputNet
.
size
[
3
];
int
outputChannelCount
=
outputNet
.
size
[
1
];
CV_Assert
(
outputChannelCount
==
1
);
getOutputs
((
float
*
)(
outputNet
.
data
),
nbrTextBoxes
,
nCol
,
Bbox
,
confidence
,
input
Size
);
getOutputs
((
float
*
)(
outputNet
.
data
),
nbrTextBoxes
,
nCol
,
Bbox
,
confidence
,
input
Image
.
size
()
);
}
}
};
...
...
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