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
648db235
Commit
648db235
authored
Dec 28, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2397 from catree:fix_dnn_superres_build_without_quality
parents
58295b07
94d0250b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
20 deletions
+23
-20
CMakeLists.txt
modules/dnn_superres/CMakeLists.txt
+1
-1
dnn_superres.hpp
modules/dnn_superres/include/opencv2/dnn_superres.hpp
+0
-4
dnn_superres_benchmark_quality.cpp
...s/dnn_superres/samples/dnn_superres_benchmark_quality.cpp
+10
-2
dnn_superres_benchmark_time.cpp
modules/dnn_superres/samples/dnn_superres_benchmark_time.cpp
+0
-1
colorize.cpp
modules/ximgproc/samples/colorize.cpp
+8
-8
fbs_filter.cpp
modules/ximgproc/src/fbs_filter.cpp
+4
-4
No files found.
modules/dnn_superres/CMakeLists.txt
View file @
648db235
set
(
the_description
"Super Resolution using CNNs"
)
ocv_define_module
(
dnn_superres opencv_core opencv_imgproc opencv_dnn
OPTIONAL opencv_
datasets opencv_
quality
# samples
OPTIONAL opencv_quality
# samples
)
modules/dnn_superres/include/opencv2/dnn_superres.hpp
View file @
648db235
...
...
@@ -49,12 +49,8 @@ private:
int
sc
;
//scale factor
void
preprocess
(
InputArray
inpImg
,
OutputArray
outpImg
);
void
reconstruct_YCrCb
(
InputArray
inpImg
,
InputArray
origImg
,
OutputArray
outpImg
,
int
scale
);
void
reconstruct_YCrCb
(
InputArray
inpImg
,
InputArray
origImg
,
OutputArray
outpImg
);
void
preprocess_YCrCb
(
InputArray
inpImg
,
OutputArray
outpImg
);
public
:
...
...
modules/dnn_superres/samples/dnn_superres_benchmark_quality.cpp
View file @
648db235
...
...
@@ -3,7 +3,9 @@
// of this distribution and at http://opencv.org/license.html.
#include <iostream>
#include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_QUALITY
#include <opencv2/dnn_superres.hpp>
#include <opencv2/quality.hpp>
#include <opencv2/imgproc.hpp>
...
...
@@ -196,4 +198,11 @@ int main(int argc, char *argv[])
waitKey
(
0
);
return
0
;
}
\ No newline at end of file
}
#else
int
main
()
{
std
::
cout
<<
"This sample requires the OpenCV Quality module."
<<
std
::
endl
;
return
0
;
}
#endif
modules/dnn_superres/samples/dnn_superres_benchmark_time.cpp
View file @
648db235
...
...
@@ -5,7 +5,6 @@
#include <iostream>
#include <opencv2/dnn_superres.hpp>
#include <opencv2/quality.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
...
...
modules/ximgproc/samples/colorize.cpp
View file @
648db235
...
...
@@ -159,7 +159,7 @@ int main(int argc, char* argv[])
if
(
show_count
%
5
==
0
)
{
cv
::
Mat
target_temp
(
target
.
size
(),
target
.
type
());
filtering_time
=
(
double
)
getTickCount
(
);
filtering_time
=
static_cast
<
float
>
(
getTickCount
()
);
if
(
mouseDraw
)
{
cv
::
cvtColor
(
target
,
target_temp
,
cv
::
COLOR_BGR2YCrCb
);
...
...
@@ -184,7 +184,7 @@ int main(int argc, char* argv[])
{
target_temp
=
target
.
clone
();
}
filtering_time
=
((
double
)
getTickCount
()
-
filtering_time
)
/
getTickFrequency
(
);
filtering_time
=
static_cast
<
float
>
(((
double
)
getTickCount
()
-
filtering_time
)
/
getTickFrequency
()
);
std
::
cout
<<
"solver time: "
<<
filtering_time
<<
"s"
<<
std
::
endl
;
cv
::
Mat
color_selected
(
target_temp
.
rows
-
mat_pallet
.
rows
,
PALLET_RADIUS
*
2
,
CV_8UC3
,
cv
::
Scalar
(
selected_b
,
selected_g
,
selected_r
));
...
...
@@ -209,7 +209,7 @@ int main(int argc, char* argv[])
cv
::
Mat
result1
=
cv
::
Mat
(
mat_input_gray
.
size
(),
mat_input_gray
.
type
());
cv
::
Mat
result2
=
cv
::
Mat
(
mat_input_gray
.
size
(),
mat_input_gray
.
type
());
filtering_time
=
(
double
)
getTickCount
(
);
filtering_time
=
static_cast
<
float
>
(
getTickCount
()
);
// dst_channels.push_back(src_channels[0]);
dst_channels
.
push_back
(
mat_input_gray
);
...
...
@@ -221,7 +221,7 @@ int main(int argc, char* argv[])
cv
::
merge
(
dst_channels
,
target
);
cv
::
cvtColor
(
target
,
target
,
cv
::
COLOR_YCrCb2BGR
);
filtering_time
=
((
double
)
getTickCount
()
-
filtering_time
)
/
getTickFrequency
(
);
filtering_time
=
static_cast
<
float
>
(((
double
)
getTickCount
()
-
filtering_time
)
/
getTickFrequency
()
);
std
::
cout
<<
"solver time: "
<<
filtering_time
<<
"s"
<<
std
::
endl
;
...
...
@@ -331,7 +331,7 @@ void drawTrajectoryByReference(cv::Mat& img)
gray
=
*
grayPix
;
grayPix
++
;
mat_input_confidence
.
at
<
uchar
>
(
y
,
x
)
=
255
;
float
draw_y
=
0.229
*
(
float
(
selected_r
))
+
0.587
*
(
float
(
selected_g
))
+
0.114
*
(
float
(
selected_b
));
float
draw_y
=
0.229
f
*
(
float
(
selected_r
))
+
0.587
f
*
(
float
(
selected_g
))
+
0.114
f
*
(
float
(
selected_b
));
int
draw_b
=
int
(
float
(
selected_b
)
*
(
gray
/
draw_y
));
int
draw_g
=
int
(
float
(
selected_g
)
*
(
gray
/
draw_y
));
int
draw_r
=
int
(
float
(
selected_r
)
*
(
gray
/
draw_y
));
...
...
@@ -397,13 +397,13 @@ void createPlate(Mat &im1, int radius)
Point
pt2
(
j
-
cx
,
i
-
cy
);
if
(
inCircle
(
Point
(
0
,
0
),
pt2
,
radius
))
{
int
theta
=
angle
(
pt1
,
pt2
)
*
180
/
CV_PI
;
int
theta
=
static_cast
<
int
>
(
angle
(
pt1
,
pt2
)
*
180
/
CV_PI
)
;
if
(
i
>
cx
)
{
theta
=
-
theta
+
360
;
}
hsvImag
.
at
<
Vec3b
>
(
i
,
j
)[
0
]
=
theta
/
2
;
hsvImag
.
at
<
Vec3b
>
(
i
,
j
)[
1
]
=
module
(
pt2
)
/
cx
*
255
;
hsvImag
.
at
<
Vec3b
>
(
i
,
j
)[
0
]
=
saturate_cast
<
uchar
>
(
theta
/
2
)
;
hsvImag
.
at
<
Vec3b
>
(
i
,
j
)[
1
]
=
saturate_cast
<
uchar
>
(
module
(
pt2
)
/
cx
*
255
)
;
hsvImag
.
at
<
Vec3b
>
(
i
,
j
)[
2
]
=
255
;
}
}
...
...
modules/ximgproc/src/fbs_filter.cpp
View file @
648db235
...
...
@@ -186,8 +186,8 @@ namespace ximgproc
bs_params
()
{
lam
=
128.0
;
A_diag_min
=
1e-5
;
cg_tol
=
1e-5
;
A_diag_min
=
1e-5
f
;
cg_tol
=
1e-5
f
;
cg_maxiter
=
25
;
}
};
...
...
@@ -261,7 +261,7 @@ namespace ximgproc
++
pix_idx
;
}
}
nvertices
=
hashed_coords
.
size
(
);
nvertices
=
static_cast
<
int
>
(
hashed_coords
.
size
()
);
// construct Blur matrices
Eigen
::
VectorXf
ones_nvertices
=
Eigen
::
VectorXf
::
Ones
(
nvertices
);
...
...
@@ -373,7 +373,7 @@ namespace ximgproc
++
pix_idx
;
}
}
nvertices
=
hashed_coords
.
size
(
);
nvertices
=
static_cast
<
int
>
(
hashed_coords
.
size
()
);
// construct Blur matrices
Eigen
::
VectorXf
ones_nvertices
=
Eigen
::
VectorXf
::
Ones
(
nvertices
);
...
...
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