Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
8e67f0ba
Commit
8e67f0ba
authored
Dec 09, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5774 from mshabunin:coverity_fixes
parents
05531cd7
2cda78ff
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
44 additions
and
15 deletions
+44
-15
test_descriptors_regression.cpp
modules/features2d/test/test_descriptors_regression.cpp
+2
-1
grfmt_exr.cpp
modules/imgcodecs/src/grfmt_exr.cpp
+5
-0
grfmt_jpeg.cpp
modules/imgcodecs/src/grfmt_jpeg.cpp
+5
-1
jpeg_exif.cpp
modules/imgcodecs/src/jpeg_exif.cpp
+7
-1
jpeg_exif.hpp
modules/imgcodecs/src/jpeg_exif.hpp
+2
-0
drawing.cpp
modules/imgproc/src/drawing.cpp
+4
-4
test_goodfeaturetotrack.cpp
modules/imgproc/test/test_goodfeaturetotrack.cpp
+1
-2
tonemap.cpp
modules/photo/src/tonemap.cpp
+5
-2
stitcher.cpp
modules/stitching/src/stitcher.cpp
+5
-0
tvl1flow.cpp
modules/video/src/tvl1flow.cpp
+8
-4
No files found.
modules/features2d/test/test_descriptors_regression.cpp
View file @
8e67f0ba
...
...
@@ -162,7 +162,8 @@ protected:
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
);
}
image
.
create
(
50
,
50
,
CV_8UC3
);
RNG
rng
;
image
=
cvtest
::
randomMat
(
rng
,
Size
(
50
,
50
),
CV_8UC3
,
0
,
255
,
false
);
try
{
dextractor
->
compute
(
image
,
keypoints
,
descriptors
);
...
...
modules/imgcodecs/src/grfmt_exr.cpp
View file @
8e67f0ba
...
...
@@ -381,6 +381,11 @@ bool ExrDecoder::readData( Mat& img )
close
();
if
(
!
m_native_depth
||
(
!
color
&&
m_iscolor
))
{
delete
[]
buffer
;
}
return
result
;
}
...
...
modules/imgcodecs/src/grfmt_jpeg.cpp
View file @
8e67f0ba
...
...
@@ -270,7 +270,11 @@ int JpegDecoder::getOrientation()
ExifReader
reader
(
m_filename
);
if
(
reader
.
parse
()
)
{
orientation
=
reader
.
getTag
(
ORIENTATION
).
field_u16
;
//orientation is unsigned short, so check field_u16
ExifEntry_t
entry
=
reader
.
getTag
(
ORIENTATION
);
if
(
entry
.
tag
!=
INVALID_TAG
)
{
orientation
=
entry
.
field_u16
;
//orientation is unsigned short, so check field_u16
}
}
return
orientation
;
...
...
modules/imgcodecs/src/jpeg_exif.cpp
View file @
8e67f0ba
...
...
@@ -52,10 +52,16 @@ namespace {
namespace
cv
{
ExifEntry_t
::
ExifEntry_t
()
:
field_float
(
0
),
field_double
(
0
),
field_u32
(
0
),
field_s32
(
0
),
tag
(
INVALID_TAG
),
field_u16
(
0
),
field_s16
(
0
),
field_u8
(
0
),
field_s8
(
0
)
{
}
/**
* @brief ExifReader constructor
*/
ExifReader
::
ExifReader
(
std
::
string
filename
)
:
m_filename
(
filename
)
ExifReader
::
ExifReader
(
std
::
string
filename
)
:
m_filename
(
filename
)
,
m_format
(
NONE
)
{
}
...
...
modules/imgcodecs/src/jpeg_exif.hpp
View file @
8e67f0ba
...
...
@@ -111,6 +111,8 @@ typedef std::pair<uint32_t, uint32_t> u_rational_t;
*/
struct
ExifEntry_t
{
ExifEntry_t
();
std
::
vector
<
u_rational_t
>
field_u_rational
;
///< vector of rational fields
std
::
string
field_str
;
///< any kind of textual information
...
...
modules/imgproc/src/drawing.cpp
View file @
8e67f0ba
...
...
@@ -2331,10 +2331,10 @@ static void addChildContour(InputArrayOfArrays contours,
int
h_next
=
hierarchy
[
i
][
0
],
h_prev
=
hierarchy
[
i
][
1
],
v_next
=
hierarchy
[
i
][
2
],
v_prev
=
hierarchy
[
i
][
3
];
seq
[
i
].
h_next
=
(
size_t
)
h_next
<
ncontours
?
&
seq
[
h_next
]
:
0
;
seq
[
i
].
h_prev
=
(
size_t
)
h_prev
<
ncontours
?
&
seq
[
h_prev
]
:
0
;
seq
[
i
].
v_next
=
(
size_t
)
v_next
<
ncontours
?
&
seq
[
v_next
]
:
0
;
seq
[
i
].
v_prev
=
(
size_t
)
v_prev
<
ncontours
?
&
seq
[
v_prev
]
:
0
;
seq
[
i
].
h_next
=
(
0
<=
h_next
&&
h_next
<
(
int
)
ncontours
)
?
&
seq
[
h_next
]
:
0
;
seq
[
i
].
h_prev
=
(
0
<=
h_prev
&&
h_prev
<
(
int
)
ncontours
)
?
&
seq
[
h_prev
]
:
0
;
seq
[
i
].
v_next
=
(
0
<=
v_next
&&
v_next
<
(
int
)
ncontours
)
?
&
seq
[
v_next
]
:
0
;
seq
[
i
].
v_prev
=
(
0
<=
v_prev
&&
v_prev
<
(
int
)
ncontours
)
?
&
seq
[
v_prev
]
:
0
;
if
(
v_next
>=
0
)
addChildContour
(
contours
,
ncontours
,
hierarchy
,
v_next
,
seq
,
block
);
...
...
modules/imgproc/test/test_goodfeaturetotrack.cpp
View file @
8e67f0ba
...
...
@@ -320,7 +320,6 @@ protected:
void
run_func
();
int
validate_test_results
(
int
test_case_idx
);
int
aperture_size
;
Mat
src
,
src_gray
;
Mat
src_gray32f
,
src_gray8U
;
Mat
mask
;
...
...
@@ -348,7 +347,7 @@ CV_GoodFeatureToTTest::CV_GoodFeatureToTTest()
k
=
0.04
;
mask
=
Mat
();
test_case_count
=
4
;
SrcType
=
0
;
}
int
CV_GoodFeatureToTTest
::
prepare_test_case
(
int
test_case_idx
)
...
...
modules/photo/src/tonemap.cpp
View file @
8e67f0ba
...
...
@@ -510,8 +510,11 @@ protected:
void
calculateSum
(
std
::
vector
<
Mat
>&
x_contrast
,
std
::
vector
<
Mat
>&
y_contrast
,
Mat
&
sum
)
{
sum
=
Mat
::
zeros
(
x_contrast
[
x_contrast
.
size
()
-
1
].
size
(),
CV_32F
);
for
(
int
i
=
(
int
)
x_contrast
.
size
()
-
1
;
i
>=
0
;
i
--
)
if
(
x_contrast
.
empty
())
return
;
const
int
last
=
(
int
)
x_contrast
.
size
()
-
1
;
sum
=
Mat
::
zeros
(
x_contrast
[
last
].
size
(),
CV_32F
);
for
(
int
i
=
last
;
i
>=
0
;
i
--
)
{
Mat
grad_x
,
grad_y
;
getGradient
(
x_contrast
[
i
],
grad_x
,
1
);
...
...
modules/stitching/src/stitcher.cpp
View file @
8e67f0ba
...
...
@@ -82,6 +82,11 @@ Stitcher Stitcher::createDefault(bool try_use_gpu)
stitcher
.
setExposureCompensator
(
makePtr
<
detail
::
BlocksGainCompensator
>
());
stitcher
.
setBlender
(
makePtr
<
detail
::
MultiBandBlender
>
(
try_use_gpu
));
stitcher
.
work_scale_
=
1
;
stitcher
.
seam_scale_
=
1
;
stitcher
.
seam_work_aspect_
=
1
;
stitcher
.
warped_image_scale_
=
1
;
return
stitcher
;
}
...
...
modules/video/src/tvl1flow.cpp
View file @
8e67f0ba
...
...
@@ -1133,18 +1133,22 @@ void EstimateDualVariablesBody::operator() (const Range& range) const
{
const
float
g1
=
static_cast
<
float
>
(
hypot
(
u1xRow
[
x
],
u1yRow
[
x
]));
const
float
g2
=
static_cast
<
float
>
(
hypot
(
u2xRow
[
x
],
u2yRow
[
x
]));
const
float
g3
=
static_cast
<
float
>
(
hypot
(
u3xRow
[
x
],
u3yRow
[
x
]));
const
float
ng1
=
1.0
f
+
taut
*
g1
;
const
float
ng2
=
1.0
f
+
taut
*
g2
;
const
float
ng3
=
1.0
f
+
taut
*
g3
;
p11Row
[
x
]
=
(
p11Row
[
x
]
+
taut
*
u1xRow
[
x
])
/
ng1
;
p12Row
[
x
]
=
(
p12Row
[
x
]
+
taut
*
u1yRow
[
x
])
/
ng1
;
p21Row
[
x
]
=
(
p21Row
[
x
]
+
taut
*
u2xRow
[
x
])
/
ng2
;
p22Row
[
x
]
=
(
p22Row
[
x
]
+
taut
*
u2yRow
[
x
])
/
ng2
;
if
(
use_gamma
)
p31Row
[
x
]
=
(
p31Row
[
x
]
+
taut
*
u3xRow
[
x
])
/
ng3
;
if
(
use_gamma
)
p32Row
[
x
]
=
(
p32Row
[
x
]
+
taut
*
u3yRow
[
x
])
/
ng3
;
if
(
use_gamma
)
{
const
float
g3
=
static_cast
<
float
>
(
hypot
(
u3xRow
[
x
],
u3yRow
[
x
]));
const
float
ng3
=
1.0
f
+
taut
*
g3
;
p31Row
[
x
]
=
(
p31Row
[
x
]
+
taut
*
u3xRow
[
x
])
/
ng3
;
p32Row
[
x
]
=
(
p32Row
[
x
]
+
taut
*
u3yRow
[
x
])
/
ng3
;
}
}
}
}
...
...
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