Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
67ce03d7
Commit
67ce03d7
authored
Dec 10, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 2.4
parents
49e038c7
60ad505a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
321 additions
and
100 deletions
+321
-100
CMakeLists.txt
android/service/engine/CMakeLists.txt
+1
-1
build.xml
android/service/engine/build.xml
+1
-1
Android.mk
android/service/engine/jni/Android.mk
+2
-1
OpenCVLibraryInfo.cpp
android/service/engine/jni/JNIWrapper/OpenCVLibraryInfo.cpp
+88
-0
OpenCVLibraryInfo.h
android/service/engine/jni/JNIWrapper/OpenCVLibraryInfo.h
+27
-0
CommonPackageManager.cpp
...service/engine/jni/NativeService/CommonPackageManager.cpp
+31
-35
PackageInfo.cpp
android/service/engine/jni/NativeService/PackageInfo.cpp
+12
-1
project.properties
android/service/engine/project.properties
+1
-1
MarketConnector.java
...service/engine/src/org/opencv/engine/MarketConnector.java
+6
-10
OpenCVLibraryInfo.java
...rvice/engine/src/org/opencv/engine/OpenCVLibraryInfo.java
+40
-0
ManagerActivity.java
...engine/src/org/opencv/engine/manager/ManagerActivity.java
+77
-14
OpenCVDetectOpenCL.cmake
cmake/OpenCVDetectOpenCL.cmake
+1
-1
cap_ffmpeg.cpp
modules/highgui/src/cap_ffmpeg.cpp
+10
-16
grfmt_jpeg.cpp
modules/highgui/src/grfmt_jpeg.cpp
+9
-5
perf_houghLines.cpp
modules/imgproc/perf/perf_houghLines.cpp
+15
-3
ts.hpp
modules/ts/include/opencv2/ts/ts.hpp
+0
-11
ts_gtest.h
modules/ts/include/opencv2/ts/ts_gtest.h
+0
-0
ts_gtest.cpp
modules/ts/src/ts_gtest.cpp
+0
-0
No files found.
android/service/engine/CMakeLists.txt
View file @
67ce03d7
...
...
@@ -2,7 +2,7 @@ set(engine OpenCVEngine)
set
(
JNI_LIB_NAME
${
engine
}
${
engine
}
_jni
)
unset
(
__android_project_chain CACHE
)
add_android_project
(
opencv_engine
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
SDK_TARGET
8
${
ANDROID_SDK_TARGET
}
IGNORE_JAVA ON IGNORE_MANIFEST ON
)
add_android_project
(
opencv_engine
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
SDK_TARGET
9
${
ANDROID_SDK_TARGET
}
IGNORE_JAVA ON IGNORE_MANIFEST ON
)
set
(
ANDROID_PLATFORM_VERSION_CODE
"0"
)
...
...
android/service/engine/build.xml
View file @
67ce03d7
<?xml version="1.0" encoding="UTF-8"?>
<project
name=
"
ManagerActivity
"
default=
"help"
>
<project
name=
"
OpenCV Manager
"
default=
"help"
>
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
...
...
android/service/engine/jni/Android.mk
View file @
67ce03d7
...
...
@@ -52,7 +52,8 @@ LOCAL_SRC_FILES := \
NativeService/CommonPackageManager.cpp \
JNIWrapper/JavaBasedPackageManager.cpp \
NativeService/PackageInfo.cpp \
JNIWrapper/HardwareDetector_jni.cpp
JNIWrapper/HardwareDetector_jni.cpp \
JNIWrapper/OpenCVLibraryInfo.cpp
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
...
...
android/service/engine/jni/JNIWrapper/OpenCVLibraryInfo.cpp
0 → 100644
View file @
67ce03d7
#include "OpenCVLibraryInfo.h"
#include "EngineCommon.h"
#include <utils/Log.h>
#include <dlfcn.h>
JNIEXPORT
jlong
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_open
(
JNIEnv
*
env
,
jobject
,
jstring
str
)
{
const
char
*
infoLibPath
=
env
->
GetStringUTFChars
(
str
,
NULL
);
if
(
infoLibPath
==
NULL
)
return
0
;
LOGD
(
"Trying to load info library
\"
%s
\"
"
,
infoLibPath
);
void
*
handle
;
handle
=
dlopen
(
infoLibPath
,
RTLD_LAZY
);
if
(
handle
==
NULL
)
LOGI
(
"Info library not found by path
\"
%s
\"
"
,
infoLibPath
);
return
(
jlong
)
handle
;
}
JNIEXPORT
jstring
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_getPackageName
(
JNIEnv
*
env
,
jobject
,
jlong
handle
)
{
const
char
*
(
*
info_func
)();
const
char
*
result
;
const
char
*
error
;
dlerror
();
*
(
void
**
)
(
&
info_func
)
=
dlsym
((
void
*
)
handle
,
"GetPackageName"
);
if
((
error
=
dlerror
())
==
NULL
)
result
=
(
*
info_func
)();
else
{
LOGE
(
"dlsym error:
\"
%s
\"
"
,
error
);
result
=
"unknown"
;
}
return
env
->
NewStringUTF
(
result
);
}
JNIEXPORT
jstring
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_getLibraryList
(
JNIEnv
*
env
,
jobject
,
jlong
handle
)
{
const
char
*
(
*
info_func
)();
const
char
*
result
;
const
char
*
error
;
dlerror
();
*
(
void
**
)
(
&
info_func
)
=
dlsym
((
void
*
)
handle
,
"GetLibraryList"
);
if
((
error
=
dlerror
())
==
NULL
)
result
=
(
*
info_func
)();
else
{
LOGE
(
"dlsym error:
\"
%s
\"
"
,
error
);
result
=
"unknown"
;
}
return
env
->
NewStringUTF
(
result
);
}
JNIEXPORT
jstring
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_getVersionName
(
JNIEnv
*
env
,
jobject
,
jlong
handle
)
{
const
char
*
(
*
info_func
)();
const
char
*
result
;
const
char
*
error
;
dlerror
();
*
(
void
**
)
(
&
info_func
)
=
dlsym
((
void
*
)
handle
,
"GetRevision"
);
if
((
error
=
dlerror
())
==
NULL
)
result
=
(
*
info_func
)();
else
{
LOGE
(
"dlsym error:
\"
%s
\"
"
,
error
);
result
=
"unknown"
;
}
return
env
->
NewStringUTF
(
result
);
}
JNIEXPORT
void
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_close
(
JNIEnv
*
,
jobject
,
jlong
handle
)
{
dlclose
((
void
*
)
handle
);
}
android/service/engine/jni/JNIWrapper/OpenCVLibraryInfo.h
0 → 100644
View file @
67ce03d7
#include <jni.h>
#ifndef _Included_org_opencv_engine_OpenCVLibraryInfo
#define _Included_org_opencv_engine_OpenCVLibraryInfo
#ifdef __cplusplus
extern
"C"
{
#endif
JNIEXPORT
jlong
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_open
(
JNIEnv
*
,
jobject
,
jstring
);
JNIEXPORT
jstring
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_getPackageName
(
JNIEnv
*
,
jobject
,
jlong
);
JNIEXPORT
jstring
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_getLibraryList
(
JNIEnv
*
,
jobject
,
jlong
);
JNIEXPORT
jstring
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_getVersionName
(
JNIEnv
*
,
jobject
,
jlong
);
JNIEXPORT
void
JNICALL
Java_org_opencv_engine_OpenCVLibraryInfo_close
(
JNIEnv
*
,
jobject
,
jlong
);
#ifdef __cplusplus
}
#endif
#endif
android/service/engine/jni/NativeService/CommonPackageManager.cpp
View file @
67ce03d7
...
...
@@ -78,49 +78,45 @@ string CommonPackageManager::GetPackagePathByVersion(const std::string& version,
if
(
!
packages
.
empty
())
{
vector
<
PackageInfo
>::
iterator
found
=
find
(
packages
.
begin
(),
packages
.
end
(),
target_package
);
if
(
packages
.
end
()
!=
found
)
int
OptRating
=
-
1
;
std
::
string
OptVersion
=
""
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>&
group
=
CommonPackageManager
::
ArmRating
;
if
((
cpu_id
&
ARCH_X86
)
||
(
cpu_id
&
ARCH_X64
))
group
=
CommonPackageManager
::
IntelRating
;
int
HardwareRating
=
GetHardwareRating
(
platform
,
cpu_id
,
group
);
LOGD
(
"Current hardware platform rating %d for (%d,%d)"
,
HardwareRating
,
platform
,
cpu_id
);
if
(
-
1
==
HardwareRating
)
{
result
=
found
->
GetInstalationPath
(
);
LOGE
(
"Cannot calculate rating for current hardware platform!"
);
}
else
{
int
OptRating
=
-
1
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>&
group
=
CommonPackageManager
::
ArmRating
;
if
((
cpu_id
&
ARCH_X86
)
||
(
cpu_id
&
ARCH_X64
))
group
=
CommonPackageManager
::
IntelRating
;
int
HardwareRating
=
GetHardwareRating
(
platform
,
cpu_id
,
group
);
LOGD
(
"Current hardware platform %d, %d"
,
platform
,
cpu_id
);
if
(
-
1
==
HardwareRating
)
{
LOGE
(
"Cannot calculate rating for current hardware platform!"
);
}
else
vector
<
PackageInfo
>::
iterator
found
=
packages
.
end
();
for
(
vector
<
PackageInfo
>::
iterator
it
=
packages
.
begin
();
it
!=
packages
.
end
();
++
it
)
{
for
(
vector
<
PackageInfo
>::
iterator
it
=
packages
.
begin
();
it
!=
packages
.
end
();
++
it
)
int
PackageRating
=
GetHardwareRating
(
it
->
GetPlatform
(),
it
->
GetCpuID
(),
group
);
LOGD
(
"Package
\"
%s
\"
rating %d for (%d,%d)"
,
it
->
GetFullName
().
c_str
(),
PackageRating
,
it
->
GetPlatform
(),
it
->
GetCpuID
());
if
((
PackageRating
>=
0
)
&&
(
PackageRating
<=
HardwareRating
))
{
int
PackageRating
=
GetHardwareRating
(
it
->
GetPlatform
(),
it
->
GetCpuID
(),
group
);
if
(
PackageRating
>=
0
)
if
(((
it
->
GetVersion
()
>=
OptVersion
)
&&
(
PackageRating
>=
OptRating
))
||
(
it
->
GetVersion
()
>
OptVersion
))
{
if
((
PackageRating
<=
HardwareRating
)
&&
(
PackageRating
>
OptRating
))
{
OptRating
=
PackageRating
;
found
=
it
;
}
OptRating
=
PackageRating
;
OptVersion
=
it
->
GetVersion
();
found
=
it
;
}
}
}
if
((
-
1
!=
OptRating
)
&&
(
packages
.
end
()
!=
found
))
{
result
=
found
->
GetInstalationPath
();
}
else
{
LOGI
(
"Found package is incompatible with current hardware platform"
);
}
if
((
-
1
!=
OptRating
)
&&
(
packages
.
end
()
!=
found
))
{
result
=
found
->
GetInstalationPath
();
}
else
{
LOGI
(
"Found package is incompatible with current hardware platform"
);
}
}
}
...
...
@@ -171,14 +167,14 @@ std::vector<std::pair<int, int> > CommonPackageManager::InitArmRating()
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv6
|
FEATURES_HAS_VFPv3
|
FEATURES_HAS_VFPv3d16
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv7
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3d16
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_TEGRA2
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3d16
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3d16
|
FEATURES_HAS_VFPv3
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv7
|
FEATURES_HAS_NEON
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3d16
|
FEATURES_HAS_NEON
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3
|
FEATURES_HAS_NEON
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_UNKNOWN
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3
|
FEATURES_HAS_VFPv3d16
|
FEATURES_HAS_NEON
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_TEGRA2
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3d16
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_TEGRA3
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3
|
FEATURES_HAS_NEON
));
result
.
push_back
(
std
::
pair
<
int
,
int
>
(
PLATFORM_TEGRA3
,
ARCH_ARMv7
|
FEATURES_HAS_VFPv3
|
FEATURES_HAS_NEON
));
return
result
;
}
...
...
android/service/engine/jni/NativeService/PackageInfo.cpp
View file @
67ce03d7
...
...
@@ -197,6 +197,7 @@ InstallPath("")
#ifndef __SUPPORT_TEGRA3
Platform
=
PLATFORM_UNKNOWN
;
#endif
FullName
=
BasePackageName
+
"_v"
+
Version
.
substr
(
0
,
Version
.
size
()
-
1
);
if
(
PLATFORM_UNKNOWN
!=
Platform
)
{
...
...
@@ -392,7 +393,17 @@ InstallPath(install_path)
Platform
=
SplitPlatfrom
(
features
);
if
(
PLATFORM_UNKNOWN
!=
Platform
)
{
CpuID
=
0
;
switch
(
Platform
)
{
case
PLATFORM_TEGRA2
:
{
CpuID
=
ARCH_ARMv7
|
FEATURES_HAS_VFPv3d16
;
}
break
;
case
PLATFORM_TEGRA3
:
{
CpuID
=
ARCH_ARMv7
|
FEATURES_HAS_VFPv3
|
FEATURES_HAS_NEON
;
}
break
;
}
}
else
{
...
...
android/service/engine/project.properties
View file @
67ce03d7
...
...
@@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target
=
android-
8
target
=
android-
9
android/service/engine/src/org/opencv/engine/MarketConnector.java
View file @
67ce03d7
...
...
@@ -20,8 +20,6 @@ public class MarketConnector
private
static
final
String
TAG
=
"OpenCVEngine/MarketConnector"
;
protected
Context
mContext
;
public
boolean
mIncludeManager
=
true
;
public
MarketConnector
(
Context
context
)
{
mContext
=
context
;
...
...
@@ -100,15 +98,13 @@ public class MarketConnector
{
List
<
PackageInfo
>
AllPackages
=
mContext
.
getPackageManager
().
getInstalledPackages
(
PackageManager
.
GET_CONFIGURATIONS
);
List
<
PackageInfo
>
OpenCVPackages
=
new
ArrayList
<
PackageInfo
>();
if
(
mIncludeManager
)
{
try
{
OpenCVPackages
.
add
(
mContext
.
getPackageManager
().
getPackageInfo
(
"org.opencv.engine"
,
PackageManager
.
GET_CONFIGURATIONS
));
}
catch
(
NameNotFoundException
e
)
{
Log
.
e
(
TAG
,
"OpenCV Manager package info was not found!"
);
e
.
printStackTrace
();
}
try
{
OpenCVPackages
.
add
(
mContext
.
getPackageManager
().
getPackageInfo
(
"org.opencv.engine"
,
PackageManager
.
GET_CONFIGURATIONS
));
}
catch
(
NameNotFoundException
e
)
{
Log
.
e
(
TAG
,
"OpenCV Manager package info was not found!"
);
e
.
printStackTrace
();
}
Iterator
<
PackageInfo
>
it
=
AllPackages
.
iterator
();
while
(
it
.
hasNext
())
{
...
...
android/service/engine/src/org/opencv/engine/OpenCVLibraryInfo.java
0 → 100644
View file @
67ce03d7
package
org
.
opencv
.
engine
;
public
class
OpenCVLibraryInfo
{
public
OpenCVLibraryInfo
(
String
packagePath
)
{
mNativeObj
=
open
(
packagePath
+
"/libopencv_info.so"
);
if
(
mNativeObj
!=
0
)
{
mPackageName
=
getPackageName
(
mNativeObj
);
mLibraryList
=
getLibraryList
(
mNativeObj
);
mVersionName
=
getVersionName
(
mNativeObj
);
close
(
mNativeObj
);
}
}
public
boolean
status
()
{
return
(
mNativeObj
!=
0
);
}
public
String
packageName
()
{
return
mPackageName
;
}
public
String
libraryList
()
{
return
mLibraryList
;
}
public
String
versionName
()
{
return
mVersionName
;
}
private
long
mNativeObj
;
private
String
mPackageName
;
private
String
mLibraryList
;
private
String
mVersionName
;
private
native
long
open
(
String
packagePath
);
private
native
String
getPackageName
(
long
obj
);
private
native
String
getLibraryList
(
long
obj
);
private
native
String
getVersionName
(
long
obj
);
private
native
void
close
(
long
obj
);
}
android/service/engine/src/org/opencv/engine/manager/ManagerActivity.java
View file @
67ce03d7
...
...
@@ -7,7 +7,9 @@ import java.util.StringTokenizer;
import
org.opencv.engine.HardwareDetector
;
import
org.opencv.engine.MarketConnector
;
import
org.opencv.engine.OpenCVEngineInterface
;
import
org.opencv.engine.OpenCVLibraryInfo
;
import
org.opencv.engine.R
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.content.BroadcastReceiver
;
...
...
@@ -77,7 +79,7 @@ public class ManagerActivity extends Activity
{
HardwarePlatformView
.
setText
(
"Tegra"
);
}
else
if
(
HardwareDetector
.
PLATFORM_TEGRA
==
Platfrom
)
else
if
(
HardwareDetector
.
PLATFORM_TEGRA
2
==
Platfrom
)
{
HardwarePlatformView
.
setText
(
"Tegra 2"
);
}
...
...
@@ -170,9 +172,13 @@ public class ManagerActivity extends Activity
mInstalledPackageView
.
setOnItemClickListener
(
new
OnItemClickListener
()
{
public
void
onItemClick
(
AdapterView
<?>
arg0
,
View
arg1
,
int
arg2
,
long
id
)
{
mInstalledPackageView
.
setTag
(
Integer
.
valueOf
((
int
)
id
));
mActionDialog
.
show
();
public
void
onItemClick
(
AdapterView
<?>
adapter
,
View
view
,
int
position
,
long
id
)
{
//if (!mListViewItems.get((int) id).get("Name").equals("Built-in OpenCV library"));
if
(!
mInstalledPackageInfo
[(
int
)
id
].
packageName
.
equals
(
"org.opencv.engine"
))
{
mInstalledPackageView
.
setTag
(
Integer
.
valueOf
((
int
)
id
));
mActionDialog
.
show
();
}
}
});
...
...
@@ -232,8 +238,6 @@ public class ManagerActivity extends Activity
protected
class
OpenCVEngineServiceConnection
implements
ServiceConnection
{
public
void
onServiceDisconnected
(
ComponentName
name
)
{
// TODO Auto-generated method stub
}
public
void
onServiceConnected
(
ComponentName
name
,
IBinder
service
)
{
...
...
@@ -266,23 +270,58 @@ public class ManagerActivity extends Activity
}
};
@TargetApi
(
Build
.
VERSION_CODES
.
GINGERBREAD
)
synchronized
protected
void
FillPackageList
()
{
synchronized
(
mListViewItems
)
{
mMarket
.
mIncludeManager
=
false
;
mInstalledPackageInfo
=
mMarket
.
GetInstalledOpenCVPackages
();
mListViewItems
.
clear
();
for
(
int
i
=
0
;
i
<
mInstalledPackageInfo
.
length
;
i
++)
int
RealPackageCount
=
mInstalledPackageInfo
.
length
;
for
(
int
i
=
0
;
i
<
RealPackageCount
;
i
++)
{
if
(
mInstalledPackageInfo
[
i
]
==
null
)
break
;
// Convert to Items for package list view
HashMap
<
String
,
String
>
temp
=
new
HashMap
<
String
,
String
>();
String
HardwareName
=
""
;
String
NativeLibDir
=
""
;
String
OpenCVersion
=
""
;
String
PublicName
=
mMarket
.
GetApplicationName
(
mInstalledPackageInfo
[
i
].
applicationInfo
);
String
PackageName
=
mInstalledPackageInfo
[
i
].
packageName
;
String
VersionName
=
mInstalledPackageInfo
[
i
].
versionName
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
GINGERBREAD
)
NativeLibDir
=
mInstalledPackageInfo
[
i
].
applicationInfo
.
nativeLibraryDir
;
else
NativeLibDir
=
"/data/data/"
+
mInstalledPackageInfo
[
i
].
packageName
+
"/lib"
;
OpenCVLibraryInfo
NativeInfo
=
new
OpenCVLibraryInfo
(
NativeLibDir
);
if
(
PackageName
.
equals
(
"org.opencv.engine"
))
{
if
(
NativeInfo
.
status
())
{
PublicName
=
"Built-in OpenCV library"
;
PackageName
=
NativeInfo
.
packageName
();
VersionName
=
NativeInfo
.
versionName
();
}
else
{
mInstalledPackageInfo
[
i
]
=
mInstalledPackageInfo
[
RealPackageCount
-
1
];
mInstalledPackageInfo
[
RealPackageCount
-
1
]
=
null
;
RealPackageCount
--;
i
--;
continue
;
}
}
int
idx
=
0
;
String
OpenCVersion
=
"unknown"
;
String
HardwareName
=
""
;
StringTokenizer
tokenizer
=
new
StringTokenizer
(
mInstalledPackageInfo
[
i
].
packageName
,
"_"
);
Log
.
d
(
TAG
,
PackageName
);
StringTokenizer
tokenizer
=
new
StringTokenizer
(
PackageName
,
"_"
);
while
(
tokenizer
.
hasMoreTokens
())
{
if
(
idx
==
1
)
...
...
@@ -303,6 +342,7 @@ public class ManagerActivity extends Activity
}
String
ActivePackagePath
;
String
Tags
=
null
;
ActivePackagePath
=
mActivePackageMap
.
get
(
OpenCVersion
);
Log
.
d
(
TAG
,
OpenCVersion
+
" -> "
+
ActivePackagePath
);
...
...
@@ -313,7 +353,7 @@ public class ManagerActivity extends Activity
if
(
start
>=
0
&&
ActivePackagePath
.
charAt
(
stop
)
==
'/'
)
{
temp
.
put
(
"Activity"
,
"y"
);
PublicName
+=
" (in use)
"
;
Tags
=
"active
"
;
}
else
{
...
...
@@ -325,9 +365,32 @@ public class ManagerActivity extends Activity
temp
.
put
(
"Activity"
,
"n"
);
}
temp
.
put
(
"Version"
,
NormalizeVersion
(
OpenCVersion
,
VersionName
));
// HACK: OpenCV Manager for Armv7-a Neon already has Tegra3 optimizations
// that is enabled on proper hardware
if
(
HardwareDetector
.
DetectKnownPlatforms
()
==
HardwareDetector
.
PLATFORM_TEGRA3
&&
HardwareName
.
equals
(
"armv7a neon "
)
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
GINGERBREAD
)
{
temp
.
put
(
"Hardware"
,
"Tegra 3"
);
if
(
Tags
==
null
)
{
Tags
=
"optimized"
;
}
else
{
Tags
=
Tags
+
", optimized"
;
}
}
else
{
temp
.
put
(
"Hardware"
,
HardwareName
);
}
if
(
Tags
!=
null
)
PublicName
=
PublicName
+
" ("
+
Tags
+
")"
;
temp
.
put
(
"Name"
,
PublicName
);
temp
.
put
(
"Version"
,
NormalizeVersion
(
OpenCVersion
,
mInstalledPackageInfo
[
i
].
versionName
));
temp
.
put
(
"Hardware"
,
HardwareName
);
mListViewItems
.
add
(
temp
);
}
...
...
cmake/OpenCVDetectOpenCL.cmake
View file @
67ce03d7
...
...
@@ -27,7 +27,7 @@ else()
else
()
set
(
OPENCL_LIB_SEARCH_PATH
${
OPENCL_LIB_SEARCH_PATH
}
${
ENV_AMDSTREAMSDKROOT
}
/lib/x86_64
)
endif
()
elseif
(
ENV_CUDAPATH AND WIN32
)
elseif
(
ENV_CUDA
_
PATH AND WIN32
)
set
(
OPENCL_INCLUDE_SEARCH_PATH
${
ENV_CUDA_PATH
}
/include
)
if
(
CMAKE_SIZEOF_VOID_P EQUAL 4
)
set
(
OPENCL_LIB_SEARCH_PATH
${
OPENCL_LIB_SEARCH_PATH
}
${
ENV_CUDA_PATH
}
/lib/Win32
)
...
...
modules/highgui/src/cap_ffmpeg.cpp
View file @
67ce03d7
...
...
@@ -114,24 +114,18 @@ private:
icvWriteFrame_FFMPEG_p
=
(
CvWriteFrame_Plugin
)
GetProcAddress
(
icvFFOpenCV
,
"cvWriteFrame_FFMPEG"
);
#if 0
if( icvCreateFileCapture_FFMPEG_p != 0 &&
icvReleaseCapture_FFMPEG_p != 0 &&
icvGrabFrame_FFMPEG_p != 0 &&
icvRetrieveFrame_FFMPEG_p != 0 &&
icvSetCaptureProperty_FFMPEG_p != 0 &&
icvGetCaptureProperty_FFMPEG_p != 0 &&
icvCreateVideoWriter_FFMPEG_p != 0 &&
icvReleaseVideoWriter_FFMPEG_p != 0 &&
icvWriteFrame_FFMPEG_p != 0 )
if
(
icvCreateFileCapture_FFMPEG_p
==
NULL
||
icvReleaseCapture_FFMPEG_p
==
NULL
||
icvGrabFrame_FFMPEG_p
==
NULL
||
icvRetrieveFrame_FFMPEG_p
==
NULL
||
icvSetCaptureProperty_FFMPEG_p
==
NULL
||
icvGetCaptureProperty_FFMPEG_p
==
NULL
||
icvCreateVideoWriter_FFMPEG_p
==
NULL
||
icvReleaseVideoWriter_FFMPEG_p
==
NULL
||
icvWriteFrame_FFMPEG_p
==
NULL
)
{
printf("Successfully initialized ffmpeg plugin!\n"
);
fprintf
(
stderr
,
"Failed to load FFMPEG plugin: module handle=%p
\n
"
,
icvFFOpenCV
);
}
else
{
printf("Failed to load FFMPEG plugin: module handle=%p\n", icvFFOpenCV);
}
#endif
}
#elif defined HAVE_FFMPEG
icvCreateFileCapture_FFMPEG_p
=
(
CvCreateFileCapture_Plugin
)
cvCreateFileCapture_FFMPEG
;
...
...
modules/highgui/src/grfmt_jpeg.cpp
View file @
67ce03d7
...
...
@@ -229,12 +229,16 @@ bool JpegDecoder::readHeader()
if
(
m_f
)
jpeg_stdio_src
(
&
state
->
cinfo
,
m_f
);
}
jpeg_read_header
(
&
state
->
cinfo
,
TRUE
);
m_width
=
state
->
cinfo
.
image_width
;
m_height
=
state
->
cinfo
.
image_height
;
m_type
=
state
->
cinfo
.
num_components
>
1
?
CV_8UC3
:
CV_8UC1
;
result
=
true
;
if
(
state
->
cinfo
.
src
!=
0
)
{
jpeg_read_header
(
&
state
->
cinfo
,
TRUE
);
m_width
=
state
->
cinfo
.
image_width
;
m_height
=
state
->
cinfo
.
image_height
;
m_type
=
state
->
cinfo
.
num_components
>
1
?
CV_8UC3
:
CV_8UC1
;
result
=
true
;
}
}
if
(
!
result
)
...
...
modules/imgproc/perf/perf_houghLines.cpp
View file @
67ce03d7
...
...
@@ -18,7 +18,7 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines,
testing
::
Values
(
0.01
,
0.1
),
testing
::
Values
(
300
,
500
)
)
)
)
{
String
filename
=
getDataPath
(
get
<
0
>
(
GetParam
()));
double
rhoStep
=
get
<
1
>
(
GetParam
());
...
...
@@ -36,5 +36,18 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines,
TEST_CYCLE
()
HoughLines
(
image
,
lines
,
rhoStep
,
thetaStep
,
threshold
);
#ifdef WIN32
//FIXME: ugly fix to make sanity check pass on Win32, must be investigated, issue #2617
if
(
lines
.
cols
==
2015
)
{
lines
=
lines
(
Rect
(
0
,
0
,
lines
.
cols
-
1
,
lines
.
rows
));
SANITY_CHECK
(
lines
,
800.0
);
}
else
{
SANITY_CHECK
(
lines
);
}
#else
SANITY_CHECK
(
lines
);
}
\ No newline at end of file
#endif
}
modules/ts/include/opencv2/ts/ts.hpp
View file @
67ce03d7
...
...
@@ -10,17 +10,6 @@
#endif
#endif
#ifdef ANDROID
# include <android/api-level.h>
# define GTEST_HAS_CLONE (__ANDROID_API__ > 7 && !defined __i386__)
# define GTEST_HAS_POSIX_RE (__ANDROID_API__ > 7)
# if defined _GLIBCXX_USE_WCHAR_T && _GLIBCXX_USE_WCHAR_T
# define GTEST_HAS_STD_WSTRING 1
# else
# define GTEST_HAS_STD_WSTRING 0
#endif
#endif
#include <stdarg.h> // for va_list
#ifdef _MSC_VER
...
...
modules/ts/include/opencv2/ts/ts_gtest.h
View file @
67ce03d7
This diff is collapsed.
Click to expand it.
modules/ts/src/ts_gtest.cpp
View file @
67ce03d7
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment