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
62569f69
Commit
62569f69
authored
May 17, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a few warnings on Windows; fixed critical bugs in cvMixChannels and AutoBuffer<>.
parent
306a11a7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
15 deletions
+22
-15
operations.hpp
modules/core/include/opencv2/core/operations.hpp
+4
-5
convert.cpp
modules/core/src/convert.cpp
+9
-1
stat.cpp
modules/core/src/stat.cpp
+5
-5
matchers.cpp
modules/features2d/src/matchers.cpp
+1
-1
contours.cpp
modules/imgproc/src/contours.cpp
+3
-3
No files found.
modules/core/include/opencv2/core/operations.hpp
View file @
62569f69
...
...
@@ -2311,13 +2311,13 @@ inline Point LineIterator::pos() const
template
<
typename
_Tp
,
size_t
fixed_size
>
inline
AutoBuffer
<
_Tp
,
fixed_size
>::
AutoBuffer
()
{
ptr
=
alignPtr
(
buf
,
16
)
;
ptr
=
buf
;
size
=
fixed_size
;
}
template
<
typename
_Tp
,
size_t
fixed_size
>
inline
AutoBuffer
<
_Tp
,
fixed_size
>::
AutoBuffer
(
size_t
_size
)
{
ptr
=
alignPtr
(
buf
,
16
)
;
ptr
=
buf
;
size
=
fixed_size
;
allocate
(
_size
);
}
...
...
@@ -2339,11 +2339,10 @@ template<typename _Tp, size_t fixed_size> inline void AutoBuffer<_Tp, fixed_size
template
<
typename
_Tp
,
size_t
fixed_size
>
inline
void
AutoBuffer
<
_Tp
,
fixed_size
>::
deallocate
()
{
_Tp
*
buf0
=
alignPtr
(
buf
,
16
);
if
(
ptr
!=
buf0
)
if
(
ptr
!=
buf
)
{
cv
::
deallocate
<
_Tp
>
(
ptr
,
size
);
ptr
=
buf
0
;
ptr
=
buf
;
size
=
fixed_size
;
}
}
...
...
modules/core/src/convert.cpp
View file @
62569f69
...
...
@@ -1130,11 +1130,19 @@ cvMixChannels( const CvArr** src, int src_count,
CvArr
**
dst
,
int
dst_count
,
const
int
*
from_to
,
int
pair_count
)
{
cv
::
AutoBuffer
<
cv
::
Mat
,
32
>
buf
;
cv
::
AutoBuffer
<
cv
::
Mat
,
32
>
buf
(
src_count
+
dst_count
)
;
int
i
;
for
(
i
=
0
;
i
<
src_count
;
i
++
)
{
printf
(
"%d. %p "
,
i
,
src
[
i
]);
if
(
src
[
i
]
)
{
CvMat
m
,
*
pm
=
cvGetMat
(
src
[
i
],
&
m
);
printf
(
"%d x %d, type = %d
\n
"
,
pm
->
rows
,
pm
->
cols
,
CV_MAT_TYPE
(
pm
->
type
));
}
buf
[
i
]
=
cv
::
cvarrToMat
(
src
[
i
]);
}
for
(
i
=
0
;
i
<
dst_count
;
i
++
)
buf
[
i
+
src_count
]
=
cv
::
cvarrToMat
(
dst
[
i
]);
cv
::
mixChannels
(
&
buf
[
0
],
src_count
,
&
buf
[
src_count
],
dst_count
,
from_to
,
pair_count
);
...
...
modules/core/src/stat.cpp
View file @
62569f69
...
...
@@ -60,7 +60,7 @@ template<typename T> static inline Scalar rawToScalar(const T& v)
\****************************************************************************************/
template
<
typename
T
,
typename
ST
>
static
size_
t
sum_
(
const
T
*
src0
,
const
uchar
*
mask
,
ST
*
dst
,
int
len
,
int
cn
)
static
in
t
sum_
(
const
T
*
src0
,
const
uchar
*
mask
,
ST
*
dst
,
int
len
,
int
cn
)
{
const
T
*
src
=
src0
;
if
(
!
mask
)
...
...
@@ -537,7 +537,7 @@ void cv::meanStdDev( const InputArray& _src, OutputArray _mean, OutputArray _sdv
const
Mat
*
arrays
[]
=
{
&
src
,
&
mask
,
0
};
uchar
*
ptrs
[
2
];
NAryMatIterator
it
(
arrays
,
ptrs
);
int
total
=
it
.
size
,
blockSize
=
total
,
intSumBlockSize
=
0
;
int
total
=
(
int
)
it
.
size
,
blockSize
=
total
,
intSumBlockSize
=
0
;
int
j
,
count
=
0
,
nz0
=
0
;
AutoBuffer
<
double
>
_buf
(
cn
*
4
);
double
*
s
=
(
double
*
)
_buf
,
*
sq
=
s
+
cn
;
...
...
@@ -954,11 +954,11 @@ normDiffL2_(const T* src1, const T* src2, const uchar* mask, ST* _result, int le
#define CV_DEF_NORM_FUNC(L, suffix, type, ntype) \
static int norm##L##_##suffix(const type* src, const uchar* mask, ntype* r,
size_
t len, int cn) \
static int norm##L##_##suffix(const type* src, const uchar* mask, ntype* r,
in
t len, int cn) \
{ return norm##L##_(src, mask, r, len, cn); } \
static int normDiff##L##_##suffix(const type* src1, const type* src2, \
const uchar* mask, ntype* r,
size_
t len, int cn) \
{ return normDiff##L##_(src1, src2, mask, r, len, cn); }
const uchar* mask, ntype* r,
in
t len, int cn) \
{ return normDiff##L##_(src1, src2, mask, r,
(int)
len, cn); }
#define CV_DEF_NORM_ALL(suffix, type, inftype, l1type, l2type) \
CV_DEF_NORM_FUNC(Inf, suffix, type, inftype) \
...
...
modules/features2d/src/matchers.cpp
View file @
62569f69
...
...
@@ -162,7 +162,7 @@ void DescriptorMatcher::DescriptorCollection::getLocalIdx( int globalDescIdx, in
CV_Assert
(
(
globalDescIdx
>=
0
)
&&
(
globalDescIdx
<
size
())
);
std
::
vector
<
int
>::
const_iterator
img_it
=
std
::
upper_bound
(
startIdxs
.
begin
(),
startIdxs
.
end
(),
globalDescIdx
);
--
img_it
;
imgIdx
=
img_it
-
startIdxs
.
begin
(
);
imgIdx
=
(
int
)(
img_it
-
startIdxs
.
begin
()
);
localDescIdx
=
globalDescIdx
-
(
*
img_it
);
}
...
...
modules/imgproc/src/contours.cpp
View file @
62569f69
...
...
@@ -1485,14 +1485,14 @@ void cv::findContours( const InputOutputArray _image, OutputArrayOfArrays _conto
return
;
}
Seq
<
CvSeq
*>
all_contours
(
cvTreeToNodeSeq
(
_ccontours
,
sizeof
(
CvSeq
),
storage
));
size_t
i
,
total
=
all_contours
.
size
();
int
i
,
total
=
(
int
)
all_contours
.
size
();
_contours
.
create
(
total
,
1
,
0
,
-
1
,
true
);
SeqIterator
<
CvSeq
*>
it
=
all_contours
.
begin
();
for
(
i
=
0
;
i
<
total
;
i
++
,
++
it
)
{
CvSeq
*
c
=
*
it
;
((
CvContour
*
)
c
)
->
color
=
(
int
)
i
;
_contours
.
create
(
c
->
total
,
1
,
CV_32SC2
,
i
,
true
);
_contours
.
create
(
(
int
)
c
->
total
,
1
,
CV_32SC2
,
i
,
true
);
Mat
ci
=
_contours
.
getMat
(
i
);
CV_Assert
(
ci
.
isContinuous
()
);
cvCvtSeqToArray
(
c
,
ci
.
data
);
...
...
@@ -1583,7 +1583,7 @@ void cv::drawContours( InputOutputArray _image, const InputArrayOfArrays& _conto
for
(
i
=
first
;
i
<
last
;
i
++
)
{
Mat
ci
=
_contours
.
getMat
(
i
);
Mat
ci
=
_contours
.
getMat
(
(
int
)
i
);
if
(
ci
.
empty
()
)
continue
;
int
npoints
=
ci
.
checkVector
(
2
,
CV_32S
);
...
...
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