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
d511587c
Commit
d511587c
authored
Nov 18, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1911 from alalek:legacy_constants
parents
b686f430
10b48672
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
sobelfilterwidget.cpp
modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp
+5
-5
face.hpp
modules/face/include/opencv2/face.hpp
+9
-9
wbdetector.cpp
modules/xobjdetect/src/wbdetector.cpp
+3
-3
waldboost_detector.cpp
...objdetect/tools/waldboost_detector/waldboost_detector.cpp
+1
-1
No files found.
modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp
View file @
d511587c
...
...
@@ -35,7 +35,7 @@ SobelFilterWidget::SobelFilterWidget(QWidget *parent)
ksize_
->
addItem
(
"3"
);
ksize_
->
addItem
(
"5"
);
ksize_
->
addItem
(
"7"
);
ksize_
->
addItem
(
"
CV
_SCHARR(-1)"
);
ksize_
->
addItem
(
"
FILTER
_SCHARR(-1)"
);
ksize_
->
setCurrentIndex
(
1
);
borderType_
->
addItem
(
"BORDER_DEFAULT"
);
...
...
@@ -133,7 +133,7 @@ void SobelFilterWidget::applyFilter(InputArray in, OutputArray out) const
ksize
=
7
;
break
;
case
4
:
ksize
=
CV
_SCHARR
;
ksize
=
FILTER
_SCHARR
;
break
;
}
...
...
@@ -258,15 +258,15 @@ std::pair<bool, QString> SobelFilterWidget::checkInput(InputArray in) const
ksize
=
7
;
break
;
case
4
:
ksize
=
CV
_SCHARR
;
ksize
=
FILTER
_SCHARR
;
break
;
}
if
(
ksize
==
CV
_SCHARR
)
if
(
ksize
==
FILTER
_SCHARR
)
{
if
(
dx
+
dy
!=
1
)
{
return
{
false
,
"ksize=
CV
_SCHARR but dx+dy != 1"
};
return
{
false
,
"ksize=
FILTER
_SCHARR but dx+dy != 1"
};
}
}
else
...
...
modules/face/include/opencv2/face.hpp
View file @
d511587c
...
...
@@ -131,7 +131,7 @@ If you've set the threshold to 0.0 as we did above, then:
@code
//
Mat img = imread("person1/3.jpg",
CV_LOAD_IMAGE
_GRAYSCALE);
Mat img = imread("person1/3.jpg",
IMREAD
_GRAYSCALE);
// Get a prediction from the model. Note: We've set a threshold of 0.0 above,
// since the distance is almost always larger than 0.0, you'll get -1 as
// label, which indicates, this face is unknown
...
...
@@ -176,13 +176,13 @@ public:
vector<Mat> images;
vector<int> labels;
// images for first person
images.push_back(imread("person0/0.jpg",
CV_LOAD_IMAGE
_GRAYSCALE)); labels.push_back(0);
images.push_back(imread("person0/1.jpg",
CV_LOAD_IMAGE
_GRAYSCALE)); labels.push_back(0);
images.push_back(imread("person0/2.jpg",
CV_LOAD_IMAGE
_GRAYSCALE)); labels.push_back(0);
images.push_back(imread("person0/0.jpg",
IMREAD
_GRAYSCALE)); labels.push_back(0);
images.push_back(imread("person0/1.jpg",
IMREAD
_GRAYSCALE)); labels.push_back(0);
images.push_back(imread("person0/2.jpg",
IMREAD
_GRAYSCALE)); labels.push_back(0);
// images for second person
images.push_back(imread("person1/0.jpg",
CV_LOAD_IMAGE
_GRAYSCALE)); labels.push_back(1);
images.push_back(imread("person1/1.jpg",
CV_LOAD_IMAGE
_GRAYSCALE)); labels.push_back(1);
images.push_back(imread("person1/2.jpg",
CV_LOAD_IMAGE
_GRAYSCALE)); labels.push_back(1);
images.push_back(imread("person1/0.jpg",
IMREAD
_GRAYSCALE)); labels.push_back(1);
images.push_back(imread("person1/1.jpg",
IMREAD
_GRAYSCALE)); labels.push_back(1);
images.push_back(imread("person1/2.jpg",
IMREAD
_GRAYSCALE)); labels.push_back(1);
@endcode
Now that you have read some images, we can create a new FaceRecognizer. In this example I'll create
...
...
@@ -275,7 +275,7 @@ public:
// Do your initialization here (create the cv::FaceRecognizer model) ...
// ...
// Read in a sample image:
Mat img = imread("person1/3.jpg",
CV_LOAD_IMAGE
_GRAYSCALE);
Mat img = imread("person1/3.jpg",
IMREAD
_GRAYSCALE);
// And get a prediction from the cv::FaceRecognizer:
int predicted = model->predict(img);
@endcode
...
...
@@ -286,7 +286,7 @@ public:
using namespace cv;
// Do your initialization here (create the cv::FaceRecognizer model) ...
// ...
Mat img = imread("person1/3.jpg",
CV_LOAD_IMAGE
_GRAYSCALE);
Mat img = imread("person1/3.jpg",
IMREAD
_GRAYSCALE);
// Some variables for the predicted label and associated confidence (e.g. distance):
int predicted_label = -1;
double predicted_confidence = 0.0;
...
...
modules/xobjdetect/src/wbdetector.cpp
View file @
d511587c
...
...
@@ -63,7 +63,7 @@ static vector<Mat> sample_patches(
vector
<
Mat
>
patches
;
size_t
patch_count
=
0
;
for
(
size_t
i
=
0
;
i
<
filenames
.
size
();
++
i
)
{
Mat
img
=
imread
(
filenames
[
i
],
CV_LOAD_IMAGE
_GRAYSCALE
);
Mat
img
=
imread
(
filenames
[
i
],
IMREAD
_GRAYSCALE
);
for
(
int
row
=
0
;
row
+
n_rows
<
img
.
rows
;
row
+=
n_rows
)
{
for
(
int
col
=
0
;
col
+
n_cols
<
img
.
cols
;
col
+=
n_cols
)
{
patches
.
push_back
(
img
(
Rect
(
col
,
row
,
n_cols
,
n_rows
)).
clone
());
...
...
@@ -84,7 +84,7 @@ static vector<Mat> read_imgs(const string& path)
glob
(
path
,
filenames
);
vector
<
Mat
>
imgs
;
for
(
size_t
i
=
0
;
i
<
filenames
.
size
();
++
i
)
{
imgs
.
push_back
(
imread
(
filenames
[
i
],
CV_LOAD_IMAGE
_GRAYSCALE
));
imgs
.
push_back
(
imread
(
filenames
[
i
],
IMREAD
_GRAYSCALE
));
}
return
imgs
;
}
...
...
@@ -165,7 +165,7 @@ void WBDetectorImpl::train(
for
(;
img_i
<
neg_filenames
.
size
();
++
img_i
)
{
cerr
<<
"win "
<<
bootstrap_count
<<
"/"
<<
stage_neg
<<
" img "
<<
(
img_i
+
1
)
<<
"/"
<<
neg_filenames
.
size
()
<<
"
\r
"
;
Mat
img
=
imread
(
neg_filenames
[
img_i
],
CV_LOAD_IMAGE
_GRAYSCALE
);
Mat
img
=
imread
(
neg_filenames
[
img_i
],
IMREAD
_GRAYSCALE
);
vector
<
Rect
>
bboxes
;
Mat1f
confidences
;
boost_
.
detect
(
eval
,
img
,
scales
,
bboxes
,
confidences
);
...
...
modules/xobjdetect/tools/waldboost_detector/waldboost_detector.cpp
View file @
d511587c
...
...
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
assert
(
argc
==
6
);
vector
<
Rect
>
bboxes
;
vector
<
double
>
confidences
;
Mat
img
=
imread
(
argv
[
3
],
CV_LOAD_IMAGE
_GRAYSCALE
);
Mat
img
=
imread
(
argv
[
3
],
IMREAD
_GRAYSCALE
);
FileStorage
fs
(
argv
[
2
],
FileStorage
::
READ
);
detector
->
read
(
fs
.
getFirstTopLevelNode
());
detector
->
detect
(
img
,
bboxes
,
confidences
);
...
...
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