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
eda4575e
Commit
eda4575e
authored
Apr 13, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
parents
01cfda40
f6d0e94e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
30 deletions
+51
-30
aruco.hpp
modules/aruco/include/opencv2/aruco.hpp
+2
-0
aruco.cpp
modules/aruco/src/aruco.cpp
+4
-22
test_shape.py
modules/shape/misc/python/test/test_shape.py
+37
-0
ocr_tesseract.cpp
modules/text/src/ocr_tesseract.cpp
+8
-0
precomp.hpp
modules/text/src/precomp.hpp
+0
-8
No files found.
modules/aruco/include/opencv2/aruco.hpp
View file @
eda4575e
...
...
@@ -471,6 +471,8 @@ CV_EXPORTS_W void drawDetectedMarkers(InputOutputArray image, InputArrayOfArrays
*
* Given the pose estimation of a marker or board, this function draws the axis of the world
* coordinate system, i.e. the system centered on the marker/board. Useful for debugging purposes.
*
* @deprecated use cv::drawFrameAxes
*/
CV_EXPORTS_W
void
drawAxis
(
InputOutputArray
image
,
InputArray
cameraMatrix
,
InputArray
distCoeffs
,
InputArray
rvec
,
InputArray
tvec
,
float
length
);
...
...
modules/aruco/src/aruco.cpp
View file @
eda4575e
...
...
@@ -1731,30 +1731,12 @@ void drawDetectedMarkers(InputOutputArray _image, InputArrayOfArrays _corners,
/**
*/
void
drawAxis
(
InputOutputArray
_image
,
InputArray
_cameraMatrix
,
InputArray
_distCoeffs
,
InputArray
_rvec
,
InputArray
_tvec
,
float
length
)
{
CV_Assert
(
_image
.
getMat
().
total
()
!=
0
&&
(
_image
.
getMat
().
channels
()
==
1
||
_image
.
getMat
().
channels
()
==
3
));
CV_Assert
(
length
>
0
);
// project axis points
vector
<
Point3f
>
axisPoints
;
axisPoints
.
push_back
(
Point3f
(
0
,
0
,
0
));
axisPoints
.
push_back
(
Point3f
(
length
,
0
,
0
));
axisPoints
.
push_back
(
Point3f
(
0
,
length
,
0
));
axisPoints
.
push_back
(
Point3f
(
0
,
0
,
length
));
vector
<
Point2f
>
imagePoints
;
projectPoints
(
axisPoints
,
_rvec
,
_tvec
,
_cameraMatrix
,
_distCoeffs
,
imagePoints
);
// draw axis lines
line
(
_image
,
imagePoints
[
0
],
imagePoints
[
1
],
Scalar
(
0
,
0
,
255
),
3
);
line
(
_image
,
imagePoints
[
0
],
imagePoints
[
2
],
Scalar
(
0
,
255
,
0
),
3
);
line
(
_image
,
imagePoints
[
0
],
imagePoints
[
3
],
Scalar
(
255
,
0
,
0
),
3
);
void
drawAxis
(
InputOutputArray
_image
,
InputArray
_cameraMatrix
,
InputArray
_distCoeffs
,
InputArray
_rvec
,
InputArray
_tvec
,
float
length
)
{
drawFrameAxes
(
_image
,
_cameraMatrix
,
_distCoeffs
,
_rvec
,
_tvec
,
length
,
3
);
}
/**
*/
void
drawMarker
(
const
Ptr
<
Dictionary
>
&
dictionary
,
int
id
,
int
sidePixels
,
OutputArray
_img
,
int
borderBits
)
{
...
...
modules/shape/misc/python/test/test_shape.py
0 → 100644
View file @
eda4575e
#!/usr/bin/env python
# Python 2/3 compatibility
from
__future__
import
print_function
import
os
import
cv2
as
cv
from
tests_common
import
NewOpenCVTests
SCRIPT_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
MODULE_DIR
=
os
.
path
.
join
(
SCRIPT_DIR
,
'../../../'
)
class
shape_test
(
NewOpenCVTests
):
def
test_computeDistance
(
self
):
a
=
cv
.
imread
(
os
.
path
.
join
(
MODULE_DIR
,
'samples/data/shape_sample/1.png'
),
cv
.
IMREAD_GRAYSCALE
)
b
=
cv
.
imread
(
os
.
path
.
join
(
MODULE_DIR
,
'samples/data/shape_sample/2.png'
),
cv
.
IMREAD_GRAYSCALE
)
if
a
is
None
or
b
is
None
:
raise
unittest
.
SkipTest
(
"Missing files with test data"
)
ca
,
_
=
cv
.
findContours
(
a
,
cv
.
RETR_CCOMP
,
cv
.
CHAIN_APPROX_TC89_KCOS
)
cb
,
_
=
cv
.
findContours
(
b
,
cv
.
RETR_CCOMP
,
cv
.
CHAIN_APPROX_TC89_KCOS
)
hd
=
cv
.
createHausdorffDistanceExtractor
()
sd
=
cv
.
createShapeContextDistanceExtractor
()
d1
=
hd
.
computeDistance
(
ca
[
0
],
cb
[
0
])
d2
=
sd
.
computeDistance
(
ca
[
0
],
cb
[
0
])
self
.
assertAlmostEqual
(
d1
,
26.4196891785
,
3
,
"HausdorffDistanceExtractor"
)
self
.
assertAlmostEqual
(
d2
,
0.25804194808
,
3
,
"ShapeContextDistanceExtractor"
)
if
__name__
==
'__main__'
:
NewOpenCVTests
.
bootstrap
()
modules/text/src/ocr_tesseract.cpp
View file @
eda4575e
...
...
@@ -48,6 +48,14 @@
#include <fstream>
#include <queue>
#ifdef HAVE_TESSERACT
#if !defined(USE_STD_NAMESPACE)
#define USE_STD_NAMESPACE
#endif
#include <tesseract/baseapi.h>
#include <tesseract/resultiterator.h>
#endif
namespace
cv
{
namespace
text
...
...
modules/text/src/precomp.hpp
View file @
eda4575e
...
...
@@ -47,12 +47,4 @@
#include "text_config.hpp"
#ifdef HAVE_TESSERACT
#if !defined(USE_STD_NAMESPACE)
#define USE_STD_NAMESPACE
#endif
#include <tesseract/baseapi.h>
#include <tesseract/resultiterator.h>
#endif
#endif
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