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
a3144cba
Commit
a3144cba
authored
Sep 30, 2019
by
Sebastián Gurin
Committed by
Alexander Alekhin
Sep 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pull request #15480 from cancerberoSgx:estimateAffine2D
js - cv.estimateAffine2D, cv.warpPolar
parent
5c9a624a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
2 deletions
+43
-2
embindgen.py
modules/js/src/embindgen.py
+2
-2
test_calib3d.js
modules/js/test/test_calib3d.js
+24
-0
test_imgproc.js
modules/js/test/test_imgproc.js
+17
-0
No files found.
modules/js/src/embindgen.py
View file @
a3144cba
...
...
@@ -112,7 +112,7 @@ imgproc = {'': ['Canny', 'GaussianBlur', 'Laplacian', 'HoughLines', 'HoughLinesP
'goodFeaturesToTrack'
,
'grabCut'
,
'initUndistortRectifyMap'
,
'integral'
,
'integral2'
,
'isContourConvex'
,
'line'
,
\
'matchShapes'
,
'matchTemplate'
,
'medianBlur'
,
'minAreaRect'
,
'minEnclosingCircle'
,
'moments'
,
'morphologyEx'
,
\
'pointPolygonTest'
,
'putText'
,
'pyrDown'
,
'pyrUp'
,
'rectangle'
,
'remap'
,
'resize'
,
'sepFilter2D'
,
'threshold'
,
\
'undistort'
,
'warpAffine'
,
'warpPerspective'
,
'watershed'
,
\
'undistort'
,
'warpAffine'
,
'warpPerspective'
,
'wa
rpPolar'
,
'wa
tershed'
,
\
'fillPoly'
,
'fillConvexPoly'
],
'CLAHE'
:
[
'apply'
,
'collectGarbage'
,
'getClipLimit'
,
'getTilesGridSize'
,
'setClipLimit'
,
'setTilesGridSize'
]}
...
...
@@ -143,7 +143,7 @@ features2d = {'Feature2D': ['detect', 'compute', 'detectAndCompute', 'descriptor
'BFMatcher'
:
[
'isMaskSupported'
,
'create'
],
''
:
[
'drawKeypoints'
,
'drawMatches'
,
'drawMatchesKnn'
]}
calib3d
=
{
''
:
[
'findHomography'
,
'Rodrigues'
]}
calib3d
=
{
''
:
[
'findHomography'
,
'
estimateAffine2D'
,
'
Rodrigues'
]}
def
makeWhiteList
(
module_list
):
wl
=
{}
...
...
modules/js/test/test_calib3d.js
View file @
a3144cba
...
...
@@ -65,3 +65,27 @@ QUnit.test('Rodrigues', function(assert) {
assert
.
ok
(
1.01
>
rvec1
.
data64F
[
0
]
>
0.9
);
// Answer should be around 1: 0.9999999999999999
});
QUnit
.
test
(
'estimateAffine2D'
,
function
(
assert
)
{
const
inputs
=
cv
.
matFromArray
(
4
,
1
,
cv
.
CV_32FC2
,
[
1
,
1
,
80
,
0
,
0
,
80
,
80
,
80
]);
const
outputs
=
cv
.
matFromArray
(
4
,
1
,
cv
.
CV_32FC2
,
[
21
,
51
,
70
,
77
,
40
,
40
,
10
,
70
]);
const
M
=
cv
.
estimateAffine2D
(
inputs
,
outputs
);
assert
.
ok
(
M
instanceof
cv
.
Mat
);
assert
.
deepEqual
(
Array
.
from
(
M
.
data
),
[
23
,
55
,
97
,
126
,
87
,
139
,
227
,
63
,
0
,
0
,
0
,
0
,
0
,
0
,
232
,
191
,
71
,
246
,
12
,
68
,
165
,
35
,
53
,
64
,
99
,
56
,
27
,
66
,
14
,
254
,
212
,
63
,
103
,
102
,
102
,
102
,
102
,
102
,
182
,
191
,
195
,
252
,
174
,
22
,
55
,
97
,
73
,
64
]);
});
modules/js/test/test_imgproc.js
View file @
a3144cba
...
...
@@ -960,3 +960,20 @@ QUnit.test('test_filter', function(assert) {
src
.
delete
();
}
});
QUnit
.
test
(
'warpPolar'
,
function
(
assert
)
{
const
lines
=
new
cv
.
Mat
(
255
,
255
,
cv
.
CV_8U
,
new
cv
.
Scalar
(
0
));
for
(
let
r
=
0
;
r
<
lines
.
rows
;
r
++
)
{
lines
.
row
(
r
).
setTo
(
new
cv
.
Scalar
(
r
));
}
cv
.
warpPolar
(
lines
,
lines
,
{
width
:
5
,
height
:
5
},
new
cv
.
Point
(
2
,
2
),
3
,
cv
.
INTER_CUBIC
|
cv
.
WARP_FILL_OUTLIERS
|
cv
.
WARP_INVERSE_MAP
);
assert
.
ok
(
lines
instanceof
cv
.
Mat
);
assert
.
deepEqual
(
Array
.
from
(
lines
.
data
),
[
159
,
172
,
191
,
210
,
223
,
146
,
159
,
191
,
223
,
236
,
128
,
128
,
0
,
0
,
0
,
109
,
96
,
64
,
32
,
19
,
96
,
83
,
64
,
45
,
32
]);
});
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