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
729737dd
Commit
729737dd
authored
Jul 02, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
parents
96ea9a0d
d4e02869
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
26 deletions
+139
-26
charuco.cpp
modules/aruco/src/charuco.cpp
+1
-1
test_charucodetection.cpp
modules/aruco/test/test_charucodetection.cpp
+46
-1
ovis.hpp
modules/ovis/include/opencv2/ovis.hpp
+10
-0
ovis.cpp
modules/ovis/src/ovis.cpp
+18
-0
deriche_filter.cpp
modules/ximgproc/src/deriche_filter.cpp
+31
-13
paillou_filter.cpp
modules/ximgproc/src/paillou_filter.cpp
+32
-10
color_balance_benchmark.py
modules/xphoto/samples/color_balance_benchmark.py
+1
-1
No files found.
modules/aruco/src/charuco.cpp
View file @
729737dd
...
...
@@ -194,7 +194,7 @@ void CharucoBoard::_getNearestMarkerCorners() {
double
sqDistance
;
Point3f
distVector
=
charucoCorner
-
center
;
sqDistance
=
distVector
.
x
*
distVector
.
x
+
distVector
.
y
*
distVector
.
y
;
if
(
j
==
0
||
fabs
(
sqDistance
-
minDist
)
<
0.0001
)
{
if
(
j
==
0
||
fabs
(
sqDistance
-
minDist
)
<
cv
::
pow
(
0.01
*
_squareLength
,
2
)
)
{
// if same minimum distance (or first iteration), add to nearestMarkerIdx vector
nearestMarkerIdx
[
i
].
push_back
(
j
);
minDist
=
sqDistance
;
...
...
modules/aruco/test/test_charucodetection.cpp
View file @
729737dd
...
...
@@ -538,7 +538,48 @@ void CV_CharucoDiamondDetection::run(int) {
}
}
/**
* @brief Check charuco board creation
*/
class
CV_CharucoBoardCreation
:
public
cvtest
::
BaseTest
{
public
:
CV_CharucoBoardCreation
();
protected
:
void
run
(
int
);
};
CV_CharucoBoardCreation
::
CV_CharucoBoardCreation
()
{}
void
CV_CharucoBoardCreation
::
run
(
int
)
{
Ptr
<
aruco
::
Dictionary
>
dictionary
=
aruco
::
getPredefinedDictionary
(
aruco
::
DICT_5X5_250
);
int
n
=
6
;
float
markerSizeFactor
=
0.5
f
;
for
(
float
squareSize_mm
=
5.0
f
;
squareSize_mm
<
35.0
f
;
squareSize_mm
+=
0.1
f
)
{
Ptr
<
aruco
::
CharucoBoard
>
board_meters
=
aruco
::
CharucoBoard
::
create
(
n
,
n
,
squareSize_mm
*
1e-3
f
,
squareSize_mm
*
markerSizeFactor
*
1e-3
f
,
dictionary
);
Ptr
<
aruco
::
CharucoBoard
>
board_millimeters
=
aruco
::
CharucoBoard
::
create
(
n
,
n
,
squareSize_mm
,
squareSize_mm
*
markerSizeFactor
,
dictionary
);
for
(
size_t
i
=
0
;
i
<
board_meters
->
nearestMarkerIdx
.
size
();
i
++
)
{
if
(
board_meters
->
nearestMarkerIdx
[
i
].
size
()
!=
board_millimeters
->
nearestMarkerIdx
[
i
].
size
()
||
board_meters
->
nearestMarkerIdx
[
i
][
0
]
!=
board_millimeters
->
nearestMarkerIdx
[
i
][
0
])
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
cv
::
format
(
"Charuco board topology is sensitive to scale with squareSize=%.1f
\n
"
,
squareSize_mm
).
c_str
());
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
);
break
;
}
}
}
}
TEST
(
CV_CharucoDetection
,
accuracy
)
{
...
...
@@ -546,7 +587,6 @@ TEST(CV_CharucoDetection, accuracy) {
test
.
safe_run
();
}
TEST
(
CV_CharucoPoseEstimation
,
accuracy
)
{
CV_CharucoPoseEstimation
test
;
test
.
safe_run
();
...
...
@@ -557,4 +597,9 @@ TEST(CV_CharucoDiamondDetection, accuracy) {
test
.
safe_run
();
}
TEST
(
CV_CharucoBoardCreation
,
accuracy
)
{
CV_CharucoBoardCreation
test
;
test
.
safe_run
();
}
}}
// namespace
modules/ovis/include/opencv2/ovis.hpp
View file @
729737dd
...
...
@@ -62,6 +62,16 @@ public:
/// @overload
CV_WRAP_AS
(
setBackgroundColor
)
virtual
void
setBackground
(
const
Scalar
&
color
)
=
0
;
/**
* enable an ordered chain of full-screen post processing effects
*
* this way you can add distortion or SSAO effects.
* The effects themselves must be defined inside Ogre .compositor scripts.
* @see addResourceLocation
* @param names compositor names that will be applied in order of appearance
*/
CV_WRAP
virtual
void
setCompositors
(
const
std
::
vector
<
String
>&
names
)
=
0
;
/**
* place an entity of an mesh in the scene
*
...
...
modules/ovis/src/ovis.cpp
View file @
729737dd
...
...
@@ -7,6 +7,7 @@
#include <OgreApplicationContext.h>
#include <OgreCameraMan.h>
#include <OgreRectangle2D.h>
#include <OgreCompositorManager.h>
#include <opencv2/calib3d.hpp>
...
...
@@ -339,6 +340,23 @@ public:
bgplane
->
setVisible
(
true
);
}
void
setCompositors
(
const
std
::
vector
<
String
>&
names
)
{
Viewport
*
vp
=
frameSrc
->
getViewport
(
0
);
CompositorManager
&
cm
=
CompositorManager
::
getSingleton
();
cm
.
removeCompositorChain
(
vp
);
// remove previous configuration
for
(
size_t
i
=
0
;
i
<
names
.
size
();
i
++
)
{
if
(
!
cm
.
addCompositor
(
vp
,
names
[
i
]))
{
LogManager
::
getSingleton
().
logError
(
"Failed to add compositor: "
+
names
[
i
]);
continue
;
}
cm
.
setCompositorEnabled
(
vp
,
names
[
i
],
true
);
}
}
void
setBackground
(
const
Scalar
&
color
)
{
// hide background plane
...
...
modules/ximgproc/src/deriche_filter.cpp
View file @
729737dd
...
...
@@ -135,6 +135,7 @@ HorizontalIIRFilter(Mat &img, Mat &dst, const Range &r, double alphaDerive)
j
=
cols
-
1
;
g2
[
j
]
=
(
a3
+
a4
)
*
*
c1
;
j
--
;
c1
--
;
g2
[
j
]
=
(
a3
+
a4
)
*
c1
[
1
]
+
b1
*
g2
[
j
+
1
];
j
--
;
c1
--
;
...
...
@@ -160,16 +161,18 @@ public:
dst
(
d
),
alphaDerive
(
ald
),
verbose
(
false
)
{}
{
int
type
=
img
.
depth
();
CV_CheckType
(
type
,
type
==
CV_8UC1
||
type
==
CV_8SC1
||
type
==
CV_16SC1
||
type
==
CV_16UC1
||
type
==
CV_32FC1
,
"Wrong input type for GradientDericheYCols"
);
type
=
dst
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong output type for GradientDericheYCols"
);
}
void
Verbose
(
bool
b
)
{
verbose
=
b
;
}
virtual
void
operator
()(
const
Range
&
range
)
const
CV_OVERRIDE
{
CV_Assert
(
img
.
depth
()
==
CV_8UC1
||
img
.
depth
()
==
CV_8SC1
||
img
.
depth
()
==
CV_16SC1
||
img
.
depth
()
==
CV_16UC1
);
CV_Assert
(
dst
.
depth
()
==
CV_32FC1
);
if
(
verbose
)
std
::
cout
<<
getThreadNum
()
<<
"# :Start from row "
<<
range
.
start
<<
" to "
<<
range
.
end
-
1
<<
" ("
<<
range
.
end
-
range
.
start
<<
" loops)"
<<
std
::
endl
;
switch
(
img
.
depth
())
{
case
CV_8U
:
VerticalIIRFilter
<
uchar
>
(
img
,
dst
,
range
,
alphaDerive
);
...
...
@@ -183,6 +186,9 @@ public:
case
CV_16S
:
VerticalIIRFilter
<
short
>
(
img
,
dst
,
range
,
alphaDerive
);
break
;
case
CV_32F
:
VerticalIIRFilter
<
float
>
(
img
,
dst
,
range
,
alphaDerive
);
break
;
default
:
return
;
}
...
...
@@ -207,12 +213,15 @@ public:
dst
(
d
),
alphaMoyenne
(
alm
),
verbose
(
false
)
{}
{
int
type
=
img
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong input type for GradientDericheYRows"
);
type
=
dst
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong output type for GradientDericheYRows"
);
}
void
Verbose
(
bool
b
)
{
verbose
=
b
;
}
virtual
void
operator
()(
const
Range
&
range
)
const
CV_OVERRIDE
{
CV_Assert
(
img
.
depth
()
==
CV_32FC1
);
CV_Assert
(
dst
.
depth
()
==
CV_32FC1
);
if
(
verbose
)
std
::
cout
<<
getThreadNum
()
<<
"# :Start from row "
<<
range
.
start
<<
" to "
<<
range
.
end
-
1
<<
" ("
<<
range
.
end
-
range
.
start
<<
" loops)"
<<
std
::
endl
;
float
*
f1
,
*
f2
;
...
...
@@ -280,12 +289,15 @@ public:
dst
(
d
),
alphaMoyenne
(
alm
),
verbose
(
false
)
{}
{
int
type
=
img
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong input type for GradientDericheXCols"
);
type
=
dst
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong output type for GradientDericheXCols"
);
}
void
Verbose
(
bool
b
)
{
verbose
=
b
;
}
virtual
void
operator
()(
const
Range
&
range
)
const
CV_OVERRIDE
{
CV_Assert
(
img
.
depth
()
==
CV_32FC1
);
CV_Assert
(
dst
.
depth
()
==
CV_32FC1
);
if
(
verbose
)
std
::
cout
<<
getThreadNum
()
<<
"# :Start from row "
<<
range
.
start
<<
" to "
<<
range
.
end
-
1
<<
" ("
<<
range
.
end
-
range
.
start
<<
" loops)"
<<
std
::
endl
;
float
*
f1
,
*
f2
;
...
...
@@ -355,12 +367,15 @@ public:
dst
(
d
),
alphaDerive
(
ald
),
verbose
(
false
)
{}
{
int
type
=
img
.
depth
();
CV_CheckType
(
type
,
type
==
CV_8UC1
||
type
==
CV_8SC1
||
type
==
CV_16SC1
||
type
==
CV_16UC1
||
type
==
CV_32FC1
,
"Wrong input type for GradientDericheXRows"
);
type
=
dst
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong output type for GradientDericheXRows"
);
}
void
Verbose
(
bool
b
)
{
verbose
=
b
;
}
virtual
void
operator
()(
const
Range
&
range
)
const
CV_OVERRIDE
{
CV_Assert
(
img
.
depth
()
==
CV_8UC1
||
img
.
depth
()
==
CV_8SC1
||
img
.
depth
()
==
CV_16SC1
||
img
.
depth
()
==
CV_16UC1
);
CV_Assert
(
dst
.
depth
()
==
CV_32FC1
);
if
(
verbose
)
std
::
cout
<<
getThreadNum
()
<<
"# :Start from row "
<<
range
.
start
<<
" to "
<<
range
.
end
-
1
<<
" ("
<<
range
.
end
-
range
.
start
<<
" loops)"
<<
std
::
endl
;
...
...
@@ -377,6 +392,9 @@ public:
case
CV_16S
:
HorizontalIIRFilter
<
short
>
(
img
,
dst
,
range
,
alphaDerive
);
break
;
case
CV_32F
:
HorizontalIIRFilter
<
float
>
(
img
,
dst
,
range
,
alphaDerive
);
break
;
default
:
return
;
}
...
...
modules/ximgproc/src/paillou_filter.cpp
View file @
729737dd
...
...
@@ -143,12 +143,15 @@ public:
a
(
aa
),
w
(
ww
),
verbose
(
false
)
{}
{
int
type
=
img
.
depth
();
CV_CheckType
(
type
,
type
==
CV_8UC1
||
type
==
CV_8SC1
||
type
==
CV_16SC1
||
type
==
CV_16UC1
||
type
==
CV_32FC1
,
"Wrong input type for GradientPaillouY"
);
type
=
dst
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong output type for GradientPaillouYCols"
);
}
void
Verbose
(
bool
b
){
verbose
=
b
;}
virtual
void
operator
()(
const
Range
&
range
)
const
CV_OVERRIDE
{
CV_Assert
(
img
.
depth
()
==
CV_8UC1
||
img
.
depth
()
==
CV_16SC1
||
img
.
depth
()
==
CV_16UC1
);
CV_Assert
(
dst
.
depth
()
==
CV_32FC1
);
if
(
verbose
)
std
::
cout
<<
getThreadNum
()
<<
"# :Start from row "
<<
range
.
start
<<
" to "
<<
range
.
end
-
1
<<
" ("
<<
range
.
end
-
range
.
start
<<
" loops)"
<<
std
::
endl
;
...
...
@@ -162,9 +165,12 @@ public:
case
CV_16S
:
VerticalIIRFilter
<
short
>
(
img
,
dst
,
range
,
a
,
w
);
break
;
case
CV_16U
:
case
CV_16U
:
VerticalIIRFilter
<
short
>
(
img
,
dst
,
range
,
a
,
w
);
break
;
case
CV_32F
:
VerticalIIRFilter
<
float
>
(
img
,
dst
,
range
,
a
,
w
);
break
;
default
:
return
;
}
...
...
@@ -191,11 +197,15 @@ public:
a
(
aa
),
w
(
ww
),
verbose
(
false
)
{}
{
int
type
=
img
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong input type for GradientPaillouYRows"
);
type
=
dst
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong output type for GradientPaillouYRows"
);
}
void
Verbose
(
bool
b
){
verbose
=
b
;}
virtual
void
operator
()(
const
Range
&
range
)
const
CV_OVERRIDE
{
CV_Assert
(
img
.
depth
()
==
CV_32FC1
);
if
(
verbose
)
std
::
cout
<<
getThreadNum
()
<<
"# :Start from row "
<<
range
.
start
<<
" to "
<<
range
.
end
-
1
<<
" ("
<<
range
.
end
-
range
.
start
<<
" loops)"
<<
std
::
endl
;
float
*
iy
,
*
iy0
;
...
...
@@ -261,11 +271,15 @@ public:
a
(
aa
),
w
(
ww
),
verbose
(
false
)
{}
{
int
type
=
img
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong input type for GradientPaillouXCols"
);
type
=
dst
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong output type for GradientPaillouXCols"
);
}
void
Verbose
(
bool
b
){
verbose
=
b
;}
virtual
void
operator
()(
const
Range
&
range
)
const
CV_OVERRIDE
{
CV_Assert
(
img
.
depth
()
==
CV_32FC1
);
if
(
verbose
)
std
::
cout
<<
getThreadNum
()
<<
"# :Start from row "
<<
range
.
start
<<
" to "
<<
range
.
end
-
1
<<
" ("
<<
range
.
end
-
range
.
start
<<
" loops)"
<<
std
::
endl
;
float
*
iy
,
*
iy0
;
...
...
@@ -331,7 +345,12 @@ public:
a
(
aa
),
w
(
ww
),
verbose
(
false
)
{}
{
int
type
=
img
.
depth
();
CV_CheckType
(
type
,
type
==
CV_8UC1
||
type
==
CV_8SC1
||
type
==
CV_16SC1
||
type
==
CV_16UC1
||
type
==
CV_32FC1
,
"Wrong input type for GradientPaillouXRows"
);
type
=
im1
.
depth
();
CV_CheckType
(
type
,
type
==
CV_32FC1
,
"Wrong output type for GradientPaillouXRows"
);
}
void
Verbose
(
bool
b
){
verbose
=
b
;}
virtual
void
operator
()(
const
Range
&
range
)
const
CV_OVERRIDE
{
...
...
@@ -349,9 +368,12 @@ public:
case
CV_16S
:
HorizontalIIRFilter
<
short
>
(
img
,
im1
,
range
,
a
,
w
);
break
;
case
CV_16U
:
case
CV_16U
:
HorizontalIIRFilter
<
ushort
>
(
img
,
im1
,
range
,
a
,
w
);
break
;
case
CV_32F
:
HorizontalIIRFilter
<
float
>
(
img
,
im1
,
range
,
a
,
w
);
break
;
default
:
return
;
}
...
...
modules/xphoto/samples/color_balance_benchmark.py
View file @
729737dd
...
...
@@ -231,7 +231,7 @@ if __name__ == '__main__':
state
=
load_json
(
args
.
state
)
algorithm_list
=
parse_sequence
(
args
.
algorithms
)
img_range
=
map
(
int
,
parse_sequence
(
args
.
range
))
img_range
=
list
(
map
(
int
,
parse_sequence
(
args
.
range
)
))
if
len
(
img_range
)
!=
2
:
print
(
"Error: Please specify the -r parameter in form <first_image_index>,<last_image_index>"
)
sys
.
exit
(
1
)
...
...
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