Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
3b364330
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,发现更多精彩内容 >>
提交
3b364330
编写于
4月 12, 2013
作者:
A
Andrey Kamaev
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '2.4'
上级
b0933dd4
abe2ea59
变更
75
展开全部
隐藏空白更改
内联
并排
Showing
75 changed file
with
1248 addition
and
3968 deletion
+1248
-3968
android/service/engine/src/org/opencv/engine/BinderConnector.java
...service/engine/src/org/opencv/engine/BinderConnector.java
+31
-11
android/service/engine/src/org/opencv/engine/HardwareDetector.java
...ervice/engine/src/org/opencv/engine/HardwareDetector.java
+12
-4
android/service/engine/src/org/opencv/engine/OpenCVEngineService.java
...ice/engine/src/org/opencv/engine/OpenCVEngineService.java
+39
-8
android/service/engine/src/org/opencv/engine/manager/ManagerActivity.java
...engine/src/org/opencv/engine/manager/ManagerActivity.java
+53
-19
cmake/OpenCVDetectCXXCompiler.cmake
cmake/OpenCVDetectCXXCompiler.cmake
+48
-44
cmake/OpenCVDetectOpenCL.cmake
cmake/OpenCVDetectOpenCL.cmake
+1
-1
doc/check_docs.py
doc/check_docs.py
+1
-1
doc/check_docs2.py
doc/check_docs2.py
+1
-1
doc/conf.py
doc/conf.py
+1
-1
doc/ocv.py
doc/ocv.py
+1
-1
doc/patch_refman_latex.py
doc/patch_refman_latex.py
+1
-1
doc/pattern_tools/gen_pattern.py
doc/pattern_tools/gen_pattern.py
+1
-1
doc/pattern_tools/svgfig.py
doc/pattern_tools/svgfig.py
+1
-1
doc/reformat.py
doc/reformat.py
+1
-1
modules/contrib/doc/facerec/src/create_csv.py
modules/contrib/doc/facerec/src/create_csv.py
+1
-1
modules/core/test/test_io.cpp
modules/core/test/test_io.cpp
+1
-1
modules/gpu/misc/mark_nvidia.py
modules/gpu/misc/mark_nvidia.py
+1
-1
modules/highgui/src/cap_v4l.cpp
modules/highgui/src/cap_v4l.cpp
+20
-0
modules/java/check-tests.py
modules/java/check-tests.py
+1
-1
modules/java/generator/gen_java.py
modules/java/generator/gen_java.py
+1
-1
modules/java/generator/gen_javadoc.py
modules/java/generator/gen_javadoc.py
+1
-1
modules/java/generator/rst_parser.py
modules/java/generator/rst_parser.py
+1
-1
modules/nonfree/src/surf.ocl.cpp
modules/nonfree/src/surf.ocl.cpp
+1
-1
modules/ocl/include/opencv2/ocl/private/util.hpp
modules/ocl/include/opencv2/ocl/private/util.hpp
+3
-2
modules/ocl/src/arithm.cpp
modules/ocl/src/arithm.cpp
+8
-9
modules/ocl/src/initialization.cpp
modules/ocl/src/initialization.cpp
+9
-0
modules/ocl/src/matrix_operations.cpp
modules/ocl/src/matrix_operations.cpp
+1
-1
modules/ocl/src/opencl/arithm_add.cl
modules/ocl/src/opencl/arithm_add.cl
+29
-339
modules/ocl/src/opencl/arithm_flip.cl
modules/ocl/src/opencl/arithm_flip.cl
+4
-6
modules/ocl/src/opencl/arithm_sub.cl
modules/ocl/src/opencl/arithm_sub.cl
+0
-1104
modules/ocl/src/opencl/arithm_sub_scalar.cl
modules/ocl/src/opencl/arithm_sub_scalar.cl
+0
-806
modules/ocl/src/opencl/arithm_sub_scalar_mask.cl
modules/ocl/src/opencl/arithm_sub_scalar_mask.cl
+0
-941
modules/ocl/src/opencl/brute_force_match.cl
modules/ocl/src/opencl/brute_force_match.cl
+173
-168
modules/ocl/src/opencl/filter_sep_row.cl
modules/ocl/src/opencl/filter_sep_row.cl
+90
-89
modules/ocl/src/opencl/filtering_laplacian.cl
modules/ocl/src/opencl/filtering_laplacian.cl
+45
-45
modules/ocl/src/opencl/imgproc_integral.cl
modules/ocl/src/opencl/imgproc_integral.cl
+21
-15
modules/ocl/src/opencl/imgproc_warpAffine.cl
modules/ocl/src/opencl/imgproc_warpAffine.cl
+55
-52
modules/ocl/src/opencl/imgproc_warpPerspective.cl
modules/ocl/src/opencl/imgproc_warpPerspective.cl
+59
-55
modules/ocl/src/opencl/match_template.cl
modules/ocl/src/opencl/match_template.cl
+5
-6
modules/ocl/src/opencl/objdetect_hog.cl
modules/ocl/src/opencl/objdetect_hog.cl
+145
-62
modules/ocl/src/opencl/pyrlk.cl
modules/ocl/src/opencl/pyrlk.cl
+262
-16
modules/ocl/src/opencl/stereobm.cl
modules/ocl/src/opencl/stereobm.cl
+39
-39
modules/ocl/test/main.cpp
modules/ocl/test/main.cpp
+3
-4
modules/ocl/test/test_arithm.cpp
modules/ocl/test/test_arithm.cpp
+8
-4
modules/ocl/test/test_brute_force_matcher.cpp
modules/ocl/test/test_brute_force_matcher.cpp
+23
-45
modules/python/src2/cv.py
modules/python/src2/cv.py
+0
-2
modules/python/src2/cv2.cpp
modules/python/src2/cv2.cpp
+1
-1
modules/python/src2/gen.py
modules/python/src2/gen.py
+1
-1
modules/python/src2/gen2.py
modules/python/src2/gen2.py
+1
-1
modules/python/src2/hdr_parser.py
modules/python/src2/hdr_parser.py
+1
-1
modules/python/test/calchist.py
modules/python/test/calchist.py
+1
-1
modules/python/test/camera_calibration.py
modules/python/test/camera_calibration.py
+1
-1
modules/python/test/findstereocorrespondence.py
modules/python/test/findstereocorrespondence.py
+1
-1
modules/python/test/goodfeatures.py
modules/python/test/goodfeatures.py
+1
-1
modules/python/test/leak1.py
modules/python/test/leak1.py
+1
-1
modules/python/test/leak2.py
modules/python/test/leak2.py
+1
-1
modules/python/test/leak3.py
modules/python/test/leak3.py
+1
-1
modules/python/test/leak4.py
modules/python/test/leak4.py
+1
-1
modules/python/test/precornerdetect.py
modules/python/test/precornerdetect.py
+1
-1
modules/python/test/test.py
modules/python/test/test.py
+1
-1
modules/python/test/test2.py
modules/python/test/test2.py
+1
-1
modules/python/test/ticket_6.py
modules/python/test/ticket_6.py
+1
-1
modules/python/test/tickets.py
modules/python/test/tickets.py
+1
-1
modules/python/test/transformations.py
modules/python/test/transformations.py
+1
-1
modules/ts/misc/testlog_parser.py
modules/ts/misc/testlog_parser.py
+1
-1
samples/android/15-puzzle/res/layout/activity_puzzle15.xml
samples/android/15-puzzle/res/layout/activity_puzzle15.xml
+0
-11
samples/android/15-puzzle/res/menu/activity_puzzle15.xml
samples/android/15-puzzle/res/menu/activity_puzzle15.xml
+0
-6
samples/android/15-puzzle/src/org/opencv/samples/puzzle15/Puzzle15Activity.java
...zle/src/org/opencv/samples/puzzle15/Puzzle15Activity.java
+12
-6
samples/android/native-activity/jni/Android.mk
samples/android/native-activity/jni/Android.mk
+1
-1
samples/android/native-activity/jni/Application.mk
samples/android/native-activity/jni/Application.mk
+2
-0
samples/cpp/freak_demo.cpp
samples/cpp/freak_demo.cpp
+1
-1
samples/cpp/lkdemo.cpp
samples/cpp/lkdemo.cpp
+7
-9
samples/python2/common.py
samples/python2/common.py
+2
-0
samples/python2/dft.py
samples/python2/dft.py
+1
-1
samples/python2/watershed.py
samples/python2/watershed.py
+1
-1
未找到文件。
android/service/engine/src/org/opencv/engine/BinderConnector.java
浏览文件 @
3b364330
...
...
@@ -4,23 +4,43 @@ import android.os.IBinder;
public
class
BinderConnector
{
public
BinderConnector
(
MarketConnector
Market
)
{
Init
(
Market
);
public
BinderConnector
(
MarketConnector
Market
)
{
mMarket
=
Market
;
}
public
boolean
Init
()
{
boolean
result
=
false
;
if
(
mIsReady
)
result
=
Init
(
mMarket
);
return
result
;
}
public
native
IBinder
Connect
();
public
boolean
Disconnect
()
{
Final
();
return
true
;
}
if
(
mIsReady
)
Final
();
static
{
System
.
loadLibrary
(
"OpenCVEngine"
);
System
.
loadLibrary
(
"OpenCVEngine_jni"
);
return
mIsReady
;
}
private
native
boolean
Init
(
MarketConnector
Market
);
public
native
void
Final
();
private
native
void
Final
();
private
static
boolean
mIsReady
=
false
;
private
MarketConnector
mMarket
;
static
{
try
{
System
.
loadLibrary
(
"OpenCVEngine"
);
System
.
loadLibrary
(
"OpenCVEngine_jni"
);
mIsReady
=
true
;
}
catch
(
UnsatisfiedLinkError
e
)
{
mIsReady
=
false
;
e
.
printStackTrace
();
}
}
}
android/service/engine/src/org/opencv/engine/HardwareDetector.java
浏览文件 @
3b364330
...
...
@@ -47,9 +47,17 @@ public class HardwareDetector
public
static
native
int
DetectKnownPlatforms
();
static
{
System
.
loadLibrary
(
"OpenCVEngine"
);
System
.
loadLibrary
(
"OpenCVEngine_jni"
);
public
static
boolean
mIsReady
=
false
;
static
{
try
{
System
.
loadLibrary
(
"OpenCVEngine"
);
System
.
loadLibrary
(
"OpenCVEngine_jni"
);
mIsReady
=
true
;
}
catch
(
UnsatisfiedLinkError
e
)
{
mIsReady
=
false
;
e
.
printStackTrace
();
}
}
}
android/service/engine/src/org/opencv/engine/OpenCVEngineService.java
浏览文件 @
3b364330
...
...
@@ -3,31 +3,62 @@ package org.opencv.engine;
import
android.app.Service
;
import
android.content.Intent
;
import
android.os.IBinder
;
import
android.os.RemoteException
;
import
android.util.Log
;
public
class
OpenCVEngineService
extends
Service
{
private
static
final
String
TAG
=
"OpenCVEngine/Service"
;
private
IBinder
mEngineInterface
;
private
IBinder
mEngineInterface
=
null
;
private
MarketConnector
mMarket
;
private
BinderConnector
mNativeBinder
;
public
void
onCreate
()
{
public
void
onCreate
()
{
Log
.
i
(
TAG
,
"Service starting"
);
super
.
onCreate
();
Log
.
i
(
TAG
,
"Engine binder component creating"
);
mMarket
=
new
MarketConnector
(
getBaseContext
());
mNativeBinder
=
new
BinderConnector
(
mMarket
);
mEngineInterface
=
mNativeBinder
.
Connect
();
Log
.
i
(
TAG
,
"Service started successfully"
);
if
(
mNativeBinder
.
Init
())
{
mEngineInterface
=
mNativeBinder
.
Connect
();
Log
.
i
(
TAG
,
"Service started successfully"
);
}
else
{
Log
.
e
(
TAG
,
"Cannot initialize native part of OpenCV Manager!"
);
Log
.
e
(
TAG
,
"Using stub instead"
);
mEngineInterface
=
new
OpenCVEngineInterface
.
Stub
()
{
@Override
public
boolean
installVersion
(
String
version
)
throws
RemoteException
{
// TODO Auto-generated method stub
return
false
;
}
@Override
public
String
getLibraryList
(
String
version
)
throws
RemoteException
{
// TODO Auto-generated method stub
return
null
;
}
@Override
public
String
getLibPathByVersion
(
String
version
)
throws
RemoteException
{
// TODO Auto-generated method stub
return
null
;
}
@Override
public
int
getEngineVersion
()
throws
RemoteException
{
return
-
1
;
}
};
}
}
public
IBinder
onBind
(
Intent
intent
)
{
public
IBinder
onBind
(
Intent
intent
)
{
Log
.
i
(
TAG
,
"Service onBind called for intent "
+
intent
.
toString
());
return
mEngineInterface
;
}
public
boolean
onUnbind
(
Intent
intent
)
{
Log
.
i
(
TAG
,
"Service onUnbind called for intent "
+
intent
.
toString
());
...
...
android/service/engine/src/org/opencv/engine/manager/ManagerActivity.java
浏览文件 @
3b364330
...
...
@@ -42,6 +42,26 @@ public class ManagerActivity extends Activity
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
if
(!
HardwareDetector
.
mIsReady
)
{
Log
.
e
(
TAG
,
"Cannot initialize native part of OpenCV Manager!"
);
AlertDialog
dialog
=
new
AlertDialog
.
Builder
(
this
).
create
();
dialog
.
setTitle
(
"OpenCV Manager Error"
);
dialog
.
setMessage
(
"OpenCV Manager is incompatible with this device. Please replace it with an appropriate package."
);
dialog
.
setCancelable
(
false
);
dialog
.
setButton
(
"OK"
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
finish
();
}
});
dialog
.
show
();
return
;
}
setContentView
(
R
.
layout
.
main
);
TextView
OsVersionView
=
(
TextView
)
findViewById
(
R
.
id
.
OsVersionValue
);
...
...
@@ -186,6 +206,20 @@ public class ManagerActivity extends Activity
}
});
mPackageChangeReciever
=
new
BroadcastReceiver
()
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
Log
.
d
(
"OpenCVManager/Reciever"
,
"Bradcast message "
+
intent
.
getAction
()
+
" reciever"
);
Log
.
d
(
"OpenCVManager/Reciever"
,
"Filling package list on broadcast message"
);
if
(!
bindService
(
new
Intent
(
"org.opencv.engine.BIND"
),
new
OpenCVEngineServiceConnection
(),
Context
.
BIND_AUTO_CREATE
))
{
TextView
EngineVersionView
=
(
TextView
)
findViewById
(
R
.
id
.
EngineVersionValue
);
EngineVersionView
.
setText
(
"not avaliable"
);
}
}
};
IntentFilter
filter
=
new
IntentFilter
();
filter
.
addAction
(
Intent
.
ACTION_PACKAGE_ADDED
);
filter
.
addAction
(
Intent
.
ACTION_PACKAGE_CHANGED
);
...
...
@@ -199,17 +233,23 @@ public class ManagerActivity extends Activity
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
unregisterReceiver
(
mPackageChangeReciever
);
if
(
mPackageChangeReciever
!=
null
)
unregisterReceiver
(
mPackageChangeReciever
);
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
Log
.
d
(
TAG
,
"Filling package list on resume"
);
if
(!
bindService
(
new
Intent
(
"org.opencv.engine.BIND"
),
new
OpenCVEngineServiceConnection
(),
Context
.
BIND_AUTO_CREATE
))
{
TextView
EngineVersionView
=
(
TextView
)
findViewById
(
R
.
id
.
EngineVersionValue
);
EngineVersionView
.
setText
(
"not avaliable"
);
if
(
HardwareDetector
.
mIsReady
)
{
Log
.
d
(
TAG
,
"Filling package list on resume"
);
OpenCVEngineServiceConnection
connection
=
new
OpenCVEngineServiceConnection
();
if
(!
bindService
(
new
Intent
(
"org.opencv.engine.BIND"
),
connection
,
Context
.
BIND_AUTO_CREATE
))
{
Log
.
e
(
TAG
,
"Cannot bind to OpenCV Manager service!"
);
TextView
EngineVersionView
=
(
TextView
)
findViewById
(
R
.
id
.
EngineVersionValue
);
if
(
EngineVersionView
!=
null
)
EngineVersionView
.
setText
(
"not avaliable"
);
unbindService
(
connection
);
}
}
}
...
...
@@ -225,19 +265,7 @@ public class ManagerActivity extends Activity
protected
int
ManagerApiLevel
=
0
;
protected
String
ManagerVersion
;
protected
BroadcastReceiver
mPackageChangeReciever
=
new
BroadcastReceiver
()
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
Log
.
d
(
"OpenCVManager/Reciever"
,
"Bradcast message "
+
intent
.
getAction
()
+
" reciever"
);
Log
.
d
(
"OpenCVManager/Reciever"
,
"Filling package list on broadcast message"
);
if
(!
bindService
(
new
Intent
(
"org.opencv.engine.BIND"
),
new
OpenCVEngineServiceConnection
(),
Context
.
BIND_AUTO_CREATE
))
{
TextView
EngineVersionView
=
(
TextView
)
findViewById
(
R
.
id
.
EngineVersionValue
);
EngineVersionView
.
setText
(
"not avaliable"
);
}
}
};
protected
BroadcastReceiver
mPackageChangeReciever
=
null
;
protected
class
OpenCVEngineServiceConnection
implements
ServiceConnection
{
...
...
@@ -246,6 +274,12 @@ public class ManagerActivity extends Activity
public
void
onServiceConnected
(
ComponentName
name
,
IBinder
service
)
{
OpenCVEngineInterface
EngineService
=
OpenCVEngineInterface
.
Stub
.
asInterface
(
service
);
if
(
EngineService
==
null
)
{
Log
.
e
(
TAG
,
"Cannot connect to OpenCV Manager Service!"
);
unbindService
(
this
);
return
;
}
try
{
ManagerApiLevel
=
EngineService
.
getEngineVersion
();
}
catch
(
RemoteException
e
)
{
...
...
cmake/OpenCVDetectCXXCompiler.cmake
浏览文件 @
3b364330
...
...
@@ -27,23 +27,23 @@ endif()
# the -fPIC flag should be used.
# ----------------------------------------------------------------------------
if
(
UNIX
)
if
(
__ICL
)
set
(
CV_ICC __ICL
)
elseif
(
__ICC
)
set
(
CV_ICC __ICC
)
elseif
(
__ECL
)
set
(
CV_ICC __ECL
)
elseif
(
__ECC
)
set
(
CV_ICC __ECC
)
elseif
(
__INTEL_COMPILER
)
set
(
CV_ICC __INTEL_COMPILER
)
elseif
(
CMAKE_C_COMPILER MATCHES
"icc"
)
set
(
CV_ICC icc_matches_c_compiler
)
endif
()
if
(
__ICL
)
set
(
CV_ICC __ICL
)
elseif
(
__ICC
)
set
(
CV_ICC __ICC
)
elseif
(
__ECL
)
set
(
CV_ICC __ECL
)
elseif
(
__ECC
)
set
(
CV_ICC __ECC
)
elseif
(
__INTEL_COMPILER
)
set
(
CV_ICC __INTEL_COMPILER
)
elseif
(
CMAKE_C_COMPILER MATCHES
"icc"
)
set
(
CV_ICC icc_matches_c_compiler
)
endif
()
endif
()
if
(
MSVC AND CMAKE_C_COMPILER MATCHES
"icc"
)
set
(
CV_ICC __INTEL_COMPILER_FOR_WINDOWS
)
set
(
CV_ICC __INTEL_COMPILER_FOR_WINDOWS
)
endif
()
# ----------------------------------------------------------------------------
...
...
@@ -64,45 +64,49 @@ if(CMAKE_COMPILER_IS_CLANGCXX)
string
(
REGEX MATCH
"[0-9]+
\\
.[0-9]+"
CMAKE_CLANG_REGEX_VERSION
"
${
CMAKE_OPENCV_CLANG_VERSION_FULL
}
"
)
elseif
(
CMAKE_COMPILER_IS_GNUCXX
)
execute_process
(
COMMAND
${
CMAKE_CXX_COMPILER
}
${
CMAKE_CXX_COMPILER_ARG1
}
-dumpversion
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_VERSION_FULL
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process
(
COMMAND
${
CMAKE_CXX_COMPILER
}
${
CMAKE_CXX_COMPILER_ARG1
}
-dumpversion
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_VERSION_FULL
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process
(
COMMAND
${
CMAKE_CXX_COMPILER
}
${
CMAKE_CXX_COMPILER_ARG1
}
-v
ERROR_VARIABLE CMAKE_OPENCV_GCC_INFO_FULL
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process
(
COMMAND
${
CMAKE_CXX_COMPILER
}
${
CMAKE_CXX_COMPILER_ARG1
}
-v
ERROR_VARIABLE CMAKE_OPENCV_GCC_INFO_FULL
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Typical output in CMAKE_OPENCV_GCC_VERSION_FULL: "c+//0 (whatever) 4.2.3 (...)"
# Look for the version number
string
(
REGEX MATCH
"[0-9]+
\\
.[0-9]+
\\
.[0-9]+"
CMAKE_GCC_REGEX_VERSION
"
${
CMAKE_OPENCV_GCC_VERSION_FULL
}
"
)
if
(
NOT CMAKE_GCC_REGEX_VERSION
)
string
(
REGEX MATCH
"[0-9]+
\\
.[0-9]+"
CMAKE_GCC_REGEX_VERSION
"
${
CMAKE_OPENCV_GCC_VERSION_FULL
}
"
)
endif
()
# Typical output in CMAKE_OPENCV_GCC_VERSION_FULL: "c+//0 (whatever) 4.2.3 (...)"
# Look for the version number
string
(
REGEX MATCH
"[0-9]+
\\
.[0-9]+
\\
.[0-9]+"
CMAKE_GCC_REGEX_VERSION
"
${
CMAKE_OPENCV_GCC_VERSION_FULL
}
"
)
if
(
NOT CMAKE_GCC_REGEX_VERSION
)
string
(
REGEX MATCH
"[0-9]+
\\
.[0-9]+"
CMAKE_GCC_REGEX_VERSION
"
${
CMAKE_OPENCV_GCC_VERSION_FULL
}
"
)
endif
()
# Split the three parts:
string
(
REGEX MATCHALL
"[0-9]+"
CMAKE_OPENCV_GCC_VERSIONS
"
${
CMAKE_GCC_REGEX_VERSION
}
"
)
# Split the three parts:
string
(
REGEX MATCHALL
"[0-9]+"
CMAKE_OPENCV_GCC_VERSIONS
"
${
CMAKE_GCC_REGEX_VERSION
}
"
)
list
(
GET CMAKE_OPENCV_GCC_VERSIONS 0 CMAKE_OPENCV_GCC_VERSION_MAJOR
)
list
(
GET CMAKE_OPENCV_GCC_VERSIONS 1 CMAKE_OPENCV_GCC_VERSION_MINOR
)
list
(
GET CMAKE_OPENCV_GCC_VERSIONS 0 CMAKE_OPENCV_GCC_VERSION_MAJOR
)
list
(
GET CMAKE_OPENCV_GCC_VERSIONS 1 CMAKE_OPENCV_GCC_VERSION_MINOR
)
set
(
CMAKE_OPENCV_GCC_VERSION
${
CMAKE_OPENCV_GCC_VERSION_MAJOR
}${
CMAKE_OPENCV_GCC_VERSION_MINOR
}
)
math
(
EXPR CMAKE_OPENCV_GCC_VERSION_NUM
"
${
CMAKE_OPENCV_GCC_VERSION_MAJOR
}
*100 +
${
CMAKE_OPENCV_GCC_VERSION_MINOR
}
"
)
message
(
STATUS
"Detected version of GNU GCC:
${
CMAKE_OPENCV_GCC_VERSION
}
(
${
CMAKE_OPENCV_GCC_VERSION_NUM
}
)"
)
set
(
CMAKE_OPENCV_GCC_VERSION
${
CMAKE_OPENCV_GCC_VERSION_MAJOR
}${
CMAKE_OPENCV_GCC_VERSION_MINOR
}
)
math
(
EXPR CMAKE_OPENCV_GCC_VERSION_NUM
"
${
CMAKE_OPENCV_GCC_VERSION_MAJOR
}
*100 +
${
CMAKE_OPENCV_GCC_VERSION_MINOR
}
"
)
message
(
STATUS
"Detected version of GNU GCC:
${
CMAKE_OPENCV_GCC_VERSION
}
(
${
CMAKE_OPENCV_GCC_VERSION_NUM
}
)"
)
if
(
WIN32
)
execute_process
(
COMMAND
${
CMAKE_CXX_COMPILER
}
-dumpmachine
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES
"amd64|x86_64|AMD64"
)
set
(
MINGW64 1
)
endif
()
if
(
WIN32
)
execute_process
(
COMMAND
${
CMAKE_CXX_COMPILER
}
-dumpmachine
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES
"amd64|x86_64|AMD64"
)
set
(
MINGW64 1
)
endif
()
endif
()
endif
()
if
(
MINGW64 OR CMAKE_SYSTEM_PROCESSOR MATCHES
"amd64.*|x86_64.*|AMD64.*"
OR CMAKE_GENERATOR MATCHES
"Visual Studio.*Win64"
)
set
(
X86_64 1
)
if
(
MSVC64 OR MINGW64
)
set
(
X86_64 1
)
elseif
(
MSVC AND NOT CMAKE_CROSSCOMPILING
)
set
(
X86 1
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"amd64.*|x86_64.*|AMD64.*"
)
set
(
X86_64 1
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"i686.*|i386.*|x86.*|amd64.*|AMD64.*"
)
set
(
X86 1
)
set
(
X86 1
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"arm.*|ARM.*"
)
set
(
ARM 1
)
set
(
ARM 1
)
endif
()
cmake/OpenCVDetectOpenCL.cmake
浏览文件 @
3b364330
...
...
@@ -4,7 +4,7 @@ if(APPLE)
set
(
OPENCL_INCLUDE_DIR
""
CACHE STRING
"OpenCL include directory"
)
mark_as_advanced
(
OPENCL_INCLUDE_DIR OPENCL_LIBRARY
)
else
(
APPLE
)
find_package
(
OpenCL QUIET
)
#
find_package(OpenCL QUIET)
if
(
NOT OPENCL_FOUND
)
find_path
(
OPENCL_ROOT_DIR
...
...
doc/check_docs.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
sys
,
glob
...
...
doc/check_docs2.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
os
,
sys
,
fnmatch
,
re
...
...
doc/conf.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
# -*- coding: utf-8 -*-
#
...
...
doc/ocv.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ocv domain, a modified copy of sphinx.domains.cpp + shpinx.domains.python.
...
...
doc/patch_refman_latex.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
sys
...
...
doc/pattern_tools/gen_pattern.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
"""gen_pattern.py
To run:
...
...
doc/pattern_tools/svgfig.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
# svgfig.py copyright (C) 2008 Jim Pivarski <jpivarski@gmail.com>
#
...
...
doc/reformat.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
os
,
sys
,
re
...
...
modules/contrib/doc/facerec/src/create_csv.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
sys
import
os.path
...
...
modules/core/test/test_io.cpp
浏览文件 @
3b364330
...
...
@@ -455,7 +455,7 @@ protected:
TEST(Core_InputOutput, huge) { CV_BigMatrixIOTest test; test.safe_run(); }
*/
TEST
(
Core_globbing
,
accura
s
y
)
TEST
(
Core_globbing
,
accura
c
y
)
{
std
::
string
patternLena
=
cvtest
::
TS
::
ptr
()
->
get_data_path
()
+
"lena*.*"
;
std
::
string
patternLenaPng
=
cvtest
::
TS
::
ptr
()
->
get_data_path
()
+
"lena.png"
;
...
...
modules/gpu/misc/mark_nvidia.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
sys
,
re
...
...
modules/highgui/src/cap_v4l.cpp
浏览文件 @
3b364330
...
...
@@ -154,6 +154,11 @@ the symptoms were damaged image and 'Corrupt JPEG data: premature end of data se
- USE_TEMP_BUFFER fixes the main problem (improper buffer management) and
prevents bad images in the first place
11th patch: April 2, 2013, Forrest Reiling forrest.reiling@gmail.com
Added v4l2 support for getting capture property CV_CAP_PROP_POS_MSEC.
Returns the millisecond timestamp of the last frame grabbed or 0 if no frames have been grabbed
Used to successfully synchonize 2 Logitech C310 USB webcams to within 16 ms of one another
make & enjoy!
...
...
@@ -320,6 +325,8 @@ typedef struct CvCaptureCAM_V4L
struct
v4l2_queryctrl
queryctrl
;
struct
v4l2_querymenu
querymenu
;
struct
timeval
timestamp
;
/* V4L2 control variables */
int
v4l2_brightness
,
v4l2_brightness_min
,
v4l2_brightness_max
;
int
v4l2_contrast
,
v4l2_contrast_min
,
v4l2_contrast_max
;
...
...
@@ -836,6 +843,9 @@ static int _capture_V4L2 (CvCaptureCAM_V4L *capture, char *deviceName)
capture
->
v4l2_gain_max
=
0
;
capture
->
v4l2_exposure_max
=
0
;
capture
->
timestamp
.
tv_sec
=
0
;
capture
->
timestamp
.
tv_usec
=
0
;
/* Scan V4L2 controls */
v4l2_scan_controls
(
capture
);
...
...
@@ -1221,6 +1231,9 @@ static int read_frame_v4l2(CvCaptureCAM_V4L* capture) {
if
(
-
1
==
ioctl
(
capture
->
deviceHandle
,
VIDIOC_QBUF
,
&
buf
))
perror
(
"VIDIOC_QBUF"
);
//set timestamp in capture struct to be timestamp of most recent frame
capture
->
timestamp
=
buf
.
timestamp
;
return
1
;
}
...
...
@@ -2308,6 +2321,13 @@ static double icvGetPropertyCAM_V4L (CvCaptureCAM_V4L* capture,
/* initialize the control structure */
switch
(
property_id
)
{
case
CV_CAP_PROP_POS_MSEC
:
if
(
capture
->
FirstCapture
)
{
return
0
;
}
else
{
return
1000
*
capture
->
timestamp
.
tv_sec
+
((
double
)
capture
->
timestamp
.
tv_usec
)
/
1000
;
}
break
;
case
CV_CAP_PROP_BRIGHTNESS
:
capture
->
control
.
id
=
V4L2_CID_BRIGHTNESS
;
break
;
...
...
modules/java/check-tests.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
sys
,
os
,
re
...
...
modules/java/generator/gen_java.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
sys
,
re
,
os
.
path
from
string
import
Template
...
...
modules/java/generator/gen_javadoc.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
os
,
sys
,
re
,
string
,
glob
from
optparse
import
OptionParser
...
...
modules/java/generator/rst_parser.py
浏览文件 @
3b364330
#/usr/bin/env python
#
!
/usr/bin/env python
import
os
,
sys
,
re
,
string
,
fnmatch
allmodules
=
[
"core"
,
"flann"
,
"imgproc"
,
"ml"
,
"highgui"
,
"video"
,
"features2d"
,
"calib3d"
,
"objdetect"
,
"legacy"
,
"contrib"
,
"gpu"
,
"androidcamera"
,
"java"
,
"python"
,
"stitching"
,
"ts"
,
"photo"
,
"nonfree"
,
"videostab"
,
"ocl"
,
"softcascade"
,
"superres"
]
...
...
modules/nonfree/src/surf.ocl.cpp
浏览文件 @
3b364330
...
...
@@ -76,7 +76,7 @@ namespace cv
size_t
wave_size
=
0
;
queryDeviceInfo
(
WAVEFRONT_SIZE
,
&
wave_size
);
std
::
sprintf
(
pSURF_OPTIONS
,
"
-D WAVE_SIZE=%d"
,
static_cast
<
int
>
(
wave_size
));
std
::
sprintf
(
pSURF_OPTIONS
,
"-D WAVE_SIZE=%d"
,
static_cast
<
int
>
(
wave_size
));
OPTION_INIT
=
true
;
}
openCLExecuteKernel
(
clCxt
,
source
,
kernelName
,
globalThreads
,
localThreads
,
args
,
channels
,
depth
,
SURF_OPTIONS
);
...
...
modules/ocl/include/opencv2/ocl/private/util.hpp
浏览文件 @
3b364330
...
...
@@ -127,8 +127,9 @@ namespace cv
// currently only support wavefront size queries
enum
DEVICE_INFO
{
WAVEFRONT_SIZE
,
//in AMD speak
WARP_SIZE
=
WAVEFRONT_SIZE
//in nvidia speak
WAVEFRONT_SIZE
,
//in AMD speak
WARP_SIZE
=
WAVEFRONT_SIZE
,
//in nvidia speak
IS_CPU_DEVICE
//check if the device is CPU
};
//info should have been pre-allocated
void
CV_EXPORTS
queryDeviceInfo
(
DEVICE_INFO
info_type
,
void
*
info
);
...
...
modules/ocl/src/arithm.cpp
浏览文件 @
3b364330
...
...
@@ -91,9 +91,6 @@ namespace cv
extern
const
char
*
arithm_bitwise_xor_scalar_mask
;
extern
const
char
*
arithm_compare_eq
;
extern
const
char
*
arithm_compare_ne
;
extern
const
char
*
arithm_sub
;
extern
const
char
*
arithm_sub_scalar
;
extern
const
char
*
arithm_sub_scalar_mask
;
extern
const
char
*
arithm_mul
;
extern
const
char
*
arithm_div
;
extern
const
char
*
arithm_absdiff
;
...
...
@@ -260,11 +257,11 @@ void cv::ocl::add(const oclMat &src1, const oclMat &src2, oclMat &dst, const ocl
void
cv
::
ocl
::
subtract
(
const
oclMat
&
src1
,
const
oclMat
&
src2
,
oclMat
&
dst
)
{
arithmetic_run
(
src1
,
src2
,
dst
,
"arithm_
sub"
,
&
arithm_sub
);
arithmetic_run
(
src1
,
src2
,
dst
,
"arithm_
add"
,
&
arithm_add
);
}
void
cv
::
ocl
::
subtract
(
const
oclMat
&
src1
,
const
oclMat
&
src2
,
oclMat
&
dst
,
const
oclMat
&
mask
)
{
arithmetic_run
(
src1
,
src2
,
dst
,
mask
,
"arithm_
sub_with_mask"
,
&
arithm_sub
);
arithmetic_run
(
src1
,
src2
,
dst
,
mask
,
"arithm_
add_with_mask"
,
&
arithm_add
);
}
typedef
void
(
*
MulDivFunc
)(
const
oclMat
&
src1
,
const
oclMat
&
src2
,
oclMat
&
dst
,
String
kernelName
,
const
char
**
kernelString
,
void
*
scalar
);
...
...
@@ -451,14 +448,16 @@ void cv::ocl::add(const oclMat &src1, const Scalar &src2, oclMat &dst, const ocl
void
cv
::
ocl
::
subtract
(
const
oclMat
&
src1
,
const
Scalar
&
src2
,
oclMat
&
dst
,
const
oclMat
&
mask
)
{
String
kernelName
=
mask
.
data
?
"arithm_s_sub_with_mask"
:
"arithm_s_sub"
;
const
char
**
kernelString
=
mask
.
data
?
&
arithm_sub_scalar_mask
:
&
arithm_sub_scalar
;
String
kernelName
=
mask
.
data
?
"arithm_s_add_with_mask"
:
"arithm_s_add"
;
const
char
**
kernelString
=
mask
.
data
?
&
arithm_add_scalar_mask
:
&
arithm_add_scalar
;
arithmetic_scalar
(
src1
,
src2
,
dst
,
mask
,
kernelName
,
kernelString
,
1
);
}
void
cv
::
ocl
::
subtract
(
const
Scalar
&
src2
,
const
oclMat
&
src1
,
oclMat
&
dst
,
const
oclMat
&
mask
)
{
String
kernelName
=
mask
.
data
?
"arithm_s_sub_with_mask"
:
"arithm_s_sub"
;
const
char
**
kernelString
=
mask
.
data
?
&
arithm_sub_scalar_mask
:
&
arithm_sub_scalar
;
String
kernelName
=
mask
.
data
?
"arithm_s_add_with_mask"
:
"arithm_s_add"
;
const
char
**
kernelString
=
mask
.
data
?
&
arithm_add_scalar_mask
:
&
arithm_add_scalar
;
arithmetic_scalar
(
src1
,
src2
,
dst
,
mask
,
kernelName
,
kernelString
,
-
1
);
}
void
cv
::
ocl
::
divide
(
double
scalar
,
const
oclMat
&
src
,
oclMat
&
dst
)
...
...
modules/ocl/src/initialization.cpp
浏览文件 @
3b364330
...
...
@@ -394,6 +394,15 @@ namespace cv
}
break
;
case
IS_CPU_DEVICE
:
{
cl_device_type
devicetype
;
openCLSafeCall
(
clGetDeviceInfo
(
impl
->
devices
[
impl
->
devnum
],
CL_DEVICE_TYPE
,
sizeof
(
cl_device_type
),
&
devicetype
,
NULL
));
*
(
bool
*
)
info
=
(
devicetype
==
CVCL_DEVICE_TYPE_CPU
);
}
break
;
default:
CV_Error
(
-
1
,
"Invalid device info type"
);
break
;
...
...
modules/ocl/src/matrix_operations.cpp
浏览文件 @
3b364330
...
...
@@ -393,7 +393,7 @@ void cv::ocl::oclMat::convertTo( oclMat &dst, int rtype, double alpha, double be
if
(
rtype
<
0
)
rtype
=
type
();
else
rtype
=
CV_MAKETYPE
(
CV_MAT_DEPTH
(
rtype
),
channels
());
rtype
=
CV_MAKETYPE
(
CV_MAT_DEPTH
(
rtype
),
ocl
channels
());
//int scn = channels();
int
sdepth
=
depth
(),
ddepth
=
CV_MAT_DEPTH
(
rtype
);
...
...
modules/ocl/src/opencl/arithm_add.cl
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/arithm_flip.cl
浏览文件 @
3b364330
...
...
@@ -330,16 +330,14 @@ __kernel void arithm_flip_cols_C1_D0 (__global uchar *src, int src_step, int src
if
(
x
<
thread_cols
&&
y
<
rows
)
{
int
src_index_0
=
mad24
(
y,
src_step,
(
x
)
+
src_offset
)
;
int
src_index_1
=
mad24
(
y,
src_step,
(
cols
-
x
-1
)
+
src_offset
)
;
int
dst_index_0
=
mad24
(
y,
dst_step,
(
x
)
+
dst_offset
)
;
int
dst_index_1
=
mad24
(
y,
dst_step,
(
cols
-
x
-1
)
+
dst_offset
)
;
uchar
data0
=
*
(
src
+
src_index_0
)
;
uchar
data1
=
*
(
src
+
src_index_1
)
;
*
(
dst
+
dst_index_1
)
=
data0
;
int
src_index_1
=
mad24
(
y,
src_step,
(
cols
-
x
-1
)
+
src_offset
)
;
int
dst_index_0
=
mad24
(
y,
dst_step,
(
x
)
+
dst_offset
)
;
uchar
data1
=
*
(
src
+
src_index_1
)
;
*
(
dst
+
dst_index_0
)
=
data1
;
*
(
dst
+
dst_index_1
)
=
data0
;
}
}
__kernel
void
arithm_flip_cols_C1_D1
(
__global
char
*src,
int
src_step,
int
src_offset,
...
...
modules/ocl/src/opencl/arithm_sub.cl
已删除
100644 → 0
浏览文件 @
b0933dd4
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/arithm_sub_scalar.cl
已删除
100644 → 0
浏览文件 @
b0933dd4
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/arithm_sub_scalar_mask.cl
已删除
100644 → 0
浏览文件 @
b0933dd4
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/brute_force_match.cl
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/filter_sep_row.cl
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/filtering_laplacian.cl
浏览文件 @
3b364330
...
...
@@ -114,7 +114,7 @@ __kernel void filter2D_C1_D0(__global uchar *src, int src_step, int src_offset_x
int
groupX_size
=
get_local_size
(
0
)
;
int
groupX_id
=
get_group_id
(
0
)
;
#
define
dst_align
(
dst_offset_x
&
3
)
#
define
dst_align
(
dst_offset_x
&
3
)
int
cols_start_index_group
=
src_offset_x
-
dst_align
+
groupX_size
*
groupX_id
-
ANX
;
int
rows_start_index
=
src_offset_y
+
(
gY
<<
ROWS_PER_GROUP_BITS
)
-
ANY
;
...
...
@@ -125,7 +125,7 @@ __kernel void filter2D_C1_D0(__global uchar *src, int src_step, int src_offset_x
{
if
((
rows_start_index
-
src_offset_y
)
+
i
<
rows
+
ANY
)
{
#
ifdef
BORDER_CONSTANT
#
ifdef
BORDER_CONSTANT
int
selected_row
=
rows_start_index
+
i
;
int
selected_cols
=
cols_start_index_group
+
lX
;
...
...
@@ -143,7 +143,7 @@ __kernel void filter2D_C1_D0(__global uchar *src, int src_step, int src_offset_x
data
=
con
?
data
:
0
;
local_data[i
*
LOCAL_MEM_STEP
+
lX
+
groupX_size]
=data
;
}
#
else
#
else
int
selected_row
=
ADDR_H
(
rows_start_index
+
i,
0
,
wholerows
)
;
selected_row
=
ADDR_B
(
rows_start_index
+
i,
wholerows,
selected_row
)
;
...
...
@@ -162,7 +162,7 @@ __kernel void filter2D_C1_D0(__global uchar *src, int src_step, int src_offset_x
data
=
*
(
src
+
selected_row
*
src_step
+
selected_cols
)
;
local_data[i
*
LOCAL_MEM_STEP
+
lX
+
groupX_size]
=data
;
}
#
endif
#
endif
}
}
}
...
...
@@ -185,17 +185,17 @@ __kernel void filter2D_C1_D0(__global uchar *src, int src_step, int src_offset_x
for
(
int
i
=
0
; i < ANCHOR; i++)
{
#
pragma
unroll
3
for
(
int
j
=
0
; j < ANCHOR; j++)
{
#
pragma
unroll
3
for
(
int
j
=
0
; j < ANCHOR; j++)
{
if
(
dst_rows_index
<
dst_rows_end
)
{
int
local_row
=
(
lX
>>
THREADS_PER_ROW_BIT
)
+
i
;
int
local_cols
=
((
lX
%
THREADS_PER_ROW
)
<<
ELEMENTS_PER_THREAD_BIT
)
+
j
;
int
local_row
=
(
lX
>>
THREADS_PER_ROW_BIT
)
+
i
;
int
local_cols
=
((
lX
%
THREADS_PER_ROW
)
<<
ELEMENTS_PER_THREAD_BIT
)
+
j
;
data
=
vload4
(
0
,
local_data+local_row
*
LOCAL_MEM_STEP
+
local_cols
)
;
sum
=
sum
+
(
mat_kernel[i
*
ANCHOR
+
j]
*
convert_int4_sat
(
data
))
;
}
data
=
vload4
(
0
,
local_data+local_row
*
LOCAL_MEM_STEP
+
local_cols
)
;
sum
=
sum
+
(
mat_kernel[i
*
ANCHOR
+
j]
*
convert_int4_sat
(
data
))
;
}
}
}
...
...
@@ -207,7 +207,7 @@ __kernel void filter2D_C1_D0(__global uchar *src, int src_step, int src_offset_x
sum.w
=
((
dst_cols_index
+
3
>=
dst_cols_start
)
&&
(
dst_cols_index
+
3
<
dst_cols_end
))
?
sum.w
:
dst_data.w
;
*
((
__global
uchar4
*
)(
dst
+
dst_rows_index
*
dst_step
+
dst_cols_index
))
=
convert_uchar4_sat
(
sum
)
;
}
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////32FC1////////////////////////////////////////////////////////
...
...
@@ -225,7 +225,7 @@ __kernel void filter2D_C1_D5(__global float *src, int src_step, int src_offset_x
int
groupX_size
=
get_local_size
(
0
)
;
int
groupX_id
=
get_group_id
(
0
)
;
#
define
dst_align
(
dst_offset_x
&
3
)
#
define
dst_align
(
dst_offset_x
&
3
)
int
cols_start_index_group
=
src_offset_x
-
dst_align
+
groupX_size
*
groupX_id
-
ANX
;
int
rows_start_index
=
src_offset_y
+
(
gY
<<
ROWS_PER_GROUP_BITS
)
-
ANY
;
...
...
@@ -236,7 +236,7 @@ __kernel void filter2D_C1_D5(__global float *src, int src_step, int src_offset_x
{
if
((
rows_start_index
-
src_offset_y
)
+
i
<
rows
+
ANY
)
{
#
ifdef
BORDER_CONSTANT
#
ifdef
BORDER_CONSTANT
int
selected_row
=
rows_start_index
+
i
;
int
selected_cols
=
cols_start_index_group
+
lX
;
...
...
@@ -254,7 +254,7 @@ __kernel void filter2D_C1_D5(__global float *src, int src_step, int src_offset_x
data
=
con
?
data
:
0
;
local_data[i
*
LOCAL_MEM_STEP
+
lX
+
groupX_size]
=data
;
}
#
else
#
else
int
selected_row
=
ADDR_H
(
rows_start_index
+
i,
0
,
wholerows
)
;
selected_row
=
ADDR_B
(
rows_start_index
+
i,
wholerows,
selected_row
)
;
...
...
@@ -272,7 +272,7 @@ __kernel void filter2D_C1_D5(__global float *src, int src_step, int src_offset_x
data
=
*
((
__global
float
*
)((
__global
char
*
)
src
+
selected_row
*
src_step
+
(
selected_cols
<<
2
)))
;
local_data[i
*
LOCAL_MEM_STEP
+
lX
+
groupX_size]
=data
;
}
#
endif
#
endif
}
}
}
...
...
@@ -295,17 +295,17 @@ __kernel void filter2D_C1_D5(__global float *src, int src_step, int src_offset_x
for
(
int
i
=
0
; i < ANCHOR; i++)
{
#
pragma
unroll
3
for
(
int
j
=
0
; j < ANCHOR; j++)
{
#
pragma
unroll
3
for
(
int
j
=
0
; j < ANCHOR; j++)
{
if
(
dst_rows_index
<
dst_rows_end
)
{
int
local_row
=
(
lX
>>
THREADS_PER_ROW_BIT
)
+
i
;
int
local_cols
=
((
lX
%
THREADS_PER_ROW
)
<<
ELEMENTS_PER_THREAD_BIT
)
+
j
;
int
local_row
=
(
lX
>>
THREADS_PER_ROW_BIT
)
+
i
;
int
local_cols
=
((
lX
%
THREADS_PER_ROW
)
<<
ELEMENTS_PER_THREAD_BIT
)
+
j
;
data
=
vload4
(
0
,
local_data+local_row
*
LOCAL_MEM_STEP
+
local_cols
)
;
sum
=
sum
+
(
mat_kernel[i
*
ANCHOR
+
j]
*
data
)
;
}
data
=
vload4
(
0
,
local_data+local_row
*
LOCAL_MEM_STEP
+
local_cols
)
;
sum
=
sum
+
((
float
)(
mat_kernel[i
*
ANCHOR
+
j]
)
*
data
)
;
}
}
}
...
...
@@ -318,7 +318,7 @@ __kernel void filter2D_C1_D5(__global float *src, int src_step, int src_offset_x
*
((
__global
float4
*
)((
__global
char
*
)
dst
+
dst_rows_index
*
dst_step
+
(
dst_cols_index
<<
2
)))
=
sum
;
}
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -337,7 +337,7 @@ __kernel void filter2D_C4_D0(__global uchar4 *src, int src_step, int src_offset_
int
groupX_size
=
get_local_size
(
0
)
;
int
groupX_id
=
get_group_id
(
0
)
;
#
define
dst_align
(
dst_offset_x
&
3
)
#
define
dst_align
(
dst_offset_x
&
3
)
int
cols_start_index_group
=
src_offset_x
-
dst_align
+
groupX_size
*
groupX_id
-
ANX
;
int
rows_start_index
=
src_offset_y
+
(
gY
<<
ROWS_PER_GROUP_BITS
)
-
ANY
;
...
...
@@ -349,7 +349,7 @@ __kernel void filter2D_C4_D0(__global uchar4 *src, int src_step, int src_offset_
{
if
((
rows_start_index
-
src_offset_y
)
+
i
<
rows
+
ANY
)
{
#
ifdef
BORDER_CONSTANT
#
ifdef
BORDER_CONSTANT
int
selected_row
=
rows_start_index
+
i
;
int
selected_cols
=
cols_start_index_group
+
lX
;
...
...
@@ -367,7 +367,7 @@ __kernel void filter2D_C4_D0(__global uchar4 *src, int src_step, int src_offset_
data
=
con
?
data
:
0
;
local_data[i
*
LOCAL_MEM_STEP
+
lX
+
groupX_size]
=data
;
}
#
else
#
else
int
selected_row
=
ADDR_H
(
rows_start_index
+
i,
0
,
wholerows
)
;
selected_row
=
ADDR_B
(
rows_start_index
+
i,
wholerows,
selected_row
)
;
...
...
@@ -386,7 +386,7 @@ __kernel void filter2D_C4_D0(__global uchar4 *src, int src_step, int src_offset_
data
=
*
((
__global
uchar4*
)((
__global
char*
)
src
+
selected_row
*
src_step
+
(
selected_cols
<<
2
)))
;
local_data[i
*
LOCAL_MEM_STEP
+
lX
+
groupX_size]
=data
;
}
#
endif
#
endif
}
}
}
...
...
@@ -410,17 +410,17 @@ __kernel void filter2D_C4_D0(__global uchar4 *src, int src_step, int src_offset_
for
(
int
i
=
0
; i < ANCHOR; i++)
{
#
pragma
unroll
3
for
(
int
j
=
0
; j < ANCHOR; j++)
{
#
pragma
unroll
3
for
(
int
j
=
0
; j < ANCHOR; j++)
{
if
(
dst_rows_index
<
dst_rows_end
)
{
int
local_row
=
(
lX
>>
THREADS_PER_ROW_BIT
)
+
i
;
int
local_cols
=
((
lX
%
THREADS_PER_ROW
)
<<
ELEMENTS_PER_THREAD_BIT
)
+
j
;
int
local_row
=
(
lX
>>
THREADS_PER_ROW_BIT
)
+
i
;
int
local_cols
=
((
lX
%
THREADS_PER_ROW
)
<<
ELEMENTS_PER_THREAD_BIT
)
+
j
;
data
=
vload16
(
0
,
(
__local
uchar
*
)(
local_data+local_row
*
LOCAL_MEM_STEP
+
local_cols
))
;
sum
=
sum
+
(
mat_kernel[i
*
ANCHOR
+
j]
*
convert_int16_sat
(
data
))
;
}
data
=
vload16
(
0
,
(
__local
uchar
*
)(
local_data+local_row
*
LOCAL_MEM_STEP
+
local_cols
))
;
sum
=
sum
+
(
mat_kernel[i
*
ANCHOR
+
j]
*
convert_int16_sat
(
data
))
;
}
}
}
...
...
@@ -468,7 +468,7 @@ __kernel void filter2D_C4_D5(__global float4 *src, int src_step, int src_offset_
{
if
((
rows_start_index
-
src_offset_y
)
+
i
<
rows
+
ANY
)
{
#
ifdef
BORDER_CONSTANT
#
ifdef
BORDER_CONSTANT
int
selected_row
=
rows_start_index
+
i
;
int
selected_cols
=
cols_start_index_group
+
lX
;
...
...
@@ -486,7 +486,7 @@ __kernel void filter2D_C4_D5(__global float4 *src, int src_step, int src_offset_
data
=
con
?
data
:
0
;
local_data[i
*
LOCAL_MEM_STEP
+
lX
+
groupX_size]
=data
;
}
#
else
#
else
int
selected_row
=
ADDR_H
(
rows_start_index
+
i,
0
,
wholerows
)
;
selected_row
=
ADDR_B
(
rows_start_index
+
i,
wholerows,
selected_row
)
;
...
...
@@ -504,7 +504,7 @@ __kernel void filter2D_C4_D5(__global float4 *src, int src_step, int src_offset_
data
=
*
((
__global
float4*
)((
__global
char*
)
src
+
selected_row
*
src_step
+
(
selected_cols
<<
4
)))
;
local_data[i
*
LOCAL_MEM_STEP_C4
+
lX
+
groupX_size]
=data
;
}
#
endif
#
endif
}
}
}
...
...
@@ -519,10 +519,10 @@ __kernel void filter2D_C4_D5(__global float4 *src, int src_step, int src_offset_
for
(
int
i
=
0
; i < ANCHOR; i++)
{
for
(
int
j
=
0
; j < ANCHOR; j++)
{
int
local_cols
=
lX
+
j
;
sum
=
sum
+
mat_kernel[i
*
ANCHOR
+
j]
*
local_data[i
*
LOCAL_MEM_STEP_C4
+
local_cols]
;
for
(
int
j
=
0
; j < ANCHOR; j++)
{
int
local_cols
=
lX
+
j
;
sum
=
sum
+
((
float
)
mat_kernel[i
*
ANCHOR
+
j]
*
local_data[i
*
LOCAL_MEM_STEP_C4
+
local_cols]
)
;
}
}
...
...
modules/ocl/src/opencl/imgproc_integral.cl
浏览文件 @
3b364330
...
...
@@ -44,7 +44,11 @@
//M*/
#
if
defined
(
DOUBLE_SUPPORT
)
#
ifdef
cl_khr_fp64
#
pragma
OPENCL
EXTENSION
cl_khr_fp64:enable
#
elif
defined
(
cl_amd_fp64
)
#
pragma
OPENCL
EXTENSION
cl_amd_fp64:enable
#
endif
#
endif
#
define
LSIZE
256
#
define
LSIZE_1
255
...
...
@@ -71,13 +75,13 @@ kernel void integral_cols(__global uchar4 *src,__global int *sum ,__global float
gid
=
gid
<<
1
;
for
(
int
i
=
0
; i < rows; i =i + LSIZE_1)
{
src_t[0]
=
(
i
+
lid
<
rows
?
convert_int4
(
src[src_offset
+
(
lid+i
)
*
src_step
+
gid
]
)
:
0
)
;
src_t[1]
=
(
i
+
lid
<
rows
?
convert_int4
(
src[src_offset
+
(
lid+i
)
*
src_step
+
gid
+
1
]
)
:
0
)
;
src_t[0]
=
(
i
+
lid
<
rows
?
convert_int4
(
src[src_offset
+
(
lid+i
)
*
src_step
+
min
(
gid,
(
uint
)
cols
-
1
)
]
)
:
0
)
;
src_t[1]
=
(
i
+
lid
<
rows
?
convert_int4
(
src[src_offset
+
(
lid+i
)
*
src_step
+
min
(
gid
+
1
,
(
uint
)
cols
-
1
)
]
)
:
0
)
;
sum_t[0]
=
(
i
==
0
?
0
:
lm_sum[0][LSIZE_2
+
LOG_LSIZE]
)
;
sqsum_t[0]
=
(
i
==
0
?
0
:
lm_sqsum[0][LSIZE_2
+
LOG_LSIZE]
)
;
sqsum_t[0]
=
(
i
==
0
?
(
float4
)
0
:
lm_sqsum[0][LSIZE_2
+
LOG_LSIZE]
)
;
sum_t[1]
=
(
i
==
0
?
0
:
lm_sum[1][LSIZE_2
+
LOG_LSIZE]
)
;
sqsum_t[1]
=
(
i
==
0
?
0
:
lm_sqsum[1][LSIZE_2
+
LOG_LSIZE]
)
;
sqsum_t[1]
=
(
i
==
0
?
(
float4
)
0
:
lm_sqsum[1][LSIZE_2
+
LOG_LSIZE]
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
int
bf_loc
=
lid
+
GET_CONFLICT_OFFSET
(
lid
)
;
...
...
@@ -127,7 +131,8 @@ kernel void integral_cols(__global uchar4 *src,__global int *sum ,__global float
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
int
loc_s0
=
gid
*
dst_step
+
i
+
lid
-
1
-
pre_invalid
*
dst_step
/
4
,
loc_s1
=
loc_s0
+
dst_step
;
if
(
lid
>
0
&&
(
i+lid
)
<=
rows
)
{
if
(
lid
>
0
&&
(
i+lid
)
<=
rows
)
{
lm_sum[0][bf_loc]
+=
sum_t[0]
;
lm_sum[1][bf_loc]
+=
sum_t[1]
;
lm_sqsum[0][bf_loc]
+=
sqsum_t[0]
;
...
...
@@ -169,15 +174,15 @@ kernel void integral_rows(__global int4 *srcsum,__global float4 * srcsqsum,__glo
src_step
=
src_step
>>
4
;
for
(
int
i
=
0
; i < rows; i =i + LSIZE_1)
{
src_t[0]
=
i
+
lid
<
rows
?
srcsum[
(
lid+i
)
*
src_step
+
gid
*
2]
:
0
;
sqsrc_t[0]
=
i
+
lid
<
rows
?
srcsqsum[
(
lid+i
)
*
src_step
+
gid
*
2]
:
0
;
src_t[1]
=
i
+
lid
<
rows
?
srcsum[
(
lid+i
)
*
src_step
+
gid
*
2
+
1]
:
0
;
sqsrc_t[1]
=
i
+
lid
<
rows
?
srcsqsum[
(
lid+i
)
*
src_step
+
gid
*
2
+
1]
:
0
;
src_t[0]
=
i
+
lid
<
rows
?
srcsum[
(
lid+i
)
*
src_step
+
gid
*
2]
:
(
int4
)
0
;
sqsrc_t[0]
=
i
+
lid
<
rows
?
srcsqsum[
(
lid+i
)
*
src_step
+
gid
*
2]
:
(
float4
)
0
;
src_t[1]
=
i
+
lid
<
rows
?
srcsum[
(
lid+i
)
*
src_step
+
gid
*
2
+
1]
:
(
int4
)
0
;
sqsrc_t[1]
=
i
+
lid
<
rows
?
srcsqsum[
(
lid+i
)
*
src_step
+
gid
*
2
+
1]
:
(
float4
)
0
;
sum_t[0]
=
(
i
==
0
?
0
:
lm_sum[0][LSIZE_2
+
LOG_LSIZE]
)
;
sqsum_t[0]
=
(
i
==
0
?
0
:
lm_sqsum[0][LSIZE_2
+
LOG_LSIZE]
)
;
sqsum_t[0]
=
(
i
==
0
?
(
float4
)
0
:
lm_sqsum[0][LSIZE_2
+
LOG_LSIZE]
)
;
sum_t[1]
=
(
i
==
0
?
0
:
lm_sum[1][LSIZE_2
+
LOG_LSIZE]
)
;
sqsum_t[1]
=
(
i
==
0
?
0
:
lm_sqsum[1][LSIZE_2
+
LOG_LSIZE]
)
;
sqsum_t[1]
=
(
i
==
0
?
(
float4
)
0
:
lm_sqsum[1][LSIZE_2
+
LOG_LSIZE]
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
int
bf_loc
=
lid
+
GET_CONFLICT_OFFSET
(
lid
)
;
...
...
@@ -228,14 +233,14 @@ kernel void integral_rows(__global int4 *srcsum,__global float4 * srcsqsum,__glo
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
gid
==
0
&&
(
i
+
lid
)
<=
rows
)
{
sum[sum_offset
+
i
+
lid]
=
0
;
sqsum[sqsum_offset
+
i
+
lid]
=
0
;
sum[sum_offset
+
i
+
lid]
=
0
;
sqsum[sqsum_offset
+
i
+
lid]
=
0
;
}
if
(
i
+
lid
==
0
)
{
int
loc0
=
gid
*
2
*
sum_step
;
int
loc1
=
gid
*
2
*
sqsum_step
;
for
(
int
k
=
1
;
k <= 8;
k++)
for
(
int
k
=
1
;
k <= 8;
k++)
{
if
(
gid
*
8
+
k
>
cols
)
break
;
sum[sum_offset
+
loc0
+
k
*
sum_step
/
4]
=
0
;
...
...
@@ -244,7 +249,8 @@ kernel void integral_rows(__global int4 *srcsum,__global float4 * srcsqsum,__glo
}
int
loc_s0
=
sum_offset
+
gid
*
2
*
sum_step
+
sum_step
/
4
+
i
+
lid,
loc_s1
=
loc_s0
+
sum_step
;
int
loc_sq0
=
sqsum_offset
+
gid
*
2
*
sqsum_step
+
sqsum_step
/
4
+
i
+
lid,
loc_sq1
=
loc_sq0
+
sqsum_step
;
if
(
lid
>
0
&&
(
i+lid
)
<=
rows
)
{
if
(
lid
>
0
&&
(
i+lid
)
<=
rows
)
{
lm_sum[0][bf_loc]
+=
sum_t[0]
;
lm_sum[1][bf_loc]
+=
sum_t[1]
;
lm_sqsum[0][bf_loc]
+=
sqsum_t[0]
;
...
...
modules/ocl/src/opencl/imgproc_warpAffine.cl
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/imgproc_warpPerspective.cl
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/match_template.cl
浏览文件 @
3b364330
...
...
@@ -447,10 +447,10 @@ void matchTemplate_Naive_CCORR_C1_D0
__global
const
uchar
*
tpl_ptr
=
tpl
+
mad24
(
i,
tpl_step,
tpl_offset
)
;
for
(
j
=
0
; j < tpl_cols; j ++)
{
sum
=
mad24
(
img_ptr[j],
tpl_ptr[j]
,
sum
)
;
sum
=
mad24
(
convert_int
(
img_ptr[j]
)
,
convert_int
(
tpl_ptr[j]
)
,
sum
)
;
}
}
res[res_idx]
=
sum
;
res[res_idx]
=
(
float
)
sum
;
}
}
...
...
@@ -548,7 +548,7 @@ void matchTemplate_Naive_CCORR_C4_D0
sum
=
mad24
(
convert_int4
(
img_ptr[j]
)
,
convert_int4
(
tpl_ptr[j]
)
,
sum
)
;
}
}
res[res_idx]
=
sum.x
+
sum.y
+
sum.z
+
sum.w
;
res[res_idx]
=
(
float
)(
sum.x
+
sum.y
+
sum.z
+
sum.w
)
;
}
}
...
...
@@ -633,9 +633,8 @@ void matchTemplate_Prepared_CCOFF_C1_D0
if
(
gidx
<
res_cols
&&
gidy
<
res_rows
)
{
float
sum
=
(
float
)(
(
img_sums[SUMS_PTR
(
tpl_cols,
tpl_rows
)
]
-
img_sums[SUMS_PTR
(
tpl_cols,
0
)
]
)
-
(
img_sums[SUMS_PTR
(
0
,
tpl_rows
)
]
-
img_sums[SUMS_PTR
(
0
,
0
)
]
))
;
float
sum
=
(
float
)((
img_sums[SUMS_PTR
(
tpl_cols,
tpl_rows
)
]
-
img_sums[SUMS_PTR
(
tpl_cols,
0
)
]
)
-
(
img_sums[SUMS_PTR
(
0
,
tpl_rows
)
]
-
img_sums[SUMS_PTR
(
0
,
0
)
]
))
;
res[res_idx]
-=
sum
*
tpl_sum
;
}
}
...
...
modules/ocl/src/opencl/objdetect_hog.cl
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/pyrlk.cl
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/src/opencl/stereobm.cl
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/test/main.cpp
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/test/test_arithm.cpp
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ocl/test/test_brute_force_matcher.cpp
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/src2/cv.py
100755 → 100644
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/src2/cv2.cpp
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/src2/gen.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/src2/gen2.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/src2/hdr_parser.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/calchist.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/camera_calibration.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/findstereocorrespondence.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/goodfeatures.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/leak1.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/leak2.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/leak3.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/leak4.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/precornerdetect.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/test.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/test2.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/ticket_6.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/tickets.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/python/test/transformations.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
modules/ts/misc/testlog_parser.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
samples/android/15-puzzle/res/layout/activity_puzzle15.xml
已删除
100644 → 0
浏览文件 @
b0933dd4
此差异已折叠。
点击以展开。
samples/android/15-puzzle/res/menu/activity_puzzle15.xml
已删除
100644 → 0
浏览文件 @
b0933dd4
此差异已折叠。
点击以展开。
samples/android/15-puzzle/src/org/opencv/samples/puzzle15/Puzzle15Activity.java
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
samples/android/native-activity/jni/Android.mk
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
samples/android/native-activity/jni/Application.mk
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
samples/cpp/freak_demo.cpp
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
samples/cpp/lkdemo.cpp
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
samples/python2/common.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
samples/python2/dft.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
samples/python2/watershed.py
浏览文件 @
3b364330
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录