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
fbc4d82f
Commit
fbc4d82f
authored
Apr 24, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
parents
309edb59
d6bbcd68
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
29 additions
and
67 deletions
+29
-67
or_pascal.cpp
modules/datasets/src/or_pascal.cpp
+0
-1
face_alignment.cpp
modules/face/src/face_alignment.cpp
+3
-4
facemark.cpp
modules/face/src/facemark.cpp
+1
-2
lbph_faces.cpp
modules/face/src/lbph_faces.cpp
+1
-3
regtree.cpp
modules/face/src/regtree.cpp
+4
-8
trainFacemark.cpp
modules/face/src/trainFacemark.cpp
+9
-18
binary_descriptor.cpp
modules/line_descriptor/src/binary_descriptor.cpp
+2
-7
linemod.cpp
modules/rgbd/src/linemod.cpp
+0
-1
gtrTracker.cpp
modules/tracking/src/gtrTracker.cpp
+1
-1
tracker.cpp
modules/tracking/src/tracker.cpp
+0
-1
trackerBoostingModel.cpp
modules/tracking/src/trackerBoostingModel.cpp
+0
-1
trackerFeature.cpp
modules/tracking/src/trackerFeature.cpp
+0
-1
trackerMILModel.cpp
modules/tracking/src/trackerMILModel.cpp
+0
-1
trackerModel.cpp
modules/tracking/src/trackerModel.cpp
+0
-1
trackerSamplerAlgorithm.cpp
modules/tracking/src/trackerSamplerAlgorithm.cpp
+0
-1
trackerStateEstimator.cpp
modules/tracking/src/trackerStateEstimator.cpp
+0
-1
bagofwords_classification.cpp
modules/xfeatures2d/samples/bagofwords_classification.cpp
+2
-5
distance.hpp
modules/xfeatures2d/src/pct_signatures/distance.hpp
+1
-3
similarity.hpp
modules/xfeatures2d/src/pct_signatures/similarity.hpp
+1
-3
surf.cuda.cpp
modules/xfeatures2d/src/surf.cuda.cpp
+1
-1
disparity_filters.cpp
modules/ximgproc/src/disparity_filters.cpp
+0
-1
weighted_median_filter.cpp
modules/ximgproc/src/weighted_median_filter.cpp
+3
-2
No files found.
modules/datasets/src/or_pascal.cpp
View file @
fbc4d82f
...
...
@@ -143,7 +143,6 @@ Ptr<Object> OR_pascalImp::parseAnnotation(const string &path, const string &id)
case
XML_ERROR_FILE_NOT_FOUND
:
error_message
=
"XML file not found! "
+
error_message
;
CV_Error
(
Error
::
StsParseError
,
error_message
);
return
annotation
;
default
:
CV_Error
(
Error
::
StsParseError
,
error_message
);
break
;
...
...
modules/face/src/face_alignment.cpp
View file @
fbc4d82f
...
...
@@ -79,8 +79,7 @@ bool FacemarkKazemiImpl::convertToUnit(Rect r,Mat &warp){
bool
FacemarkKazemiImpl
::
setMeanExtreme
(){
if
(
meanshape
.
empty
()){
String
error_message
=
"Model not loaded properly.No mean shape found.Aborting..."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
for
(
size_t
i
=
0
;
i
<
meanshape
.
size
();
i
++
){
if
(
meanshape
[
i
].
x
>
maxmeanx
)
...
...
@@ -98,7 +97,7 @@ bool FacemarkKazemiImpl::calcMeanShape (vector< vector<Point2f> >& trainlandmark
//clear the loaded meanshape
if
(
trainimages
.
empty
()
||
trainlandmarks
.
size
()
!=
trainimages
.
size
())
{
// throw error if no data (or simply return -1?)
CV_Error
NoReturn
(
Error
::
StsBadArg
,
"Number of images is not equal to corresponding landmarks. Aborting..."
);
CV_Error
(
Error
::
StsBadArg
,
"Number of images is not equal to corresponding landmarks. Aborting..."
);
}
meanshape
.
clear
();
vector
<
Mat
>
finalimages
;
...
...
@@ -165,7 +164,7 @@ bool FacemarkKazemiImpl::scaleData( vector< vector<Point2f> > & trainlandmarks,
{
if
(
trainimages
.
empty
()
||
trainimages
.
size
()
!=
trainlandmarks
.
size
()){
// throw error if no data (or simply return -1?)
CV_Error
NoReturn
(
Error
::
StsBadArg
,
"The data is not loaded properly by train function. Aborting..."
);
CV_Error
(
Error
::
StsBadArg
,
"The data is not loaded properly by train function. Aborting..."
);
}
float
scalex
,
scaley
;
//scale all images and their landmarks according to input size
...
...
modules/face/src/facemark.cpp
View file @
fbc4d82f
...
...
@@ -228,8 +228,7 @@ bool loadTrainingData(vector<String> filename,vector< vector<Point2f> >
f1
.
open
(
filename
[
j
].
c_str
(),
ios
::
in
);
if
(
!
f1
.
is_open
()){
cout
<<
filename
[
j
]
<<
endl
;
CV_ErrorNoReturn
(
Error
::
StsError
,
"File can't be opened for reading!"
);
return
false
;
CV_Error
(
Error
::
StsError
,
"File can't be opened for reading!"
);
}
//get the path of the image whose landmarks have to be detected
getline
(
f1
,
img
);
...
...
modules/face/src/lbph_faces.cpp
View file @
fbc4d82f
...
...
@@ -307,10 +307,8 @@ static Mat histc(InputArray _src, int minVal, int maxVal, bool normed)
case
CV_32FC1
:
return
histc_
(
src
,
minVal
,
maxVal
,
normed
);
break
;
default
:
CV_Error
(
Error
::
StsUnmatchedFormats
,
"This type is not implemented yet."
);
break
;
}
return
Mat
(
);
CV_Error
(
Error
::
StsUnmatchedFormats
,
"This type is not implemented yet."
);
}
...
...
modules/face/src/regtree.cpp
View file @
fbc4d82f
...
...
@@ -113,8 +113,7 @@ bool FacemarkKazemiImpl:: getBestSplit(vector<Point2f> pixel_coordinates, vector
{
if
(
samples
[
0
].
shapeResiduals
.
size
()
!=
samples
[
0
].
current_shape
.
size
()){
String
error_message
=
"Error while generating split.Residuals are not complete.Aborting...."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
//This vector stores the matrices where each matrix represents
//sum of the residuals of shapes of samples which go to the left
...
...
@@ -222,13 +221,11 @@ bool FacemarkKazemiImpl :: generateSplit(queue<node_info>& curr,vector<Point2f>
bool
FacemarkKazemiImpl
::
buildRegtree
(
regtree
&
tree
,
vector
<
training_sample
>&
samples
,
vector
<
Point2f
>
pixel_coordinates
){
if
(
samples
.
size
()
==
0
){
String
error_message
=
"Error while building regression tree.Empty samples. Aborting...."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
if
(
pixel_coordinates
.
size
()
==
0
){
String
error_message
=
"Error while building regression tree.No pixel coordinates. Aborting...."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
queue
<
node_info
>
curr
;
node_info
parent
;
...
...
@@ -291,8 +288,7 @@ unsigned long FacemarkKazemiImpl::divideSamples (splitr split,vector<training_sa
{
if
(
samples
.
size
()
==
0
){
String
error_message
=
"Error while dividing samples. Sample array empty. Aborting...."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
0
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
unsigned
long
i
=
start
;
training_sample
temp
;
...
...
modules/face/src/trainFacemark.cpp
View file @
fbc4d82f
...
...
@@ -54,8 +54,7 @@ bool FacemarkKazemiImpl::setTrainingParameters(String filename){
fs
.
open
(
filename
,
FileStorage
::
READ
);
if
(
!
fs
.
isOpened
())
{
String
error_message
=
"Error while opening configuration file.Aborting.."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
int
cascade_depth_
;
int
tree_depth_
;
...
...
@@ -105,8 +104,7 @@ unsigned long FacemarkKazemiImpl:: getNearestLandmark(Point2f pixel)
if
(
meanshape
.
empty
())
{
// throw error if no data (or simply return -1?)
String
error_message
=
"The data is not loaded properly by train function. Aborting..."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
float
dist
=
float
(
INT_MAX
);
unsigned
long
index
=
0
;
...
...
@@ -122,8 +120,7 @@ unsigned long FacemarkKazemiImpl:: getNearestLandmark(Point2f pixel)
bool
FacemarkKazemiImpl
::
getRelativePixels
(
vector
<
Point2f
>
sample
,
vector
<
Point2f
>&
pixel_coordinates
,
std
::
vector
<
int
>
nearest
){
if
(
sample
.
size
()
!=
meanshape
.
size
()){
String
error_message
=
"Error while finding relative shape. Aborting...."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
Mat
transform_mat
;
transform_mat
=
estimateRigidTransform
(
meanshape
,
sample
,
false
);
...
...
@@ -146,8 +143,7 @@ bool FacemarkKazemiImpl :: getRelativePixels(vector<Point2f> sample,vector<Point
bool
FacemarkKazemiImpl
::
getPixelIntensities
(
Mat
img
,
vector
<
Point2f
>
pixel_coordinates
,
vector
<
int
>&
pixel_intensities
,
Rect
face
){
if
(
pixel_coordinates
.
size
()
==
0
){
String
error_message
=
"No pixel coordinates found. Aborting....."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
Mat
transform_mat
;
convertToActual
(
face
,
transform_mat
);
...
...
@@ -259,13 +255,11 @@ bool FacemarkKazemiImpl :: saveModel(String filename){
ofstream
f
(
filename
.
c_str
(),
ios
::
binary
);
if
(
!
f
.
is_open
()){
String
error_message
=
"Error while opening file to write model. Aborting...."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
if
(
loaded_forests
.
size
()
!=
loaded_pixel_coordinates
.
size
()){
String
error_message
=
"Incorrect training data. Aborting...."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
string
s
(
"cascade_depth"
);
uint64_t
len
=
s
.
size
();
...
...
@@ -306,14 +300,12 @@ void FacemarkKazemiImpl::training(String imageList, String groundTruth){
imageList
.
clear
();
groundTruth
.
clear
();
String
error_message
=
"Less arguments than required"
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
bool
FacemarkKazemiImpl
::
training
(
vector
<
Mat
>&
images
,
vector
<
vector
<
Point2f
>
>&
landmarks
,
string
filename
,
Size
scale
,
string
modelFilename
){
if
(
!
setTrainingParameters
(
filename
)){
String
error_message
=
"Error while loading training parameters"
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
vector
<
Rect
>
rectangles
;
scaleData
(
landmarks
,
images
,
scale
);
...
...
@@ -321,8 +313,7 @@ bool FacemarkKazemiImpl::training(vector<Mat>& images, vector< vector<Point2f> >
if
(
images
.
size
()
!=
landmarks
.
size
()){
// throw error if no data (or simply return -1?)
String
error_message
=
"The data is not loaded properly. Aborting training function...."
;
CV_ErrorNoReturn
(
Error
::
StsBadArg
,
error_message
);
return
false
;
CV_Error
(
Error
::
StsBadArg
,
error_message
);
}
vector
<
training_sample
>
samples
;
getTestCoordinates
();
...
...
modules/line_descriptor/src/binary_descriptor.cpp
View file @
fbc4d82f
...
...
@@ -337,13 +337,8 @@ int BinaryDescriptor::descriptorSize() const
/* power function with error management */
static
inline
int
get2Pow
(
int
i
)
{
if
(
i
>=
0
&&
i
<=
7
)
return
1
<<
i
;
else
{
CV_Error
(
Error
::
StsBadArg
,
"Invalid power argument"
);
return
-
1
;
}
CV_DbgAssert
(
i
>=
0
&&
i
<=
7
);
return
1
<<
i
;
}
/* compute Gaussian pyramids */
...
...
modules/rgbd/src/linemod.cpp
View file @
fbc4d82f
...
...
@@ -66,7 +66,6 @@ static inline int getLabel(int quantized)
case
128
:
return
7
;
default
:
CV_Error
(
Error
::
StsBadArg
,
"Invalid value of quantized parameter"
);
return
-
1
;
//avoid warning
}
}
...
...
modules/tracking/src/gtrTracker.cpp
View file @
fbc4d82f
...
...
@@ -58,7 +58,7 @@ Ptr<TrackerGOTURN> TrackerGOTURN::create(const TrackerGOTURN::Params ¶meters
return
Ptr
<
gtr
::
TrackerGOTURNImpl
>
(
new
gtr
::
TrackerGOTURNImpl
(
parameters
));
#else
(
void
)(
parameters
);
CV_Error
NoReturn
(
cv
::
Error
::
StsNotImplemented
,
"to use GOTURN, the tracking module needs to be built with opencv_dnn !"
);
CV_Error
(
cv
::
Error
::
StsNotImplemented
,
"to use GOTURN, the tracking module needs to be built with opencv_dnn !"
);
#endif
}
Ptr
<
TrackerGOTURN
>
TrackerGOTURN
::
create
()
...
...
modules/tracking/src/tracker.cpp
View file @
fbc4d82f
...
...
@@ -73,7 +73,6 @@ bool Tracker::init( InputArray image, const Rect2d& boundingBox )
if
(
model
==
0
)
{
CV_Error
(
-
1
,
"The model is not initialized"
);
return
false
;
}
if
(
initTracker
)
...
...
modules/tracking/src/trackerBoostingModel.cpp
View file @
fbc4d82f
...
...
@@ -89,7 +89,6 @@ void TrackerBoostingModel::responseToConfidenceMap( const std::vector<Mat>& resp
if
(
currentSample
.
empty
()
)
{
CV_Error
(
-
1
,
"The samples in Model estimation are empty"
);
return
;
}
for
(
size_t
i
=
0
;
i
<
currentSample
.
size
();
i
++
)
...
...
modules/tracking/src/trackerFeature.cpp
View file @
fbc4d82f
...
...
@@ -90,7 +90,6 @@ Ptr<TrackerFeature> TrackerFeature::create( const String& trackerFeatureType )
}
CV_Error
(
-
1
,
"Tracker feature type not supported"
);
return
Ptr
<
TrackerFeature
>
();
}
String
TrackerFeature
::
getClassName
()
const
...
...
modules/tracking/src/trackerMILModel.cpp
View file @
fbc4d82f
...
...
@@ -67,7 +67,6 @@ void TrackerMILModel::responseToConfidenceMap( const std::vector<Mat>& responses
if
(
currentSample
.
empty
()
)
{
CV_Error
(
-
1
,
"The samples in Model estimation are empty"
);
return
;
}
for
(
size_t
i
=
0
;
i
<
responses
.
size
();
i
++
)
...
...
modules/tracking/src/trackerModel.cpp
View file @
fbc4d82f
...
...
@@ -112,7 +112,6 @@ bool TrackerModel::runStateEstimator()
if
(
stateEstimator
==
0
)
{
CV_Error
(
-
1
,
"Tracker state estimator is not setted"
);
return
false
;
}
Ptr
<
TrackerTargetState
>
targetState
=
stateEstimator
->
estimate
(
confidenceMaps
);
if
(
targetState
==
0
)
...
...
modules/tracking/src/trackerSamplerAlgorithm.cpp
View file @
fbc4d82f
...
...
@@ -83,7 +83,6 @@ Ptr<TrackerSamplerAlgorithm> TrackerSamplerAlgorithm::create( const String& trac
}
CV_Error
(
-
1
,
"Tracker sampler algorithm type not supported"
);
return
Ptr
<
TrackerSamplerAlgorithm
>
();
}
String
TrackerSamplerAlgorithm
::
getClassName
()
const
...
...
modules/tracking/src/trackerStateEstimator.cpp
View file @
fbc4d82f
...
...
@@ -85,7 +85,6 @@ Ptr<TrackerStateEstimator> TrackerStateEstimator::create( const String& trackeSt
}
CV_Error
(
-
1
,
"Tracker state estimator type not supported"
);
return
Ptr
<
TrackerStateEstimator
>
();
}
String
TrackerStateEstimator
::
getClassName
()
const
...
...
modules/xfeatures2d/samples/bagofwords_classification.cpp
View file @
fbc4d82f
...
...
@@ -1794,12 +1794,9 @@ bool VocData::getClassifierGroundTruthImage(const string& obj_class, const strin
{
//image found, so return corresponding ground truth
return
m_classifier_gt_all_present
[
std
::
distance
(
m_classifier_gt_all_ids
.
begin
(),
it
)]
!=
0
;
}
else
{
string
err_msg
=
"could not find classifier ground truth for image '"
+
id
+
"' and class '"
+
obj_class
+
"'"
;
CV_Error
(
Error
::
StsError
,
err_msg
.
c_str
());
}
return
true
;
string
err_msg
=
"could not find classifier ground truth for image '"
+
id
+
"' and class '"
+
obj_class
+
"'"
;
CV_Error
(
Error
::
StsError
,
err_msg
.
c_str
())
;
}
//-------------------------------------------------------------------
...
...
modules/xfeatures2d/src/pct_signatures/distance.hpp
View file @
fbc4d82f
...
...
@@ -204,10 +204,8 @@ namespace cv
return
distanceL5
(
points1
,
idx1
,
points2
,
idx2
);
case
PCTSignatures
:
:
L_INFINITY
:
return
distanceLInfinity
(
points1
,
idx1
,
points2
,
idx2
);
default
:
CV_Error
(
Error
::
StsBadArg
,
"Distance function not implemented!"
);
return
-
1
;
}
CV_Error
(
Error
::
StsBadArg
,
"Distance function not implemented!"
);
}
}
}
...
...
modules/xfeatures2d/src/pct_signatures/similarity.hpp
View file @
fbc4d82f
...
...
@@ -117,10 +117,8 @@ namespace cv
return
gaussianSimilarity
(
distancefunction
,
similarityParameter
,
points1
,
idx1
,
points2
,
idx2
);
case
PCTSignatures
:
:
HEURISTIC
:
return
heuristicSimilarity
(
distancefunction
,
similarityParameter
,
points1
,
idx1
,
points2
,
idx2
);
default
:
CV_Error
(
Error
::
StsNotImplemented
,
"Similarity function not implemented!"
);
return
-
1
;
}
CV_Error
(
Error
::
StsNotImplemented
,
"Similarity function not implemented!"
);
}
}
}
...
...
modules/xfeatures2d/src/surf.cuda.cpp
View file @
fbc4d82f
...
...
@@ -51,7 +51,7 @@ using namespace cv::cuda;
cv
::
cuda
::
SURF_CUDA
::
SURF_CUDA
()
{
throw_no_cuda
();
}
cv
::
cuda
::
SURF_CUDA
::
SURF_CUDA
(
double
,
int
,
int
,
bool
,
float
,
bool
)
{
throw_no_cuda
();
}
int
cv
::
cuda
::
SURF_CUDA
::
descriptorSize
()
const
{
throw_no_cuda
();
return
0
;
}
int
cv
::
cuda
::
SURF_CUDA
::
descriptorSize
()
const
{
throw_no_cuda
();
}
void
cv
::
cuda
::
SURF_CUDA
::
uploadKeypoints
(
const
std
::
vector
<
KeyPoint
>&
,
GpuMat
&
)
{
throw_no_cuda
();
}
void
cv
::
cuda
::
SURF_CUDA
::
downloadKeypoints
(
const
GpuMat
&
,
std
::
vector
<
KeyPoint
>&
)
{
throw_no_cuda
();
}
void
cv
::
cuda
::
SURF_CUDA
::
downloadDescriptors
(
const
GpuMat
&
,
std
::
vector
<
float
>&
)
{
throw_no_cuda
();
}
...
...
modules/ximgproc/src/disparity_filters.cpp
View file @
fbc4d82f
...
...
@@ -480,7 +480,6 @@ Ptr<StereoMatcher> createRightMatcher(Ptr<StereoMatcher> matcher_left)
else
{
CV_Error
(
Error
::
StsBadArg
,
"createRightMatcher supports only StereoBM and StereoSGBM"
);
return
Ptr
<
StereoMatcher
>
();
}
}
...
...
modules/ximgproc/src/weighted_median_filter.cpp
View file @
fbc4d82f
...
...
@@ -56,6 +56,7 @@ void from32FTo32S(Mat &img, Mat &outImg, int nI, float *mapping)
{
int
rows
=
img
.
rows
,
cols
=
img
.
cols
;
size_t
alls
=
(
size_t
)
rows
*
cols
;
CV_Assert
(
alls
<
INT_MAX
);
CV_Assert
(
img
.
isContinuous
());
float
*
imgPtr
=
img
.
ptr
<
float
>
();
...
...
@@ -66,7 +67,7 @@ void from32FTo32S(Mat &img, Mat &outImg, int nI, float *mapping)
for
(
size_t
i
=
0
;
i
<
alls
;
i
++
)
{
pairFI
&
d
=
data
[
i
];
d
.
second
=
i
;
d
.
second
=
(
int
)
i
;
d
.
first
=
imgPtr
[
i
];
}
...
...
@@ -128,7 +129,7 @@ void from32FTo32S(Mat &img, Mat &outImg, int nI, float *mapping)
mapping
[
cnt
]
=
data
[(
baseI
+
i
-
1
)
>>
1
].
first
;
//median
cnt
++
;
base
=
data
[
i
].
first
;
baseI
=
i
;
baseI
=
(
int
)
i
;
}
retImgPtr
[
data
[
i
].
second
]
=
cnt
;
}
...
...
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