Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
48c8c953
Commit
48c8c953
authored
Jan 29, 2020
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16452 from alalek:objdetect_align_with_master
parents
cd2d6ac9
8facf61b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
43 deletions
+37
-43
objdetect.hpp
modules/objdetect/include/opencv2/objdetect.hpp
+37
-23
qrcode.cpp
modules/objdetect/src/qrcode.cpp
+0
-20
No files found.
modules/objdetect/include/opencv2/objdetect.hpp
View file @
48c8c953
...
...
@@ -743,6 +743,43 @@ public:
OutputArrayOfArrays
straight_qrcode
=
noArray
()
)
const
;
#ifndef CV_DOXYGEN // COMPATIBILITY
inline
bool
decodeMulti
(
InputArray
img
,
InputArray
points
,
CV_OUT
std
::
vector
<
std
::
string
>&
decoded_info
,
OutputArrayOfArrays
straight_qrcode
=
noArray
()
)
const
{
std
::
vector
<
cv
::
String
>
decoded_info_
;
bool
res
=
decodeMulti
(
img
,
points
,
decoded_info_
,
straight_qrcode
);
decoded_info
.
resize
(
decoded_info_
.
size
());
for
(
size_t
i
=
0
;
i
<
decoded_info
.
size
();
++
i
)
{
cv
::
String
s
;
std
::
swap
(
s
,
decoded_info_
[
i
]);
decoded_info
[
i
]
=
s
;
}
return
res
;
}
inline
bool
detectAndDecodeMulti
(
InputArray
img
,
CV_OUT
std
::
vector
<
std
::
string
>&
decoded_info
,
OutputArray
points
=
noArray
(),
OutputArrayOfArrays
straight_qrcode
=
noArray
()
)
const
{
std
::
vector
<
cv
::
String
>
decoded_info_
;
bool
res
=
detectAndDecodeMulti
(
img
,
decoded_info_
,
points
,
straight_qrcode
);
decoded_info
.
resize
(
decoded_info_
.
size
());
for
(
size_t
i
=
0
;
i
<
decoded_info
.
size
();
++
i
)
{
cv
::
String
s
;
std
::
swap
(
s
,
decoded_info_
[
i
]);
decoded_info
[
i
]
=
s
;
}
return
res
;
}
#endif
protected
:
struct
Impl
;
Ptr
<
Impl
>
p
;
...
...
@@ -764,29 +801,6 @@ CV_EXPORTS bool detectQRCode(InputArray in, std::vector<Point> &points, double e
*/
CV_EXPORTS
bool
decodeQRCode
(
InputArray
in
,
InputArray
points
,
std
::
string
&
decoded_info
,
OutputArray
straight_qrcode
=
noArray
());
/** @brief Detect QR codes in image and return vector of minimum area of quadrangle that describes QR codes.
@param in Matrix of the type CV_8UC1 containing an image where QR codes are detected.
@param points Output vector of vertices of quadrangles of minimal area that describes QR codes.
@param eps_x Epsilon neighborhood, which allows you to determine the horizontal pattern of the scheme 1:1:3:1:1 according to QR code standard.
@param eps_y Epsilon neighborhood, which allows you to determine the vertical pattern of the scheme 1:1:3:1:1 according to QR code standard.
*/
CV_EXPORTS
bool
detectQRCodeMulti
(
InputArray
in
,
std
::
vector
<
Point
>
&
points
,
double
eps_x
=
0.2
,
double
eps_y
=
0.1
);
/** @brief Decode QR codes in image and return text that is encrypted in QR code.
@param in Matrix of the type CV_8UC1 containing an image where QR code are detected.
@param points Input vector of vertices of quadrangles of minimal area that describes QR codes.
@param decoded_info vector of String information that is encrypted in QR codes.
@param straight_qrcode vector of Matrixes of the type CV_8UC1 containing an binary straight QR codes.
*/
CV_EXPORTS
bool
decodeQRCodeMulti
(
InputArray
in
,
InputArray
points
,
CV_OUT
std
::
vector
<
std
::
string
>
&
decoded_info
,
OutputArrayOfArrays
straight_qrcode
=
noArray
());
//! @} objdetect
}
...
...
modules/objdetect/src/qrcode.cpp
View file @
48c8c953
...
...
@@ -2234,14 +2234,6 @@ bool QRCodeDetector::detectMulti(InputArray in, OutputArray points) const
return
true
;
}
bool
detectQRCodeMulti
(
InputArray
in
,
vector
<
Point
>
&
points
,
double
eps_x
,
double
eps_y
)
{
QRCodeDetector
qrdetector
;
qrdetector
.
setEpsX
(
eps_x
);
qrdetector
.
setEpsY
(
eps_y
);
return
qrdetector
.
detectMulti
(
in
,
points
);
}
class
ParallelDecodeProcess
:
public
ParallelLoopBody
{
public
:
...
...
@@ -2385,16 +2377,4 @@ bool QRCodeDetector::detectAndDecodeMulti(
return
ok
;
}
bool
decodeQRCodeMulti
(
InputArray
in
,
InputArray
points
,
vector
<
std
::
string
>
&
decoded_info
,
OutputArrayOfArrays
straight_qrcode
)
{
QRCodeDetector
qrcode
;
vector
<
cv
::
String
>
info
;
bool
ok
=
qrcode
.
decodeMulti
(
in
,
points
,
info
,
straight_qrcode
);
for
(
size_t
i
=
0
;
i
<
info
.
size
();
i
++
)
decoded_info
.
push_back
(
info
[
i
]);
return
ok
;
}
}
// namespace
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