Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
addf0309
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
addf0309
编写于
3月 26, 2013
作者:
A
Andrey Kamaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move cv::Size_
上级
13b31b08
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
70 addition
and
63 deletion
+70
-63
modules/core/include/opencv2/core.hpp
modules/core/include/opencv2/core.hpp
+0
-38
modules/core/include/opencv2/core/operations.hpp
modules/core/include/opencv2/core/operations.hpp
+0
-8
modules/core/include/opencv2/core/types.hpp
modules/core/include/opencv2/core/types.hpp
+38
-0
modules/core/include/opencv2/core/types_c.h
modules/core/include/opencv2/core/types_c.h
+16
-0
modules/core/src/array.cpp
modules/core/src/array.cpp
+1
-1
modules/highgui/src/utils.cpp
modules/highgui/src/utils.cpp
+1
-1
modules/legacy/src/optflowbm.cpp
modules/legacy/src/optflowbm.cpp
+2
-3
modules/legacy/src/pyrsegmentation.cpp
modules/legacy/src/pyrsegmentation.cpp
+2
-2
modules/legacy/src/testseq.cpp
modules/legacy/src/testseq.cpp
+2
-2
modules/legacy/src/vecfacetracking.cpp
modules/legacy/src/vecfacetracking.cpp
+1
-1
modules/legacy/test/test_pyrsegmentation.cpp
modules/legacy/test/test_pyrsegmentation.cpp
+1
-1
modules/objdetect/src/haar.cpp
modules/objdetect/src/haar.cpp
+6
-6
未找到文件。
modules/core/include/opencv2/core.hpp
浏览文件 @
addf0309
...
@@ -524,41 +524,6 @@ typedef Vec<double, 4> Vec4d;
...
@@ -524,41 +524,6 @@ typedef Vec<double, 4> Vec4d;
typedef
Vec
<
double
,
6
>
Vec6d
;
typedef
Vec
<
double
,
6
>
Vec6d
;
//////////////////////////////// Size_ ////////////////////////////////
/*!
The 2D size class
The class represents the size of a 2D rectangle, image size, matrix size etc.
Normally, cv::Size ~ cv::Size_<int> is used.
*/
template
<
typename
_Tp
>
class
CV_EXPORTS
Size_
{
public:
typedef
_Tp
value_type
;
//! various constructors
Size_
();
Size_
(
_Tp
_width
,
_Tp
_height
);
Size_
(
const
Size_
&
sz
);
Size_
(
const
CvSize
&
sz
);
Size_
(
const
CvSize2D32f
&
sz
);
Size_
(
const
Point_
<
_Tp
>&
pt
);
Size_
&
operator
=
(
const
Size_
&
sz
);
//! the area (width*height)
_Tp
area
()
const
;
//! conversion of another data type.
template
<
typename
_Tp2
>
operator
Size_
<
_Tp2
>
()
const
;
//! conversion to the old-style OpenCV types
operator
CvSize
()
const
;
operator
CvSize2D32f
()
const
;
_Tp
width
,
height
;
// the width and the height
};
//////////////////////////////// Rect_ ////////////////////////////////
//////////////////////////////// Rect_ ////////////////////////////////
/*!
/*!
...
@@ -608,10 +573,7 @@ public:
...
@@ -608,10 +573,7 @@ public:
shorter aliases for the most popular cv::Point_<>, cv::Size_<> and cv::Rect_<> specializations
shorter aliases for the most popular cv::Point_<>, cv::Size_<> and cv::Rect_<> specializations
*/
*/
typedef
Size_
<
int
>
Size2i
;
typedef
Size2i
Size
;
typedef
Rect_
<
int
>
Rect
;
typedef
Rect_
<
int
>
Rect
;
typedef
Size_
<
float
>
Size2f
;
/*!
/*!
...
...
modules/core/include/opencv2/core/operations.hpp
浏览文件 @
addf0309
...
@@ -1754,18 +1754,10 @@ template<typename _Tp> inline Size_<_Tp>::Size_(_Tp _width, _Tp _height)
...
@@ -1754,18 +1754,10 @@ template<typename _Tp> inline Size_<_Tp>::Size_(_Tp _width, _Tp _height)
:
width
(
_width
),
height
(
_height
)
{}
:
width
(
_width
),
height
(
_height
)
{}
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>::
Size_
(
const
Size_
&
sz
)
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>::
Size_
(
const
Size_
&
sz
)
:
width
(
sz
.
width
),
height
(
sz
.
height
)
{}
:
width
(
sz
.
width
),
height
(
sz
.
height
)
{}
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>::
Size_
(
const
CvSize
&
sz
)
:
width
(
saturate_cast
<
_Tp
>
(
sz
.
width
)),
height
(
saturate_cast
<
_Tp
>
(
sz
.
height
))
{}
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>::
Size_
(
const
CvSize2D32f
&
sz
)
:
width
(
saturate_cast
<
_Tp
>
(
sz
.
width
)),
height
(
saturate_cast
<
_Tp
>
(
sz
.
height
))
{}
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>::
Size_
(
const
Point_
<
_Tp
>&
pt
)
:
width
(
pt
.
x
),
height
(
pt
.
y
)
{}
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>::
Size_
(
const
Point_
<
_Tp
>&
pt
)
:
width
(
pt
.
x
),
height
(
pt
.
y
)
{}
template
<
typename
_Tp
>
template
<
typename
_Tp2
>
inline
Size_
<
_Tp
>::
operator
Size_
<
_Tp2
>
()
const
template
<
typename
_Tp
>
template
<
typename
_Tp2
>
inline
Size_
<
_Tp
>::
operator
Size_
<
_Tp2
>
()
const
{
return
Size_
<
_Tp2
>
(
saturate_cast
<
_Tp2
>
(
width
),
saturate_cast
<
_Tp2
>
(
height
));
}
{
return
Size_
<
_Tp2
>
(
saturate_cast
<
_Tp2
>
(
width
),
saturate_cast
<
_Tp2
>
(
height
));
}
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>::
operator
CvSize
()
const
{
return
cvSize
(
saturate_cast
<
int
>
(
width
),
saturate_cast
<
int
>
(
height
));
}
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>::
operator
CvSize2D32f
()
const
{
return
cvSize2D32f
((
float
)
width
,
(
float
)
height
);
}
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>&
Size_
<
_Tp
>::
operator
=
(
const
Size_
<
_Tp
>&
sz
)
template
<
typename
_Tp
>
inline
Size_
<
_Tp
>&
Size_
<
_Tp
>::
operator
=
(
const
Size_
<
_Tp
>&
sz
)
{
width
=
sz
.
width
;
height
=
sz
.
height
;
return
*
this
;
}
{
width
=
sz
.
width
;
height
=
sz
.
height
;
return
*
this
;
}
...
...
modules/core/include/opencv2/core/types.hpp
浏览文件 @
addf0309
...
@@ -246,6 +246,44 @@ typedef Point3_<int> Point3i;
...
@@ -246,6 +246,44 @@ typedef Point3_<int> Point3i;
typedef
Point3_
<
float
>
Point3f
;
typedef
Point3_
<
float
>
Point3f
;
typedef
Point3_
<
double
>
Point3d
;
typedef
Point3_
<
double
>
Point3d
;
//////////////////////////////// Size_ ////////////////////////////////
/*!
The 2D size class
The class represents the size of a 2D rectangle, image size, matrix size etc.
Normally, cv::Size ~ cv::Size_<int> is used.
*/
template
<
typename
_Tp
>
class
CV_EXPORTS
Size_
{
public:
typedef
_Tp
value_type
;
//! various constructors
Size_
();
Size_
(
_Tp
_width
,
_Tp
_height
);
Size_
(
const
Size_
&
sz
);
Size_
(
const
Point_
<
_Tp
>&
pt
);
Size_
&
operator
=
(
const
Size_
&
sz
);
//! the area (width*height)
_Tp
area
()
const
;
//! conversion of another data type.
template
<
typename
_Tp2
>
operator
Size_
<
_Tp2
>
()
const
;
_Tp
width
,
height
;
// the width and the height
};
/*!
\typedef
*/
typedef
Size_
<
int
>
Size2i
;
typedef
Size_
<
float
>
Size2f
;
typedef
Size2i
Size
;
}
// cv
}
// cv
#endif //__OPENCV_CORE_TYPES_HPP__
#endif //__OPENCV_CORE_TYPES_HPP__
\ No newline at end of file
modules/core/include/opencv2/core/types_c.h
浏览文件 @
addf0309
...
@@ -894,6 +894,14 @@ typedef struct CvSize
...
@@ -894,6 +894,14 @@ typedef struct CvSize
{
{
int
width
;
int
width
;
int
height
;
int
height
;
#ifdef __cplusplus
CvSize
(
int
w
=
0
,
int
h
=
0
)
:
width
(
w
),
height
(
h
)
{}
template
<
typename
_Tp
>
CvSize
(
const
cv
::
Size_
<
_Tp
>&
sz
)
:
width
(
cv
::
saturate_cast
<
int
>
(
sz
.
width
)),
height
(
cv
::
saturate_cast
<
int
>
(
sz
.
height
))
{}
template
<
typename
_Tp
>
operator
cv
::
Size_
<
_Tp
>
()
const
{
return
cv
::
Size_
<
_Tp
>
(
cv
::
saturate_cast
<
_Tp
>
(
width
),
cv
::
saturate_cast
<
_Tp
>
(
height
));
}
#endif
}
}
CvSize
;
CvSize
;
...
@@ -911,6 +919,14 @@ typedef struct CvSize2D32f
...
@@ -911,6 +919,14 @@ typedef struct CvSize2D32f
{
{
float
width
;
float
width
;
float
height
;
float
height
;
#ifdef __cplusplus
CvSize2D32f
(
float
w
=
0
,
float
h
=
0
)
:
width
(
w
),
height
(
h
)
{}
template
<
typename
_Tp
>
CvSize2D32f
(
const
cv
::
Size_
<
_Tp
>&
sz
)
:
width
(
cv
::
saturate_cast
<
float
>
(
sz
.
width
)),
height
(
cv
::
saturate_cast
<
float
>
(
sz
.
height
))
{}
template
<
typename
_Tp
>
operator
cv
::
Size_
<
_Tp
>
()
const
{
return
cv
::
Size_
<
_Tp
>
(
cv
::
saturate_cast
<
_Tp
>
(
width
),
cv
::
saturate_cast
<
_Tp
>
(
height
));
}
#endif
}
}
CvSize2D32f
;
CvSize2D32f
;
...
...
modules/core/src/array.cpp
浏览文件 @
addf0309
...
@@ -1210,7 +1210,7 @@ cvGetDimSize( const CvArr* arr, int index )
...
@@ -1210,7 +1210,7 @@ cvGetDimSize( const CvArr* arr, int index )
CV_IMPL
CvSize
CV_IMPL
CvSize
cvGetSize
(
const
CvArr
*
arr
)
cvGetSize
(
const
CvArr
*
arr
)
{
{
CvSize
size
=
{
0
,
0
}
;
CvSize
size
;
if
(
CV_IS_MAT_HDR_Z
(
arr
))
if
(
CV_IS_MAT_HDR_Z
(
arr
))
{
{
...
...
modules/highgui/src/utils.cpp
浏览文件 @
addf0309
...
@@ -641,7 +641,7 @@ cvConvertImage( const CvArr* srcarr, CvArr* dstarr, int flags )
...
@@ -641,7 +641,7 @@ cvConvertImage( const CvArr* srcarr, CvArr* dstarr, int flags )
uchar
*
s
=
src
->
data
.
ptr
,
*
d
=
dst
->
data
.
ptr
;
uchar
*
s
=
src
->
data
.
ptr
,
*
d
=
dst
->
data
.
ptr
;
int
s_step
=
src
->
step
,
d_step
=
dst
->
step
;
int
s_step
=
src
->
step
,
d_step
=
dst
->
step
;
int
code
=
src_cn
*
10
+
dst_cn
;
int
code
=
src_cn
*
10
+
dst_cn
;
CvSize
size
=
{
src
->
cols
,
src
->
rows
}
;
CvSize
size
(
src
->
cols
,
src
->
rows
)
;
if
(
CV_IS_MAT_CONT
(
src
->
type
&
dst
->
type
)
)
if
(
CV_IS_MAT_CONT
(
src
->
type
&
dst
->
type
)
)
{
{
...
...
modules/legacy/src/optflowbm.cpp
浏览文件 @
addf0309
...
@@ -75,11 +75,10 @@ cvCalcOpticalFlowBM( const void* srcarrA, const void* srcarrB,
...
@@ -75,11 +75,10 @@ cvCalcOpticalFlowBM( const void* srcarrA, const void* srcarrB,
if
(
!
CV_ARE_TYPES_EQ
(
velx
,
vely
))
if
(
!
CV_ARE_TYPES_EQ
(
velx
,
vely
))
CV_Error
(
CV_StsUnmatchedFormats
,
"Destination images have different formats"
);
CV_Error
(
CV_StsUnmatchedFormats
,
"Destination images have different formats"
);
CvSize
velSize
=
CvSize
velSize
(
{
(
srcA
->
width
-
blockSize
.
width
+
shiftSize
.
width
)
/
shiftSize
.
width
,
(
srcA
->
width
-
blockSize
.
width
+
shiftSize
.
width
)
/
shiftSize
.
width
,
(
srcA
->
height
-
blockSize
.
height
+
shiftSize
.
height
)
/
shiftSize
.
height
(
srcA
->
height
-
blockSize
.
height
+
shiftSize
.
height
)
/
shiftSize
.
height
}
;
)
;
if
(
!
CV_ARE_SIZES_EQ
(
srcA
,
srcB
)
||
if
(
!
CV_ARE_SIZES_EQ
(
srcA
,
srcB
)
||
!
CV_ARE_SIZES_EQ
(
velx
,
vely
)
||
!
CV_ARE_SIZES_EQ
(
velx
,
vely
)
||
...
...
modules/legacy/src/pyrsegmentation.cpp
浏览文件 @
addf0309
...
@@ -287,7 +287,7 @@ icvPyrSegmentation8uC1R( uchar * src_image, int src_step,
...
@@ -287,7 +287,7 @@ icvPyrSegmentation8uC1R( uchar * src_image, int src_step,
/* calculate initial pyramid */
/* calculate initial pyramid */
for
(
l
=
1
;
l
<=
level
;
l
++
)
for
(
l
=
1
;
l
<=
level
;
l
++
)
{
{
CvSize
dst_size
=
{
size
.
width
/
2
+
1
,
size
.
height
/
2
+
1
}
;
CvSize
dst_size
(
size
.
width
/
2
+
1
,
size
.
height
/
2
+
1
)
;
CvMat
prev_level
=
cvMat
(
size
.
height
,
size
.
width
,
CV_32FC1
);
CvMat
prev_level
=
cvMat
(
size
.
height
,
size
.
width
,
CV_32FC1
);
CvMat
next_level
=
cvMat
(
dst_size
.
height
,
dst_size
.
width
,
CV_32FC1
);
CvMat
next_level
=
cvMat
(
dst_size
.
height
,
dst_size
.
width
,
CV_32FC1
);
...
@@ -706,7 +706,7 @@ icvPyrSegmentation8uC3R( uchar * src_image, int src_step,
...
@@ -706,7 +706,7 @@ icvPyrSegmentation8uC3R( uchar * src_image, int src_step,
/* calculate initial pyramid */
/* calculate initial pyramid */
for
(
l
=
1
;
l
<=
level
;
l
++
)
for
(
l
=
1
;
l
<=
level
;
l
++
)
{
{
CvSize
dst_size
=
{
size
.
width
/
2
+
1
,
size
.
height
/
2
+
1
}
;
CvSize
dst_size
(
size
.
width
/
2
+
1
,
size
.
height
/
2
+
1
)
;
CvMat
prev_level
=
cvMat
(
size
.
height
,
size
.
width
,
CV_32FC3
);
CvMat
prev_level
=
cvMat
(
size
.
height
,
size
.
width
,
CV_32FC3
);
CvMat
next_level
=
cvMat
(
dst_size
.
height
,
dst_size
.
width
,
CV_32FC3
);
CvMat
next_level
=
cvMat
(
dst_size
.
height
,
dst_size
.
width
,
CV_32FC3
);
...
...
modules/legacy/src/testseq.cpp
浏览文件 @
addf0309
...
@@ -850,13 +850,13 @@ CvTestSeq* cvCreateTestSeq(char* pConfigfile, char** videos, int numvideo, float
...
@@ -850,13 +850,13 @@ CvTestSeq* cvCreateTestSeq(char* pConfigfile, char** videos, int numvideo, float
{
/* Calculate elements and image size and video length: */
{
/* Calculate elements and image size and video length: */
CvTestSeqElem
*
p
=
pTS
->
pElemList
;
CvTestSeqElem
*
p
=
pTS
->
pElemList
;
int
num
=
0
;
int
num
=
0
;
CvSize
MaxSize
=
{
0
,
0
}
;
CvSize
MaxSize
;
int
MaxFN
=
0
;
int
MaxFN
=
0
;
for
(
p
=
pTS
->
pElemList
;
p
;
p
=
p
->
next
,
num
++
)
for
(
p
=
pTS
->
pElemList
;
p
;
p
=
p
->
next
,
num
++
)
{
{
int
FN
=
p
->
FrameBegin
+
p
->
FrameNum
;
int
FN
=
p
->
FrameBegin
+
p
->
FrameNum
;
CvSize
S
=
{
0
,
0
}
;
CvSize
S
;
if
(
p
->
pImg
&&
p
->
BG
)
if
(
p
->
pImg
&&
p
->
BG
)
{
{
...
...
modules/legacy/src/vecfacetracking.cpp
浏览文件 @
addf0309
...
@@ -157,7 +157,7 @@ struct CvFaceTracker
...
@@ -157,7 +157,7 @@ struct CvFaceTracker
};
};
int
InitNextImage
(
IplImage
*
img
)
int
InitNextImage
(
IplImage
*
img
)
{
{
CvSize
sz
=
{
img
->
width
,
img
->
height
}
;
CvSize
sz
(
img
->
width
,
img
->
height
)
;
ReallocImage
(
&
imgGray
,
sz
,
1
);
ReallocImage
(
&
imgGray
,
sz
,
1
);
ReallocImage
(
&
imgThresh
,
sz
,
1
);
ReallocImage
(
&
imgThresh
,
sz
,
1
);
ptRotate
=
face
[
MOUTH
].
ptCenter
;
ptRotate
=
face
[
MOUTH
].
ptCenter
;
...
...
modules/legacy/test/test_pyrsegmentation.cpp
浏览文件 @
addf0309
...
@@ -86,7 +86,7 @@ void CV_PyrSegmentationTest::run( int /*start_from*/ )
...
@@ -86,7 +86,7 @@ void CV_PyrSegmentationTest::run( int /*start_from*/ )
int
i
,
j
,
iter
;
int
i
,
j
,
iter
;
IplImage
*
image
,
*
image_f
,
*
image_s
;
IplImage
*
image
,
*
image_f
,
*
image_s
;
CvSize
size
=
{
128
,
128
}
;
CvSize
size
(
128
,
128
)
;
const
int
threshold1
=
50
,
threshold2
=
50
;
const
int
threshold1
=
50
,
threshold2
=
50
;
rect
[
1
].
width
=
size
.
width
;
rect
[
1
].
width
=
size
.
width
;
...
...
modules/objdetect/src/haar.cpp
浏览文件 @
addf0309
...
@@ -1569,10 +1569,10 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
...
@@ -1569,10 +1569,10 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
for
(
factor
=
1
;
;
factor
*=
scaleFactor
)
for
(
factor
=
1
;
;
factor
*=
scaleFactor
)
{
{
CvSize
winSize
=
{
cvRound
(
winSize0
.
width
*
factor
),
CvSize
winSize
(
cvRound
(
winSize0
.
width
*
factor
),
cvRound
(
winSize0
.
height
*
factor
)
}
;
cvRound
(
winSize0
.
height
*
factor
)
)
;
CvSize
sz
=
{
cvRound
(
img
->
cols
/
factor
),
cvRound
(
img
->
rows
/
factor
)
}
;
CvSize
sz
(
cvRound
(
img
->
cols
/
factor
),
cvRound
(
img
->
rows
/
factor
))
;
CvSize
sz1
=
{
sz
.
width
-
winSize0
.
width
+
1
,
sz
.
height
-
winSize0
.
height
+
1
}
;
CvSize
sz1
(
sz
.
width
-
winSize0
.
width
+
1
,
sz
.
height
-
winSize0
.
height
+
1
)
;
CvRect
equRect
=
{
icv_object_win_border
,
icv_object_win_border
,
CvRect
equRect
=
{
icv_object_win_border
,
icv_object_win_border
,
winSize0
.
width
-
icv_object_win_border
*
2
,
winSize0
.
width
-
icv_object_win_border
*
2
,
...
@@ -1656,8 +1656,8 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
...
@@ -1656,8 +1656,8 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
for
(
;
n_factors
--
>
0
;
factor
*=
scaleFactor
)
for
(
;
n_factors
--
>
0
;
factor
*=
scaleFactor
)
{
{
const
double
ystep
=
std
::
max
(
2.
,
factor
);
const
double
ystep
=
std
::
max
(
2.
,
factor
);
CvSize
winSize
=
{
cvRound
(
cascade
->
orig_window_size
.
width
*
factor
),
CvSize
winSize
(
cvRound
(
cascade
->
orig_window_size
.
width
*
factor
),
cvRound
(
cascade
->
orig_window_size
.
height
*
factor
)
}
;
cvRound
(
cascade
->
orig_window_size
.
height
*
factor
)
)
;
CvRect
equRect
=
{
0
,
0
,
0
,
0
};
CvRect
equRect
=
{
0
,
0
,
0
,
0
};
int
*
p
[
4
]
=
{
0
,
0
,
0
,
0
};
int
*
p
[
4
]
=
{
0
,
0
,
0
,
0
};
int
*
pq
[
4
]
=
{
0
,
0
,
0
,
0
};
int
*
pq
[
4
]
=
{
0
,
0
,
0
,
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录