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
abb211d0
Commit
abb211d0
authored
Sep 08, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid `Ptr<> == NULL` checks
parent
5c362968
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
21 additions
and
21 deletions
+21
-21
retina.cpp
modules/bioinspired/src/retina.cpp
+2
-2
odometry.cpp
modules/rgbd/src/odometry.cpp
+2
-2
erfilter.cpp
modules/text/src/erfilter.cpp
+4
-4
tracker.cpp
modules/tracking/samples/tracker.cpp
+1
-1
tracker_dataset.cpp
modules/tracking/samples/tracker_dataset.cpp
+1
-1
multiTracker.cpp
modules/tracking/src/multiTracker.cpp
+1
-1
tracker.cpp
modules/tracking/src/tracker.cpp
+1
-1
trackerFeatureSet.cpp
modules/tracking/src/trackerFeatureSet.cpp
+1
-1
trackerModel.cpp
modules/tracking/src/trackerModel.cpp
+3
-3
trackerSampler.cpp
modules/tracking/src/trackerSampler.cpp
+2
-2
test_features2d.cpp
modules/xfeatures2d/test/test_features2d.cpp
+3
-3
No files found.
modules/bioinspired/src/retina.cpp
View file @
abb211d0
...
...
@@ -562,7 +562,7 @@ bool RetinaImpl::ocl_run(InputArray inputMatToConvert)
void
RetinaImpl
::
run
(
InputArray
inputMatToConvert
)
{
CV_OCL_RUN
((
_ocl_retina
!=
0
&&
inputMatToConvert
.
isUMat
()),
ocl_run
(
inputMatToConvert
));
CV_OCL_RUN
((
_ocl_retina
&&
inputMatToConvert
.
isUMat
()),
ocl_run
(
inputMatToConvert
));
_wasOCLRunCalled
=
false
;
// first convert input image to the compatible format : std::valarray<float>
...
...
@@ -830,7 +830,7 @@ bool RetinaImpl::_convertCvMat2ValarrayBuffer(InputArray inputMat, std::valarray
void
RetinaImpl
::
clearBuffers
()
{
#ifdef HAVE_OPENCL
if
(
_ocl_retina
!=
0
)
if
(
_ocl_retina
)
_ocl_retina
->
clearBuffers
();
#endif
...
...
modules/rgbd/src/odometry.cpp
View file @
abb211d0
...
...
@@ -1055,8 +1055,8 @@ bool Odometry::compute(Ptr<OdometryFrame>& srcFrame, Ptr<OdometryFrame>& dstFram
Size
Odometry
::
prepareFrameCache
(
Ptr
<
OdometryFrame
>
&
frame
,
int
/*cacheType*/
)
const
{
if
(
frame
==
0
)
CV_Error
(
Error
::
StsBadArg
,
"Null frame pointer.
\n
"
);
if
(
!
frame
)
CV_Error
(
Error
::
StsBadArg
,
"Null frame pointer."
);
return
Size
();
}
...
...
modules/text/src/erfilter.cpp
View file @
abb211d0
...
...
@@ -665,12 +665,12 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
child
->
level
=
child
->
level
*
thresholdDelta
;
// before saving calculate P(child|character) and filter if possible
if
(
classifier
!=
NULL
)
if
(
classifier
)
{
child
->
probability
=
classifier
->
eval
(
*
child
);
}
if
(
(((
classifier
!=
NULL
)
?
(
child
->
probability
>=
minProbability
)
:
true
)
||
(
nonMaxSuppression
))
&&
if
(
(((
classifier
)
?
(
child
->
probability
>=
minProbability
)
:
true
)
||
(
nonMaxSuppression
))
&&
((
child
->
area
>=
(
minArea
*
region_mask
.
rows
*
region_mask
.
cols
))
&&
(
child
->
area
<=
(
maxArea
*
region_mask
.
rows
*
region_mask
.
cols
))
&&
(
child
->
rect
.
width
>
2
)
&&
(
child
->
rect
.
height
>
2
))
)
...
...
@@ -858,12 +858,12 @@ ERStat* ERFilterNM::er_tree_filter ( InputArray image, ERStat * stat, ERStat *pa
// calculate P(child|character) and filter if possible
if
(
(
classifier
!=
NULL
)
&&
(
stat
->
parent
!=
NULL
)
)
if
(
classifier
&&
(
stat
->
parent
!=
NULL
)
)
{
stat
->
probability
=
classifier
->
eval
(
*
stat
);
}
if
(
(
((
classifier
!=
NULL
)
?
(
stat
->
probability
>=
minProbability
)
:
true
)
&&
if
(
(
((
classifier
)
?
(
stat
->
probability
>=
minProbability
)
:
true
)
&&
((
stat
->
area
>=
minArea
*
region_mask
.
rows
*
region_mask
.
cols
)
&&
(
stat
->
area
<=
maxArea
*
region_mask
.
rows
*
region_mask
.
cols
))
)
||
(
stat
->
parent
==
NULL
)
)
...
...
modules/tracking/samples/tracker.cpp
View file @
abb211d0
...
...
@@ -93,7 +93,7 @@ int main( int argc, char** argv ){
//instantiates the specific Tracker
Ptr
<
Tracker
>
tracker
=
createTrackerByName
(
tracker_algorithm
);
if
(
tracker
==
NULL
)
if
(
!
tracker
)
{
cout
<<
"***Error in the instantiation of the tracker...***
\n
"
;
return
-
1
;
...
...
modules/tracking/samples/tracker_dataset.cpp
View file @
abb211d0
...
...
@@ -145,7 +145,7 @@ int main(int argc, char *argv[])
//Create Tracker
Ptr
<
Tracker
>
tracker
=
createTrackerByName
(
tracker_algorithm
);
if
(
tracker
==
NULL
)
if
(
!
tracker
)
{
cout
<<
"***Error in the instantiation of the tracker...***
\n
"
;
getchar
();
...
...
modules/tracking/src/multiTracker.cpp
View file @
abb211d0
...
...
@@ -47,7 +47,7 @@ namespace cv
bool
MultiTracker_Alt
::
addTarget
(
InputArray
image
,
const
Rect2d
&
boundingBox
,
Ptr
<
Tracker
>
tracker_algorithm
)
{
Ptr
<
Tracker
>
tracker
=
tracker_algorithm
;
if
(
tracker
==
NULL
)
if
(
!
tracker
)
return
false
;
if
(
!
tracker
->
init
(
image
,
boundingBox
))
...
...
modules/tracking/src/tracker.cpp
View file @
abb211d0
...
...
@@ -70,7 +70,7 @@ bool Tracker::init( InputArray image, const Rect2d& boundingBox )
bool
initTracker
=
initImpl
(
image
.
getMat
(),
boundingBox
);
//check if the model component is initialized
if
(
model
==
0
)
if
(
!
model
)
{
CV_Error
(
-
1
,
"The model is not initialized"
);
}
...
...
modules/tracking/src/trackerFeatureSet.cpp
View file @
abb211d0
...
...
@@ -101,7 +101,7 @@ bool TrackerFeatureSet::addTrackerFeature( String trackerFeatureType )
}
Ptr
<
TrackerFeature
>
feature
=
TrackerFeature
::
create
(
trackerFeatureType
);
if
(
feature
==
0
)
if
(
!
feature
)
{
return
false
;
}
...
...
modules/tracking/src/trackerModel.cpp
View file @
abb211d0
...
...
@@ -61,7 +61,7 @@ TrackerModel::~TrackerModel()
bool
TrackerModel
::
setTrackerStateEstimator
(
Ptr
<
TrackerStateEstimator
>
trackerStateEstimator
)
{
if
(
stateEstimator
!=
0
)
if
(
stateEstimator
.
get
()
)
{
return
false
;
}
...
...
@@ -109,12 +109,12 @@ void TrackerModel::modelUpdate()
bool
TrackerModel
::
runStateEstimator
()
{
if
(
stateEstimator
==
0
)
if
(
!
stateEstimator
)
{
CV_Error
(
-
1
,
"Tracker state estimator is not setted"
);
}
Ptr
<
TrackerTargetState
>
targetState
=
stateEstimator
->
estimate
(
confidenceMaps
);
if
(
targetState
==
0
)
if
(
!
targetState
)
return
false
;
setLastTargetState
(
targetState
);
...
...
modules/tracking/src/trackerSampler.cpp
View file @
abb211d0
...
...
@@ -96,7 +96,7 @@ bool TrackerSampler::addTrackerSamplerAlgorithm( String trackerSamplerAlgorithmT
}
Ptr
<
TrackerSamplerAlgorithm
>
sampler
=
TrackerSamplerAlgorithm
::
create
(
trackerSamplerAlgorithmType
);
if
(
sampler
==
0
)
if
(
!
sampler
)
{
return
false
;
}
...
...
@@ -113,7 +113,7 @@ bool TrackerSampler::addTrackerSamplerAlgorithm( Ptr<TrackerSamplerAlgorithm>& s
return
false
;
}
if
(
sampler
==
0
)
if
(
!
sampler
)
{
return
false
;
}
...
...
modules/xfeatures2d/test/test_features2d.cpp
View file @
abb211d0
...
...
@@ -262,14 +262,14 @@ TEST(Features2d_BruteForceDescriptorMatcher_knnMatch, regression)
const
int
k
=
3
;
Ptr
<
DescriptorExtractor
>
ext
=
SURF
::
create
();
ASSERT_TRUE
(
ext
!=
NULL
);
ASSERT_TRUE
(
ext
);
Ptr
<
FeatureDetector
>
det
=
SURF
::
create
();
//"%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n"
ASSERT_TRUE
(
det
!=
NULL
);
ASSERT_TRUE
(
det
);
Ptr
<
DescriptorMatcher
>
matcher
=
DescriptorMatcher
::
create
(
"BruteForce"
);
ASSERT_TRUE
(
matcher
!=
NULL
);
ASSERT_TRUE
(
matcher
);
Mat
imgT
(
256
,
256
,
CV_8U
,
Scalar
(
255
));
line
(
imgT
,
Point
(
20
,
sz
/
2
),
Point
(
sz
-
21
,
sz
/
2
),
Scalar
(
100
),
2
);
...
...
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