Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_38597003
opencv_contrib
提交
0b8aecd9
O
opencv_contrib
项目概览
qq_38597003
/
opencv_contrib
与 Fork 源项目一致
Fork自
OpenCV / opencv_contrib
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv_contrib
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0b8aecd9
编写于
1月 25, 2021
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2824 from tomoaki0705:fixBuildCudaOptFlow
上级
d733a801
6e52be36
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
22 deletion
+39
-22
modules/cudaoptflow/CMakeLists.txt
modules/cudaoptflow/CMakeLists.txt
+18
-16
modules/cudaoptflow/src/cuda/nvidiaOpticalFlow.cu
modules/cudaoptflow/src/cuda/nvidiaOpticalFlow.cu
+2
-0
modules/cudaoptflow/src/nvidiaOpticalFlow.cpp
modules/cudaoptflow/src/nvidiaOpticalFlow.cpp
+19
-6
未找到文件。
modules/cudaoptflow/CMakeLists.txt
浏览文件 @
0b8aecd9
...
...
@@ -8,21 +8,23 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 /wd4324 /wd4512 -Wundef -Wmissing-d
ocv_define_module
(
cudaoptflow opencv_video opencv_optflow opencv_cudaarithm opencv_cudawarping opencv_cudaimgproc OPTIONAL opencv_cudalegacy WRAP python
)
set
(
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT
"edb50da3cf849840d680249aa6dbef248ebce2ca
"
)
set
(
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5
"a73cd48b18dcc0cc8933b30796074191
"
)
set
(
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH
"
${
OpenCV_BINARY_DIR
}
/3rdparty/NVIDIAOpticalFlowSDK_2_0_Headers
"
)
ocv_download
(
FILENAME
"
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT
}
.zip"
HASH
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5
}
URL
"https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/"
DESTINATION_DIR
"
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH
}
"
STATUS NVIDIA_OPTICAL_FLOW_2_0_HEADERS_DOWNLOAD_SUCCESS
ID
"NVIDIA_OPTICAL_FLOW"
UNPACK RELATIVE_URL
)
if
(
NOT CUDA_VERSION VERSION_LESS
"10.0
"
)
set
(
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT
"edb50da3cf849840d680249aa6dbef248ebce2ca
"
)
set
(
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5
"a73cd48b18dcc0cc8933b30796074191
"
)
set
(
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH
"
${
OpenCV_BINARY_DIR
}
/3rdparty/NVIDIAOpticalFlowSDK_2_0_Headers"
)
ocv_download
(
FILENAME
"
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT
}
.zip"
HASH
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5
}
URL
"https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/"
DESTINATION_DIR
"
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH
}
"
STATUS NVIDIA_OPTICAL_FLOW_2_0_HEADERS_DOWNLOAD_SUCCESS
ID
"NVIDIA_OPTICAL_FLOW"
UNPACK RELATIVE_URL
)
if
(
NOT NVIDIA_OPTICAL_FLOW_2_0_HEADERS_DOWNLOAD_SUCCESS
)
message
(
STATUS
"Failed to download NVIDIA_Optical_Flow_2_0 Headers"
)
else
()
add_definitions
(
-DHAVE_NVIDIA_OPTFLOW=1
)
ocv_include_directories
(
SYSTEM
"
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH
}
/NVIDIAOpticalFlowSDK-
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT
}
"
)
if
(
NOT NVIDIA_OPTICAL_FLOW_2_0_HEADERS_DOWNLOAD_SUCCESS
)
message
(
STATUS
"Failed to download NVIDIA_Optical_Flow_2_0 Headers"
)
else
()
message
(
STATUS
"Building with NVIDIA Optical Flow API 2.0"
)
add_definitions
(
-DHAVE_NVIDIA_OPTFLOW=2
)
ocv_include_directories
(
SYSTEM
"
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH
}
/NVIDIAOpticalFlowSDK-
${
NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT
}
"
)
endif
()
endif
()
\ No newline at end of file
modules/cudaoptflow/src/cuda/nvidiaOpticalFlow.cu
浏览文件 @
0b8aecd9
...
...
@@ -22,6 +22,7 @@ typedef signed int int32_t;
#define SMEM_COLS ((BLOCKDIM_X)/2)
#define SMEM_ROWS ((BLOCKDIM_Y)/2)
#ifdef HAVE_NVIDIA_OPTFLOW
namespace
cv
{
namespace
cuda
{
namespace
device
{
namespace
optflow_nvidia
{
static
const
char
*
_cudaGetErrorEnum
(
cudaError_t
error
)
{
return
cudaGetErrorName
(
error
);
}
...
...
@@ -95,5 +96,6 @@ void FlowUpsample(void* srcDevPtr, uint32_t nSrcWidth, uint32_t nSrcPitch, uint3
checkCudaErrors
(
cudaGetLastError
());
}}}}}
#endif //HAVE_NVIDIA_OPTFLOW
#endif
\ No newline at end of file
modules/cudaoptflow/src/nvidiaOpticalFlow.cpp
浏览文件 @
0b8aecd9
...
...
@@ -9,26 +9,39 @@
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_1_0
>
cv
::
cuda
::
NvidiaOpticalFlow_1_0
::
create
(
int
,
int
,
NVIDIA_OF_PERF_LEVEL
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
{
(
cv
::
Size
,
NVIDIA_OF_PERF_LEVEL
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
{
throw_no_cuda
();
return
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_1_0
>
();
}
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_2_0
>
cv
::
cuda
::
NvidiaOpticalFlow_2_0
::
create
(
int
,
int
,
NVIDIA_OF_PERF_LEVEL
,
NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE
,
NVIDIA_OF_HINT_VECTOR_GRID_SIZE
,
bool
,
int
,
cv
::
Rect
*
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
{
cv
::
Size
,
NVIDIA_OF_PERF_LEVEL
,
NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE
,
NVIDIA_OF_HINT_VECTOR_GRID_SIZE
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
{
throw_no_cuda
();
return
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_2_0
>
();
}
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_2_0
>
cv
::
cuda
::
NvidiaOpticalFlow_2_0
::
create
(
cv
::
Size
,
std
::
vector
<
Rect
>
,
NVIDIA_OF_PERF_LEVEL
,
NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE
,
NVIDIA_OF_HINT_VECTOR_GRID_SIZE
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
{
throw_no_cuda
();
return
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_2_0
>
();
}
#elif !defined HAVE_NVIDIA_OPTFLOW
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_1_0
>
cv
::
cuda
::
NvidiaOpticalFlow_1_0
::
create
(
int
,
int
,
NVIDIA_OF_PERF_LEVEL
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
cv
::
Size
,
NVIDIA_OF_PERF_LEVEL
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
{
CV_Error
(
cv
::
Error
::
HeaderIsNull
,
"OpenCV was build without NVIDIA OpticalFlow support"
);
}
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_2_0
>
cv
::
cuda
::
NvidiaOpticalFlow_2_0
::
create
(
cv
::
Size
,
NVIDIA_OF_PERF_LEVEL
,
NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE
,
NVIDIA_OF_HINT_VECTOR_GRID_SIZE
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
{
CV_Error
(
cv
::
Error
::
HeaderIsNull
,
"OpenCV was build without NVIDIA OpticalFlow support"
);
}
cv
::
Ptr
<
cv
::
cuda
::
NvidiaOpticalFlow_2_0
>
cv
::
cuda
::
NvidiaOpticalFlow_2_0
::
create
(
int
,
int
,
NVIDIA_OF_PERF_LEVEL
,
NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE
,
NVIDIA_OF_HINT_VECTOR_GRID_SIZE
,
bool
,
int
,
cv
::
Rect
*
,
bool
,
bool
,
bool
,
int
,
,
Stream
&
,
Stream
&
)
cv
::
Size
,
std
::
vector
<
Rect
>
,
NVIDIA_OF_PERF_LEVEL
,
NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE
,
NVIDIA_OF_HINT_VECTOR_GRID_SIZE
,
bool
,
bool
,
bool
,
int
,
Stream
&
,
Stream
&
)
{
CV_Error
(
cv
::
Error
::
HeaderIsNull
,
"OpenCV was build without NVIDIA OpticalFlow support"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录