Browse Source

Added x86_64 and arm64_v8a to Android build.

UWP10 3.0.0
Canming Huang 10 years ago
parent
commit
4a286f9647
  1. 2
      Emgu.CV.Example/Android/PedestrianDetectionActivity.cs
  2. 2
      Emgu.CV.Example/Android/Resources/Resource.Designer.cs
  3. 10
      Emgu.CV.Extern/tesseract/libtesseract/CMakeLists.txt
  4. 35
      Emgu.CV.Test/Emgu.CV.Test.Android/Emgu.CV.Test.csproj
  5. 2
      Emgu.CV.Test/Emgu.CV.Test.Android/Resources/Resource.designer.cs
  6. 12
      Emgu.CV/Emgu.CV.Android.csproj
  7. 8
      Emgu.CV/PInvoke/Android/MatAndroid.cs
  8. 7
      platforms/android/scripts/rebuild_all.bat

2
Emgu.CV.Example/Android/PedestrianDetectionActivity.cs

@ -41,7 +41,7 @@ namespace AndroidExamples
return;
Rectangle[] pedestrians = FindPedestrian.Find(image.Mat, false, true, out time);
SetMessage(String.Format("Detection completed in {0} milliseconds.", time));
SetMessage(String.Format("Detection completed with {1} in {0} milliseconds.", time, CvInvoke.UseOpenCL ? "OpenCL" : "CPU"));
foreach (Rectangle rect in pedestrians)
{
image.Draw(rect, new Bgr(System.Drawing.Color.Red), 2);

2
Emgu.CV.Example/Android/Resources/Resource.Designer.cs

@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.0
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

10
Emgu.CV.Extern/tesseract/libtesseract/CMakeLists.txt

@ -286,11 +286,11 @@ LIST(REMOVE_ITEM tesseract_api_srcs ${tesseract_api_srcs_excludes})
file(GLOB tesseract_api_hdrs "${TESSERACT_DIR}/api/*.h")
file(GLOB tesseract_api_hdrs_excludes "${TESSERACT_DIR}/api/capi.h")
LIST(REMOVE_ITEM tesseract_api_hdrs ${tesseract_api_hdrs_excludes})
IF(ANDROID)
LIST(APPEND tesseract_api_hdrs "${CMAKE_CURRENT_SOURCE_DIR}/glob/android/glob.h")
LIST(APPEND tesseract_api_srcs "${CMAKE_CURRENT_SOURCE_DIR}/glob/android/glob.c")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/glob/android")
ENDIF()
#IF(ANDROID)
# LIST(APPEND tesseract_api_hdrs "${CMAKE_CURRENT_SOURCE_DIR}/glob/android/glob.h")
# LIST(APPEND tesseract_api_srcs "${CMAKE_CURRENT_SOURCE_DIR}/glob/android/glob.c")
# include_directories("${CMAKE_CURRENT_SOURCE_DIR}/glob/android")
#ENDIF()
source_group("Src" FILES ${tesseract_api_srcs})
source_group("Include" FILES ${tesseract_api_hdrs})
add_definitions(-DUSE_STD_NAMESPACE -DHAVE_LIBLEPT)

35
Emgu.CV.Test/Emgu.CV.Test.Android/Emgu.CV.Test.csproj

@ -29,6 +29,17 @@
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidLinkSkip />
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<BundleAssemblies>False</BundleAssemblies>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
<AndroidStoreUncompressedFileExtensions />
<MandroidI18n />
<Debugger>Xamarin</Debugger>
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
<DevInstrumentationEnabled>True</DevInstrumentationEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
@ -36,8 +47,22 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<DefineConstants>ANDROID</DefineConstants>
<AndroidLinkSkip />
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<BundleAssemblies>False</BundleAssemblies>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86,x86_64,arm64-v8a</AndroidSupportedAbis>
<AndroidStoreUncompressedFileExtensions />
<MandroidI18n />
<Debugger>Xamarin</Debugger>
<AotAssemblies>False</AotAssemblies>
<EnableLLVM>False</EnableLLVM>
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
<EnableProguard>False</EnableProguard>
<DevInstrumentationEnabled>False</DevInstrumentationEnabled>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@ -238,4 +263,12 @@
<Link>Assets\cat.png</Link>
</AndroidAsset>
</ItemGroup>
<ItemGroup>
<AndroidAsset Include="..\..\opencv_contrib\modules\text\samples\trained_classifierNM1.xml">
<Link>Assets\trained_classifierNM1.xml</Link>
</AndroidAsset>
<AndroidAsset Include="..\..\opencv_contrib\modules\text\samples\trained_classifierNM2.xml">
<Link>Assets\trained_classifierNM2.xml</Link>
</AndroidAsset>
</ItemGroup>
</Project>

2
Emgu.CV.Test/Emgu.CV.Test.Android/Resources/Resource.designer.cs

@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

12
Emgu.CV/Emgu.CV.Android.csproj

@ -81,16 +81,22 @@
<EmbeddedNativeLibrary Include="..\libs\armeabi-v7a\libcvextern.so">
<Link>lib\armeabi-v7a\libcvextern.so</Link>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="..\libs\arm64-v8a\libcvextern.so">
<Link>lib\arm64-v8a\libcvextern.so</Link>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="..\libs\x86\libcvextern.so">
<Link>lib\x86\libcvextern.so</Link>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="..\libs\x86_64\libcvextern.so">
<Link>lib\x86_64\libcvextern.so</Link>
</EmbeddedNativeLibrary>
</ItemGroup>
<ItemGroup>
<Content Include="..\Emgu.CV.License.txt">
<None Include="..\Emgu.CV.License.txt">
<Link>Emgu.CV.License.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="README.txt" />
</None>
<None Include="README.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\StringTable.resx">

8
Emgu.CV/PInvoke/Android/MatAndroid.cs

@ -24,12 +24,10 @@ namespace Emgu.CV
: this()
{
using (Stream imageStream = assets.Open(fileName))
using (MemoryStream ms = new MemoryStream())
{
using (BinaryReader br = new BinaryReader(imageStream))
{
byte[] b = br.ReadBytes((int)imageStream.Length);
CvInvoke.Imdecode(b, LoadImageType.AnyColor | LoadImageType.AnyDepth, this);
}
imageStream.CopyTo(ms);
CvInvoke.Imdecode(ms.ToArray(), LoadImageType.AnyColor | LoadImageType.AnyDepth, this);
}
}

7
platforms/android/scripts/rebuild_all.bat

@ -16,15 +16,22 @@ rm -rf build_x86
:END_CLEAN
call platforms\android\scripts\build armeabi
call platforms\android\scripts\build armeabi-v7a
call platforms\android\scripts\build arm64-v8a
call platforms\android\scripts\build x86
call platforms\android\scripts\build x86_64
unzip build_armeabi\libemgucv-android-armeabi -d build
unzip build_armeabi-v7a\libemgucv-android-armeabi-v7a -d build
unzip build_arm64-v8a\libemgucv-android-arm64-v8a -d build
unzip build_x86\libemgucv-android-x86 -d build
unzip build_x86_64\libemgucv-android-x86_64 -d build
cd build
mkdir libemgucv-android
xcopy libemgucv-android-x86 libemgucv-android /E /Y
xcopy libemgucv-android-x86_64 libemgucv-android /E /Y
xcopy libemgucv-android-armeabi libemgucv-android /E /Y
xcopy libemgucv-android-armeabi-v7a libemgucv-android /E /Y
xcopy libemgucv-android-arm64-v8a libemgucv-android /E /Y
cd libemgucv-android
mv bin libs
xcopy sdk\native\libs libs /E /Y

Loading…
Cancel
Save