Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
2dc981aa
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
2dc981aa
编写于
5月 18, 2011
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed bug with possible memory corruption in CvMat m = iarray.getMat(); expressions (ticket #1054)
上级
d998c737
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
61 addition
and
40 deletion
+61
-40
modules/calib3d/src/calibinit.cpp
modules/calib3d/src/calibinit.cpp
+2
-2
modules/calib3d/src/calibration.cpp
modules/calib3d/src/calibration.cpp
+24
-15
modules/calib3d/src/fundam.cpp
modules/calib3d/src/fundam.cpp
+2
-2
modules/calib3d/src/solvepnp.cpp
modules/calib3d/src/solvepnp.cpp
+2
-1
modules/highgui/src/window.cpp
modules/highgui/src/window.cpp
+3
-2
modules/imgproc/src/cornersubpix.cpp
modules/imgproc/src/cornersubpix.cpp
+2
-1
modules/imgproc/src/hough.cpp
modules/imgproc/src/hough.cpp
+6
-3
modules/imgproc/src/inpaint.cpp
modules/imgproc/src/inpaint.cpp
+2
-2
modules/imgproc/src/moments.cpp
modules/imgproc/src/moments.cpp
+2
-1
modules/imgproc/src/segmentation.cpp
modules/imgproc/src/segmentation.cpp
+3
-2
modules/video/src/camshift.cpp
modules/video/src/camshift.cpp
+5
-3
modules/video/src/lkpyramid.cpp
modules/video/src/lkpyramid.cpp
+4
-4
modules/video/src/motempl.cpp
modules/video/src/motempl.cpp
+4
-2
未找到文件。
modules/calib3d/src/calibinit.cpp
浏览文件 @
2dc981aa
...
...
@@ -1899,7 +1899,7 @@ bool cv::findChessboardCorners( const InputArray& _image, Size patternSize,
{
int
count
=
patternSize
.
area
()
*
2
;
vector
<
Point2f
>
tmpcorners
(
count
+
1
);
CvMat
c_image
=
_image
.
getMat
()
;
Mat
image
=
_image
.
getMat
();
CvMat
c_image
=
image
;
bool
ok
=
cvFindChessboardCorners
(
&
c_image
,
patternSize
,
(
CvPoint2D32f
*
)
&
tmpcorners
[
0
],
&
count
,
flags
)
>
0
;
if
(
count
>
0
)
...
...
@@ -1919,7 +1919,7 @@ void cv::drawChessboardCorners( InputOutputArray _image, Size patternSize,
Mat
corners
=
_corners
.
getMat
();
if
(
corners
.
empty
()
)
return
;
CvMat
c_image
=
_image
.
getMat
();
Mat
image
=
_image
.
getMat
();
CvMat
c_image
=
_image
.
getMat
();
int
nelems
=
corners
.
checkVector
(
2
,
CV_32F
,
true
);
CV_Assert
(
nelems
>=
0
);
cvDrawChessboardCorners
(
&
c_image
,
patternSize
,
(
CvPoint2D32f
*
)
corners
.
data
,
...
...
modules/calib3d/src/calibration.cpp
浏览文件 @
2dc981aa
...
...
@@ -3294,11 +3294,14 @@ void cv::projectPoints( const InputArray& _opoints,
CvMat
*
pdpdrot
=
0
,
*
pdpdt
=
0
,
*
pdpdf
=
0
,
*
pdpdc
=
0
,
*
pdpddist
=
0
;
_ipoints
.
create
(
npoints
,
1
,
CV_MAKETYPE
(
depth
,
2
),
-
1
,
true
);
CvMat
imagePoints
=
_ipoints
.
getMat
();
CvMat
objectPoints
=
opoints
;
CvMat
cameraMatrix
=
_cameraMatrix
.
getMat
();
CvMat
rvec
=
_rvec
.
getMat
(),
tvec
=
_tvec
.
getMat
();
CvMat
distCoeffs
=
_distCoeffs
.
getMat
();
CvMat
c_imagePoints
=
_ipoints
.
getMat
();
CvMat
c_objectPoints
=
opoints
;
Mat
cameraMatrix
=
_cameraMatrix
.
getMat
();
Mat
distCoeffs
=
_distCoeffs
.
getMat
();
Mat
rvec
=
_rvec
.
getMat
(),
tvec
=
_tvec
.
getMat
();
CvMat
c_cameraMatrix
=
cameraMatrix
;
CvMat
c_rvec
=
rvec
,
c_tvec
=
tvec
;
CvMat
c_distCoeffs
=
distCoeffs
;
int
ndistCoeffs
=
distCoeffs
.
rows
+
distCoeffs
.
cols
-
1
;
if
(
_jacobian
.
needed
()
)
...
...
@@ -3312,8 +3315,8 @@ void cv::projectPoints( const InputArray& _opoints,
pdpddist
=
&
(
dpddist
=
jacobian
.
colRange
(
10
,
10
+
ndistCoeffs
));
}
cvProjectPoints2
(
&
objectPoints
,
&
rvec
,
&
tvec
,
&
cameraMatrix
,
&
distCoeffs
,
&
imagePoints
,
pdpdrot
,
pdpdt
,
pdpdf
,
pdpdc
,
pdpddist
,
aspectRatio
);
cvProjectPoints2
(
&
c_objectPoints
,
&
c_rvec
,
&
c_tvec
,
&
c_cameraMatrix
,
&
c_
distCoeffs
,
&
c_
imagePoints
,
pdpdrot
,
pdpdt
,
pdpdf
,
pdpdc
,
pdpddist
,
aspectRatio
);
}
cv
::
Mat
cv
::
initCameraMatrix2D
(
const
InputArrayOfArrays
&
objectPoints
,
...
...
@@ -3378,7 +3381,8 @@ void cv::calibrationMatrixValues( const InputArray& _cameraMatrix, Size imageSiz
double
&
fovx
,
double
&
fovy
,
double
&
focalLength
,
Point2d
&
principalPoint
,
double
&
aspectRatio
)
{
CvMat
c_cameraMatrix
=
_cameraMatrix
.
getMat
();
Mat
cameraMatrix
=
_cameraMatrix
.
getMat
();
CvMat
c_cameraMatrix
=
cameraMatrix
;
cvCalibrationMatrixValues
(
&
c_cameraMatrix
,
imageSize
,
apertureWidth
,
apertureHeight
,
&
fovx
,
&
fovy
,
&
focalLength
,
(
CvPoint2D64f
*
)
&
principalPoint
,
&
aspectRatio
);
}
...
...
@@ -3453,11 +3457,14 @@ void cv::stereoRectify( const InputArray& _cameraMatrix1, const InputArray& _dis
double
alpha
,
Size
newImageSize
,
Rect
*
validPixROI1
,
Rect
*
validPixROI2
)
{
CvMat
c_cameraMatrix1
=
_cameraMatrix1
.
getMat
();
CvMat
c_cameraMatrix2
=
_cameraMatrix2
.
getMat
();
CvMat
c_distCoeffs1
=
_distCoeffs1
.
getMat
();
CvMat
c_distCoeffs2
=
_distCoeffs2
.
getMat
();
CvMat
c_R
=
_Rmat
.
getMat
(),
c_T
=
_Tmat
.
getMat
();
Mat
cameraMatrix1
=
_cameraMatrix1
.
getMat
(),
cameraMatrix2
=
_cameraMatrix2
.
getMat
();
Mat
distCoeffs1
=
_distCoeffs1
.
getMat
(),
distCoeffs2
=
_distCoeffs2
.
getMat
();
Mat
Rmat
=
_Rmat
.
getMat
(),
Tmat
=
_Tmat
.
getMat
();
CvMat
c_cameraMatrix1
=
cameraMatrix1
;
CvMat
c_cameraMatrix2
=
cameraMatrix2
;
CvMat
c_distCoeffs1
=
distCoeffs1
;
CvMat
c_distCoeffs2
=
distCoeffs2
;
CvMat
c_R
=
Rmat
,
c_T
=
Tmat
;
int
rtype
=
CV_64F
;
_Rmat1
.
create
(
3
,
3
,
rtype
);
...
...
@@ -3486,7 +3493,8 @@ bool cv::stereoRectifyUncalibrated( const InputArray& _points1, const InputArray
_Hmat1
.
create
(
3
,
3
,
rtype
);
_Hmat2
.
create
(
3
,
3
,
rtype
);
Mat
F
=
_Fmat
.
getMat
();
CvMat
c_pt1
=
_points1
.
getMat
(),
c_pt2
=
_points2
.
getMat
();
Mat
points1
=
_points1
.
getMat
(),
points2
=
_points2
.
getMat
();
CvMat
c_pt1
=
points1
,
c_pt2
=
points2
;
CvMat
c_F
,
*
p_F
=
0
,
c_H1
=
_Hmat1
.
getMat
(),
c_H2
=
_Hmat2
.
getMat
();
if
(
F
.
size
()
==
Size
(
3
,
3
)
)
p_F
=
&
(
c_F
=
F
);
...
...
@@ -3498,7 +3506,8 @@ cv::Mat cv::getOptimalNewCameraMatrix( const InputArray& _cameraMatrix,
Size
imgSize
,
double
alpha
,
Size
newImgSize
,
Rect
*
validPixROI
)
{
CvMat
c_cameraMatrix
=
_cameraMatrix
.
getMat
(),
c_distCoeffs
=
_distCoeffs
.
getMat
();
Mat
cameraMatrix
=
_cameraMatrix
.
getMat
(),
distCoeffs
=
_distCoeffs
.
getMat
();
CvMat
c_cameraMatrix
=
cameraMatrix
,
c_distCoeffs
=
distCoeffs
;
Mat
newCameraMatrix
(
3
,
3
,
CV_MAT_TYPE
(
c_cameraMatrix
.
type
));
CvMat
c_newCameraMatrix
=
newCameraMatrix
;
...
...
modules/calib3d/src/fundam.cpp
浏览文件 @
2dc981aa
...
...
@@ -1106,12 +1106,12 @@ cv::Mat cv::findFundamentalMat( const InputArray& _points1, const InputArray& _p
void
cv
::
computeCorrespondEpilines
(
const
InputArray
&
_points
,
int
whichImage
,
const
InputArray
&
_Fmat
,
OutputArray
_lines
)
{
Mat
points
=
_points
.
getMat
();
Mat
points
=
_points
.
getMat
()
,
F
=
_Fmat
.
getMat
()
;
int
npoints
=
points
.
checkVector
(
2
);
CV_Assert
(
npoints
>=
0
&&
(
points
.
depth
()
==
CV_32F
||
points
.
depth
()
==
CV_32S
));
_lines
.
create
(
npoints
,
1
,
CV_32FC3
,
-
1
,
true
);
CvMat
c_points
=
points
,
c_lines
=
_lines
.
getMat
(),
c_F
=
_Fmat
.
getMat
()
;
CvMat
c_points
=
points
,
c_lines
=
_lines
.
getMat
(),
c_F
=
F
;
cvComputeCorrespondEpilines
(
&
c_points
,
whichImage
,
&
c_F
,
&
c_lines
);
}
...
...
modules/calib3d/src/solvepnp.cpp
浏览文件 @
2dc981aa
...
...
@@ -53,8 +53,9 @@ void cv::solvePnP( const InputArray& _opoints, const InputArray& _ipoints,
_rvec
.
create
(
3
,
1
,
CV_64F
);
_tvec
.
create
(
3
,
1
,
CV_64F
);
Mat
cameraMatrix
=
_cameraMatrix
.
getMat
(),
distCoeffs
=
_distCoeffs
.
getMat
();
CvMat
c_objectPoints
=
opoints
,
c_imagePoints
=
ipoints
;
CvMat
c_cameraMatrix
=
_cameraMatrix
.
getMat
(),
c_distCoeffs
=
_distCoeffs
.
getMat
()
;
CvMat
c_cameraMatrix
=
cameraMatrix
,
c_distCoeffs
=
distCoeffs
;
CvMat
c_rvec
=
_rvec
.
getMat
(),
c_tvec
=
_tvec
.
getMat
();
cvFindExtrinsicCameraParams2
(
&
c_objectPoints
,
&
c_imagePoints
,
&
c_cameraMatrix
,
c_distCoeffs
.
rows
*
c_distCoeffs
.
cols
?
&
c_distCoeffs
:
0
,
...
...
modules/highgui/src/window.cpp
浏览文件 @
2dc981aa
...
...
@@ -146,9 +146,10 @@ double cv::getWindowProperty(const string& winname, int prop_id)
return
cvGetWindowProperty
(
winname
.
c_str
(),
prop_id
);
}
void
cv
::
imshow
(
const
string
&
winname
,
const
InputArray
&
img
)
void
cv
::
imshow
(
const
string
&
winname
,
const
InputArray
&
_
img
)
{
CvMat
c_img
=
img
.
getMat
();
Mat
img
=
_img
.
getMat
();
CvMat
c_img
=
img
;
cvShowImage
(
winname
.
c_str
(),
&
c_img
);
}
...
...
modules/imgproc/src/cornersubpix.cpp
浏览文件 @
2dc981aa
...
...
@@ -261,7 +261,8 @@ void cv::cornerSubPix( const InputArray& _image, InputOutputArray _corners,
Mat
corners
=
_corners
.
getMat
();
int
ncorners
=
corners
.
checkVector
(
2
);
CV_Assert
(
ncorners
>=
0
&&
corners
.
depth
()
==
CV_32F
);
CvMat
c_image
=
_image
.
getMat
();
Mat
image
=
_image
.
getMat
();
CvMat
c_image
=
image
;
cvFindCornerSubPix
(
&
c_image
,
(
CvPoint2D32f
*
)
corners
.
data
,
ncorners
,
winSize
,
zeroZone
,
criteria
);
...
...
modules/imgproc/src/hough.cpp
浏览文件 @
2dc981aa
...
...
@@ -1109,7 +1109,8 @@ void cv::HoughLines( const InputArray& _image, OutputArray _lines,
double
srn
,
double
stn
)
{
Ptr
<
CvMemStorage
>
storage
=
cvCreateMemStorage
(
STORAGE_SIZE
);
CvMat
c_image
=
_image
.
getMat
();
Mat
image
=
_image
.
getMat
();
CvMat
c_image
=
image
;
CvSeq
*
seq
=
cvHoughLines2
(
&
c_image
,
storage
,
srn
==
0
&&
stn
==
0
?
CV_HOUGH_STANDARD
:
CV_HOUGH_MULTI_SCALE
,
rho
,
theta
,
threshold
,
srn
,
stn
);
...
...
@@ -1121,7 +1122,8 @@ void cv::HoughLinesP( const InputArray& _image, OutputArray _lines,
double
minLineLength
,
double
maxGap
)
{
Ptr
<
CvMemStorage
>
storage
=
cvCreateMemStorage
(
STORAGE_SIZE
);
CvMat
c_image
=
_image
.
getMat
();
Mat
image
=
_image
.
getMat
();
CvMat
c_image
=
image
;
CvSeq
*
seq
=
cvHoughLines2
(
&
c_image
,
storage
,
CV_HOUGH_PROBABILISTIC
,
rho
,
theta
,
threshold
,
minLineLength
,
maxGap
);
seqToMat
(
seq
,
_lines
);
...
...
@@ -1133,7 +1135,8 @@ void cv::HoughCircles( const InputArray& _image, OutputArray _circles,
int
minRadius
,
int
maxRadius
)
{
Ptr
<
CvMemStorage
>
storage
=
cvCreateMemStorage
(
STORAGE_SIZE
);
CvMat
c_image
=
_image
.
getMat
();
Mat
image
=
_image
.
getMat
();
CvMat
c_image
=
image
;
CvSeq
*
seq
=
cvHoughCircles
(
&
c_image
,
storage
,
method
,
dp
,
min_dist
,
param1
,
param2
,
minRadius
,
maxRadius
);
seqToMat
(
seq
,
_circles
);
...
...
modules/imgproc/src/inpaint.cpp
浏览文件 @
2dc981aa
...
...
@@ -810,8 +810,8 @@ cvInpaint( const CvArr* _input_img, const CvArr* _inpaint_mask, CvArr* _output_i
void
cv
::
inpaint
(
const
InputArray
&
_src
,
const
InputArray
&
_mask
,
OutputArray
_dst
,
double
inpaintRange
,
int
flags
)
{
Mat
src
=
_src
.
getMat
();
Mat
src
=
_src
.
getMat
()
,
mask
=
_mask
.
getMat
()
;
_dst
.
create
(
src
.
size
(),
src
.
type
()
);
CvMat
c_src
=
src
,
c_mask
=
_mask
.
getMat
()
,
c_dst
=
_dst
.
getMat
();
CvMat
c_src
=
src
,
c_mask
=
mask
,
c_dst
=
_dst
.
getMat
();
cvInpaint
(
&
c_src
,
&
c_mask
,
&
c_dst
,
inpaintRange
,
flags
);
}
modules/imgproc/src/moments.cpp
浏览文件 @
2dc981aa
...
...
@@ -607,7 +607,8 @@ Moments::operator CvMoments() const
cv
::
Moments
cv
::
moments
(
const
InputArray
&
_array
,
bool
binaryImage
)
{
CvMoments
om
;
CvMat
c_array
=
_array
.
getMat
();
Mat
arr
=
_array
.
getMat
();
CvMat
c_array
=
arr
;
cvMoments
(
&
c_array
,
&
om
,
binaryImage
);
return
om
;
}
...
...
modules/imgproc/src/segmentation.cpp
浏览文件 @
2dc981aa
...
...
@@ -303,9 +303,10 @@ cvWatershed( const CvArr* srcarr, CvArr* dstarr )
}
void
cv
::
watershed
(
const
InputArray
&
src
,
InputOutputArray
markers
)
void
cv
::
watershed
(
const
InputArray
&
_
src
,
InputOutputArray
markers
)
{
CvMat
c_src
=
src
.
getMat
(),
c_markers
=
markers
.
getMat
();
Mat
src
=
_src
.
getMat
();
CvMat
c_src
=
_src
.
getMat
(),
c_markers
=
markers
.
getMat
();
cvWatershed
(
&
c_src
,
&
c_markers
);
}
...
...
modules/video/src/camshift.cpp
浏览文件 @
2dc981aa
...
...
@@ -291,11 +291,12 @@ cvCamShift( const void* imgProb, CvRect windowIn,
cv
::
RotatedRect
cv
::
CamShift
(
const
InputArray
&
_probImage
,
Rect
&
window
,
TermCriteria
criteria
)
TermCriteria
criteria
)
{
CvConnectedComp
comp
;
CvBox2D
box
;
CvMat
c_probImage
=
_probImage
.
getMat
();
Mat
probImage
=
_probImage
.
getMat
();
CvMat
c_probImage
=
probImage
;
cvCamShift
(
&
c_probImage
,
window
,
(
CvTermCriteria
)
criteria
,
&
comp
,
&
box
);
window
=
comp
.
rect
;
return
RotatedRect
(
Point2f
(
box
.
center
),
Size2f
(
box
.
size
),
box
.
angle
);
...
...
@@ -304,7 +305,8 @@ cv::RotatedRect cv::CamShift( const InputArray& _probImage, Rect& window,
int
cv
::
meanShift
(
const
InputArray
&
_probImage
,
Rect
&
window
,
TermCriteria
criteria
)
{
CvConnectedComp
comp
;
CvMat
c_probImage
=
_probImage
.
getMat
();
Mat
probImage
=
_probImage
.
getMat
();
CvMat
c_probImage
=
probImage
;
int
iters
=
cvMeanShift
(
&
c_probImage
,
window
,
(
CvTermCriteria
)
criteria
,
&
comp
);
window
=
comp
.
rect
;
return
iters
;
...
...
modules/video/src/lkpyramid.cpp
浏览文件 @
2dc981aa
...
...
@@ -1865,12 +1865,12 @@ cvEstimateRigidTransform( const CvArr* matA, const CvArr* matB, CvMat* matM, int
return
1
;
}
cv
::
Mat
cv
::
estimateRigidTransform
(
const
InputArray
&
A
,
const
InputArray
&
B
,
cv
::
Mat
cv
::
estimateRigidTransform
(
const
InputArray
&
src1
,
const
InputArray
&
src2
,
bool
fullAffine
)
{
Mat
M
(
2
,
3
,
CV_64F
);
CvMat
matA
=
A
.
getMat
(),
matB
=
B
.
getMat
()
,
matM
=
M
;
Mat
M
(
2
,
3
,
CV_64F
)
,
A
=
src1
.
getMat
(),
B
=
src2
.
getMat
()
;
CvMat
matA
=
A
,
matB
=
B
,
matM
=
M
;
cvEstimateRigidTransform
(
&
matA
,
&
matB
,
&
matM
,
fullAffine
);
return
M
;
}
...
...
modules/video/src/motempl.cpp
浏览文件 @
2dc981aa
...
...
@@ -445,7 +445,8 @@ cvSegmentMotion( const CvArr* mhiimg, CvArr* segmask, CvMemStorage* storage,
void
cv
::
updateMotionHistory
(
const
InputArray
&
_silhouette
,
InputOutputArray
_mhi
,
double
timestamp
,
double
duration
)
{
CvMat
c_silhouette
=
_silhouette
.
getMat
(),
c_mhi
=
_mhi
.
getMat
();
Mat
silhouette
=
_silhouette
.
getMat
();
CvMat
c_silhouette
=
silhouette
,
c_mhi
=
_mhi
.
getMat
();
cvUpdateMotionHistory
(
&
c_silhouette
,
&
c_mhi
,
timestamp
,
duration
);
}
...
...
@@ -465,7 +466,8 @@ double cv::calcGlobalOrientation( const InputArray& _orientation, const InputArr
const
InputArray
&
_mhi
,
double
timestamp
,
double
duration
)
{
CvMat
c_orientation
=
_orientation
.
getMat
(),
c_mask
=
_mask
.
getMat
(),
c_mhi
=
_mhi
.
getMat
();
Mat
orientation
=
_orientation
.
getMat
(),
mask
=
_mask
.
getMat
(),
mhi
=
_mhi
.
getMat
();
CvMat
c_orientation
=
orientation
,
c_mask
=
mask
,
c_mhi
=
mhi
;
return
cvCalcGlobalOrientation
(
&
c_orientation
,
&
c_mask
,
&
c_mhi
,
timestamp
,
duration
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录