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
82c2aa6e
Commit
82c2aa6e
authored
6 years ago
by
Alexander Nesterov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added bugfix and some tests
parent
93d17858
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
perf_qrcode_pipeline.cpp
modules/objdetect/perf/perf_qrcode_pipeline.cpp
+25
-2
qrcode.cpp
modules/objdetect/src/qrcode.cpp
+0
-0
No files found.
modules/objdetect/perf/perf_qrcode_pipeline.cpp
View file @
82c2aa6e
...
...
@@ -74,6 +74,17 @@ PERF_TEST_P_(Perf_Objdetect_Not_QRCode, detect)
RNG
rng
;
rng
.
fill
(
not_qr_code
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
1
));
}
if
(
type_gen
==
"chessboard"
)
{
uint8_t
next_pixel
=
0
;
for
(
int
r
=
0
;
r
<
not_qr_code
.
rows
*
not_qr_code
.
cols
;
r
++
)
{
int
i
=
r
/
not_qr_code
.
cols
;
int
j
=
r
%
not_qr_code
.
cols
;
not_qr_code
.
ptr
<
uchar
>
(
i
)[
j
]
=
next_pixel
;
next_pixel
=
255
-
next_pixel
;
}
}
QRCodeDetector
qrcode
;
TEST_CYCLE
()
ASSERT_FALSE
(
qrcode
.
detect
(
not_qr_code
,
corners
));
...
...
@@ -96,6 +107,17 @@ PERF_TEST_P_(Perf_Objdetect_Not_QRCode, decode)
RNG
rng
;
rng
.
fill
(
not_qr_code
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
1
));
}
if
(
type_gen
==
"chessboard"
)
{
uint8_t
next_pixel
=
0
;
for
(
int
r
=
0
;
r
<
not_qr_code
.
rows
*
not_qr_code
.
cols
;
r
++
)
{
int
i
=
r
/
not_qr_code
.
cols
;
int
j
=
r
%
not_qr_code
.
cols
;
not_qr_code
.
ptr
<
uchar
>
(
i
)[
j
]
=
next_pixel
;
next_pixel
=
255
-
next_pixel
;
}
}
QRCodeDetector
qrcode
;
TEST_CYCLE
()
ASSERT_TRUE
(
qrcode
.
decode
(
not_qr_code
,
corners
,
straight_barcode
).
empty
());
...
...
@@ -105,8 +127,9 @@ PERF_TEST_P_(Perf_Objdetect_Not_QRCode, decode)
INSTANTIATE_TEST_CASE_P
(
/*nothing*/
,
Perf_Objdetect_Not_QRCode
,
::
testing
::
Combine
(
::
testing
::
Values
(
"zero"
,
"random"
),
::
testing
::
Values
(
Size
(
640
,
480
),
Size
(
1280
,
720
),
Size
(
1920
,
1080
))
::
testing
::
Values
(
"zero"
,
"random"
,
"chessboard"
),
::
testing
::
Values
(
Size
(
640
,
480
),
Size
(
1280
,
720
),
Size
(
1920
,
1080
),
Size
(
3840
,
2160
))
));
}
...
...
This diff is collapsed.
Click to expand it.
modules/objdetect/src/qrcode.cpp
View file @
82c2aa6e
This diff is collapsed.
Click to expand it.
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