Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
huiyeruzhou
openpose
提交
f430a799
O
openpose
项目概览
huiyeruzhou
/
openpose
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openpose
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f430a799
编写于
4月 16, 2018
作者:
G
gineshidalgo99
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added in/extrinsics into Datum
上级
88e767ff
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
243 addition
and
5 deletion
+243
-5
doc/release_notes.md
doc/release_notes.md
+2
-1
include/openpose/3d/cameraParameterReader.hpp
include/openpose/3d/cameraParameterReader.hpp
+3
-0
include/openpose/core/datum.hpp
include/openpose/core/datum.hpp
+11
-1
include/openpose/producer/datumProducer.hpp
include/openpose/producer/datumProducer.hpp
+10
-0
include/openpose/producer/flirReader.hpp
include/openpose/producer/flirReader.hpp
+4
-0
include/openpose/producer/imageDirectoryReader.hpp
include/openpose/producer/imageDirectoryReader.hpp
+4
-0
include/openpose/producer/ipCameraReader.hpp
include/openpose/producer/ipCameraReader.hpp
+4
-0
include/openpose/producer/producer.hpp
include/openpose/producer/producer.hpp
+12
-0
include/openpose/producer/spinnakerWrapper.hpp
include/openpose/producer/spinnakerWrapper.hpp
+4
-0
include/openpose/producer/videoReader.hpp
include/openpose/producer/videoReader.hpp
+4
-0
include/openpose/producer/webcamReader.hpp
include/openpose/producer/webcamReader.hpp
+4
-0
src/openpose/3d/cameraParameterReader.cpp
src/openpose/3d/cameraParameterReader.cpp
+17
-3
src/openpose/producer/flirReader.cpp
src/openpose/producer/flirReader.cpp
+26
-0
src/openpose/producer/imageDirectoryReader.cpp
src/openpose/producer/imageDirectoryReader.cpp
+26
-0
src/openpose/producer/ipCameraReader.cpp
src/openpose/producer/ipCameraReader.cpp
+26
-0
src/openpose/producer/spinnakerWrapper.cpp
src/openpose/producer/spinnakerWrapper.cpp
+34
-0
src/openpose/producer/videoReader.cpp
src/openpose/producer/videoReader.cpp
+26
-0
src/openpose/producer/webcamReader.cpp
src/openpose/producer/webcamReader.cpp
+26
-0
未找到文件。
doc/release_notes.md
浏览文件 @
f430a799
...
...
@@ -215,7 +215,8 @@ OpenPose Library - Release Notes
1.
Main improvements:
1.
Flir cameras: Added software trigger and a dedicated thread to keep reading images to remove latency (analogously to webcamReader).
2.
3-D reconstruction: Added non-linear minimization to further improve 3-D triangulation accuracy by ~5% (Ubuntu only).
2.
CMake: All libraries as single variable (simpler to add/remove libraries).
3.
CMake: All libraries as single variable (simpler to add/remove libraries).
4.
Datum includes extrinsic and intrinsic camera parameters.
2.
Functions or parameters renamed:
1.
Removed scale parameter from hand and face rectangle extractor (causing wrong results if custom
`--output_resolution`
).
3.
Main bugs fixed:
...
...
include/openpose/3d/cameraParameterReader.hpp
浏览文件 @
f430a799
...
...
@@ -18,6 +18,8 @@ namespace op
const
std
::
vector
<
cv
::
Mat
>&
getCameraMatrices
()
const
;
const
std
::
vector
<
cv
::
Mat
>&
getCameraExtrinsics
()
const
;
const
std
::
vector
<
cv
::
Mat
>&
getCameraIntrinsics
()
const
;
const
std
::
vector
<
cv
::
Mat
>&
getCameraDistortions
()
const
;
...
...
@@ -26,6 +28,7 @@ namespace op
std
::
vector
<
std
::
string
>
mSerialNumbers
;
unsigned
long
long
mNumberCameras
;
std
::
vector
<
cv
::
Mat
>
mCameraMatrices
;
std
::
vector
<
cv
::
Mat
>
mCameraExtrinsics
;
std
::
vector
<
cv
::
Mat
>
mCameraIntrinsics
;
std
::
vector
<
cv
::
Mat
>
mCameraDistortions
;
...
...
include/openpose/core/datum.hpp
浏览文件 @
f430a799
...
...
@@ -181,10 +181,20 @@ namespace op
std
::
array
<
Array
<
float
>
,
2
>
handKeypoints3D
;
/**
* 3x4 camera matrix of the camera.
* 3x4 camera matrix of the camera
(equivalent to cameraIntrinsics * cameraExtrinsics)
.
*/
cv
::
Mat
cameraMatrix
;
/**
* 3x4 extrinsic parameters of the camera.
*/
cv
::
Mat
cameraExtrinsics
;
/**
* 3x3 intrinsic parameters of the camera.
*/
cv
::
Mat
cameraIntrinsics
;
// ---------------------------------------- Other (internal) parameters ---------------------------------------- //
/**
* Scale ratio between the input Datum::cvInputData and the net input size.
...
...
include/openpose/producer/datumProducer.hpp
浏览文件 @
f430a799
...
...
@@ -100,6 +100,8 @@ namespace op
auto
nextFrameNumber
=
(
unsigned
long
long
)
spProducer
->
get
(
CV_CAP_PROP_POS_FRAMES
);
auto
cvMats
=
spProducer
->
getFrames
();
auto
cameraMatrices
=
spProducer
->
getCameraMatrices
();
auto
cameraExtrinsics
=
spProducer
->
getCameraExtrinsics
();
auto
cameraIntrinsics
=
spProducer
->
getCameraIntrinsics
();
// Check frames are not empty
checkIfTooManyConsecutiveEmptyFrames
(
mNumberConsecutiveEmptyFrames
,
cvMats
.
empty
()
||
cvMats
[
0
].
empty
());
if
(
!
cvMats
.
empty
())
...
...
@@ -112,7 +114,11 @@ namespace op
datum
.
frameNumber
=
nextFrameNumber
;
datum
.
cvInputData
=
cvMats
[
0
];
if
(
!
cameraMatrices
.
empty
())
{
datum
.
cameraMatrix
=
cameraMatrices
[
0
];
datum
.
cameraExtrinsics
=
cameraExtrinsics
[
0
];
datum
.
cameraIntrinsics
=
cameraIntrinsics
[
0
];
}
// Image integrity
if
(
datum
.
cvInputData
.
channels
()
!=
3
)
{
...
...
@@ -139,7 +145,11 @@ namespace op
datumI
.
cvInputData
=
cvMats
[
i
];
datumI
.
cvOutputData
=
datumI
.
cvInputData
;
if
(
cameraMatrices
.
size
()
>
i
)
{
datumI
.
cameraMatrix
=
cameraMatrices
[
i
];
datumI
.
cameraExtrinsics
=
cameraExtrinsics
[
i
];
datumI
.
cameraIntrinsics
=
cameraIntrinsics
[
i
];
}
}
}
// Check producer is running
...
...
include/openpose/producer/flirReader.hpp
浏览文件 @
f430a799
...
...
@@ -24,6 +24,10 @@ namespace op
std
::
vector
<
cv
::
Mat
>
getCameraMatrices
();
std
::
vector
<
cv
::
Mat
>
getCameraExtrinsics
();
std
::
vector
<
cv
::
Mat
>
getCameraIntrinsics
();
std
::
string
getNextFrameName
();
bool
isOpened
()
const
;
...
...
include/openpose/producer/imageDirectoryReader.hpp
浏览文件 @
f430a799
...
...
@@ -29,6 +29,10 @@ namespace op
std
::
vector
<
cv
::
Mat
>
getCameraMatrices
();
std
::
vector
<
cv
::
Mat
>
getCameraExtrinsics
();
std
::
vector
<
cv
::
Mat
>
getCameraIntrinsics
();
std
::
string
getNextFrameName
();
inline
bool
isOpened
()
const
...
...
include/openpose/producer/ipCameraReader.hpp
浏览文件 @
f430a799
...
...
@@ -20,6 +20,10 @@ namespace op
std
::
vector
<
cv
::
Mat
>
getCameraMatrices
();
std
::
vector
<
cv
::
Mat
>
getCameraExtrinsics
();
std
::
vector
<
cv
::
Mat
>
getCameraIntrinsics
();
std
::
string
getNextFrameName
();
inline
double
get
(
const
int
capProperty
)
...
...
include/openpose/producer/producer.hpp
浏览文件 @
f430a799
...
...
@@ -47,6 +47,18 @@ namespace op
*/
virtual
std
::
vector
<
cv
::
Mat
>
getCameraMatrices
()
=
0
;
/**
* It retrieves and returns the camera extrinsic parameters from the frames producer.
* @return std::vector<cv::Mat> with the camera extrinsic parameters.
*/
virtual
std
::
vector
<
cv
::
Mat
>
getCameraExtrinsics
()
=
0
;
/**
* It retrieves and returns the camera intrinsic parameters from the frames producer.
* @return std::vector<cv::Mat> with the camera intrinsic parameters.
*/
virtual
std
::
vector
<
cv
::
Mat
>
getCameraIntrinsics
()
=
0
;
/**
* This function returns a unique frame name (e.g. the frame number for video, the
* frame counter for webcam, the image name for image directory reader, etc.).
...
...
include/openpose/producer/spinnakerWrapper.hpp
浏览文件 @
f430a799
...
...
@@ -23,6 +23,10 @@ namespace op
std
::
vector
<
cv
::
Mat
>
getCameraMatrices
()
const
;
std
::
vector
<
cv
::
Mat
>
getCameraExtrinsics
()
const
;
std
::
vector
<
cv
::
Mat
>
getCameraIntrinsics
()
const
;
Point
<
int
>
getResolution
()
const
;
bool
isOpened
()
const
;
...
...
include/openpose/producer/videoReader.hpp
浏览文件 @
f430a799
...
...
@@ -28,6 +28,10 @@ namespace op
std
::
vector
<
cv
::
Mat
>
getCameraMatrices
();
std
::
vector
<
cv
::
Mat
>
getCameraExtrinsics
();
std
::
vector
<
cv
::
Mat
>
getCameraIntrinsics
();
std
::
string
getNextFrameName
();
double
get
(
const
int
capProperty
);
...
...
include/openpose/producer/webcamReader.hpp
浏览文件 @
f430a799
...
...
@@ -31,6 +31,10 @@ namespace op
std
::
vector
<
cv
::
Mat
>
getCameraMatrices
();
std
::
vector
<
cv
::
Mat
>
getCameraExtrinsics
();
std
::
vector
<
cv
::
Mat
>
getCameraIntrinsics
();
std
::
string
getNextFrameName
();
double
get
(
const
int
capProperty
);
...
...
src/openpose/3d/cameraParameterReader.cpp
浏览文件 @
f430a799
...
...
@@ -111,6 +111,7 @@ namespace op
// Load parameters
mNumberCameras
=
serialNumbers
.
size
();
mCameraMatrices
.
clear
();
mCameraExtrinsics
.
clear
();
mCameraIntrinsics
.
clear
();
mCameraDistortions
.
clear
();
// log("Camera matrices:");
...
...
@@ -118,7 +119,6 @@ namespace op
{
const
auto
parameterPath
=
fileNameNoExtension
+
mSerialNumbers
.
at
(
i
);
const
auto
cameraParameters
=
loadData
(
cvMatNames
,
parameterPath
,
dataFormat
);
const
auto
&
intrinsics
=
cameraParameters
.
at
(
1
);
// Error if empty element
if
(
cameraParameters
.
empty
()
||
cameraParameters
.
at
(
0
).
empty
()
||
cameraParameters
.
at
(
1
).
empty
()
||
cameraParameters
.
at
(
2
).
empty
())
...
...
@@ -140,9 +140,10 @@ namespace op
error
(
"Error at reading the camera distortion parameters"
+
errorMessage
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
}
mCamera
Matrices
.
emplace_back
(
intrinsics
*
cameraParameters
.
at
(
0
));
mCameraIntrinsics
.
emplace_back
(
intrinsics
);
mCamera
Extrinsics
.
emplace_back
(
cameraParameters
.
at
(
0
));
mCameraIntrinsics
.
emplace_back
(
cameraParameters
.
at
(
1
)
);
mCameraDistortions
.
emplace_back
(
cameraParameters
.
at
(
2
));
mCameraMatrices
.
emplace_back
(
mCameraIntrinsics
.
back
()
*
mCameraExtrinsics
.
back
());
// log(cameraParameters.at(0));
}
// // mCameraMatrices
...
...
@@ -190,6 +191,19 @@ namespace op
}
}
const
std
::
vector
<
cv
::
Mat
>&
CameraParameterReader
::
getCameraExtrinsics
()
const
{
try
{
return
mCameraExtrinsics
;
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
mCameraExtrinsics
;
}
}
const
std
::
vector
<
cv
::
Mat
>&
CameraParameterReader
::
getCameraIntrinsics
()
const
{
try
...
...
src/openpose/producer/flirReader.cpp
浏览文件 @
f430a799
...
...
@@ -48,6 +48,32 @@ namespace op
}
}
std
::
vector
<
cv
::
Mat
>
FlirReader
::
getCameraExtrinsics
()
{
try
{
return
mSpinnakerWrapper
.
getCameraExtrinsics
();
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
vector
<
cv
::
Mat
>
FlirReader
::
getCameraIntrinsics
()
{
try
{
return
mSpinnakerWrapper
.
getCameraIntrinsics
();
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
string
FlirReader
::
getNextFrameName
()
{
try
...
...
src/openpose/producer/imageDirectoryReader.cpp
浏览文件 @
f430a799
...
...
@@ -80,6 +80,32 @@ namespace op
}
}
std
::
vector
<
cv
::
Mat
>
ImageDirectoryReader
::
getCameraExtrinsics
()
{
try
{
return
mCameraParameterReader
.
getCameraExtrinsics
();
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
vector
<
cv
::
Mat
>
ImageDirectoryReader
::
getCameraIntrinsics
()
{
try
{
return
mCameraParameterReader
.
getCameraIntrinsics
();
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
string
ImageDirectoryReader
::
getNextFrameName
()
{
try
...
...
src/openpose/producer/ipCameraReader.cpp
浏览文件 @
f430a799
...
...
@@ -25,6 +25,32 @@ namespace op
}
}
std
::
vector
<
cv
::
Mat
>
IpCameraReader
::
getCameraExtrinsics
()
{
try
{
return
{};
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
vector
<
cv
::
Mat
>
IpCameraReader
::
getCameraIntrinsics
()
{
try
{
return
{};
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
string
IpCameraReader
::
getNextFrameName
()
{
try
...
...
src/openpose/producer/spinnakerWrapper.cpp
浏览文件 @
f430a799
...
...
@@ -780,6 +780,40 @@ namespace op
}
}
std
::
vector
<
cv
::
Mat
>
SpinnakerWrapper
::
getCameraExtrinsics
()
const
{
try
{
#ifdef WITH_FLIR_CAMERA
return
upImpl
->
mCameraParameterReader
.
getCameraExtrinsics
();
#else
return
{};
#endif
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
vector
<
cv
::
Mat
>
SpinnakerWrapper
::
getCameraIntrinsics
()
const
{
try
{
#ifdef WITH_FLIR_CAMERA
return
upImpl
->
mCameraParameterReader
.
getCameraIntrinsics
();
#else
return
{};
#endif
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
Point
<
int
>
SpinnakerWrapper
::
getResolution
()
const
{
try
...
...
src/openpose/producer/videoReader.cpp
浏览文件 @
f430a799
...
...
@@ -52,6 +52,32 @@ namespace op
}
}
std
::
vector
<
cv
::
Mat
>
VideoReader
::
getCameraExtrinsics
()
{
try
{
return
mCameraParameterReader
.
getCameraExtrinsics
();
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
vector
<
cv
::
Mat
>
VideoReader
::
getCameraIntrinsics
()
{
try
{
return
mCameraParameterReader
.
getCameraIntrinsics
();
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
string
VideoReader
::
getNextFrameName
()
{
try
...
...
src/openpose/producer/webcamReader.cpp
浏览文件 @
f430a799
...
...
@@ -72,6 +72,32 @@ namespace op
}
}
std
::
vector
<
cv
::
Mat
>
WebcamReader
::
getCameraExtrinsics
()
{
try
{
return
{};
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
vector
<
cv
::
Mat
>
WebcamReader
::
getCameraIntrinsics
()
{
try
{
return
{};
}
catch
(
const
std
::
exception
&
e
)
{
error
(
e
.
what
(),
__LINE__
,
__FUNCTION__
,
__FILE__
);
return
{};
}
}
std
::
string
WebcamReader
::
getNextFrameName
()
{
try
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录