Formore recent versions of Emgu.CV.runtime.windows.cuda package, they are not available from
nuget.org. If you need to use the nuget package with cuda support, you can download two large nuget packages:
The newer CUDA DNN package has a file, e.g."cudnn_cnn_infer64_8.dll" in v8.0.4, that is 688MB in size, after the nuget package compression the nupkg file is still 287MB. Nuget.org has a hard limit in package size of 250MB, this prevent the package being uploaded to
nuget.org. Unless NVidia break up "cudnn_cnn_infer64_8.dll" into multiple smaller files, or
nuget.org increase the file limit, we will not be able to upload the latest cuda nuget packages into
nuget.org. The existing 4.4 release use older version of CUDNN and has nuget package reaching 248MB, we have moved onto newer version of CUDA and CUDNN to support the RTX 30xx series of graphic card and is no longer using the previous version of CUDNN. Commercial license holder will not be affected, we have the Emgu.CV.runtime.windows.cuda package uploaded to our commercial nuget repository which have larger nupkg size limit (500MB).
If you are targeting .Net Framework, when using Emgu.CV.runtime.windows(.dldt / .cuda / .cuda.dldt) nuget packages for windows, please set the build architecture to either "x86" or "x64". Do not set the architecture to "Any CPU". .Net Framework do not have the capability to deploy nuget package that target multiple architectures. If you set the architecture to "x86", the files under "runtime\win-x86\native" in the runtime nuget package will be copied to the folder of the executable. If you set the architecture to "x64", the files under "runtime\win-x64\native" in the runtime nuget package will be copied to the folder of the executable. If you set the architecture to "Any CPU", none of the native files will be copied over, and you will have a PInvoke exception.
If you are targeting .Net Core or .Net 5+, you can use "Any CPU". .Net Core and .Net 5+ are build to handle multiple architecture native binary deployments. All files under the "runtime" folder will be copied recursively to the folder of the executable, the runtime will load the correct files based on the running architecture.
If you are using packages.config for your project, nuget's dependency resolution is broken when using "package.config" to managed nuget package. Microsoft recommend upgrading "package.config" to "package reference":
If your project does not contains any package.config file and doesn't reference any nuget package, it is possible that your project may still default to use "package.config" to manage nuget packages. In this case, you will need to first install "Emgu.CV" nuget pacakge from
nuget.org, afterwhich the "package.config" file will be visible in your project, and you can continute with the following steps.
Download Dependency Walker and use it to open the "cvextern.dll" file. Check if any dependency is missing. The native 64-bit binaries can be found under the "runtimes\win-x64\native" subfolder, from your fodler of executable. The 32-bit binaries can be found under the "runtimes\win-x86\native" subfolder, from your folder of executable.
The command may return right away, but the dependency walker will be running in the background to check dependency. You may find that there is no output files generated. Don't panic, take a break. It can take up to 30 minutes for the dependency report to be generated and written to disk. After a while, check the folder for the "cvextern.dwi" file. If it shows up, you can copy it out of docker to exam it.
If you want to change the build options, use CMAKE to open the "build_x86" / "build_x86_64" folder, depends on if you are building for 32-bit or 64-bit. You can change the build flags and regenerate the unmanaged solution.
Double check if the emgucv.sln file exists in the root folder, if not, run the above step again.Open emgucv.sln solution located in the root folder with the matching version of Visual Studio, switch the configuration to "Release" and build the cvextern project.
The commercial download page also provide access to the "Emgu.CV.runtime.xamarin.ios" nuget package. Similar to the "Emgu.CV.runtime.windows" nuget package that provide runtime dependencies for Windows, these two packages provide the runtime dependencies for Emgu CV targeting Xamarin iOS application. Once you download the nuget package, you can either put it in your own nuget server, or you can put it in a local folder and configure Visual Studio to use the folder as a local repository. You can find information about setting up a local nuget repository here
in the main ios app, to make sure the native binary is included in the compilation. Otherwise you may see a long list of missing native reference errors during compilation. You can add the function call in the AppDelegate.cs file, under the FinishedLaunching function:
Please make sure you don't include more than one "Emgu.CV.runtime" packages for a single project. If you are developing multiplatform applications, you can create a library project that reference "Emgu.CV" without any "Emgu.CV.runtime.xamarin" package. After that, you can create separate projects targeting different platforms referencing your common library. Each individual platform targeted project will reference the specific "Emgu.CV.runtime.xamarin" package. e.g.
The "Emgu.CV.Platform.IOS.dll" file size is large. For example, in the 4.4.0 iOS release, this file is 724MB. It contains the native binary for all supported CPU architectures, including those for simulators.
However, if you are building an IPA for app store submission, and is only targeting ARM64 devices, you can select just ARM64 architecture. When the IPA is build, the compiler will strip out all the binary that are not used. It will significantly reduce the final size of the IPA. Depends on the number of functions you used, if you are only targeting a single ARM64 architecture, the final IPA size should be some where around 40MB.
The commercial download page also provide access to the "
Emgu.CV.runtime.xamarin.android" nuget package. Similar to the "Emgu.CV.runtime.windows" nuget package that provide runtime dependencies for Windows, it provides the runtime dependencies for Emgu CV targeting Xamarin Andorid application. Once you download the nuget package, you can either put it in your own nuget server, or you can put it in a local folder and configure Visual Studio to use the folder as a local repository. You can find information about setting up a local nuget repository here
Please make sure you don't include more than one "Emgu.CV.runtime" packages for a single project. If you are developing multiplatform applications, you can create a library project that reference "Emgu.CV" without any "Emgu.CV.runtime" package. After that, you can create seperate projects targeting different platforms referencing your common library. Each individual platform targeted project will reference the specific "Emgu.CV.runtime" package. e.g.
The "Emgu.CV.Platform.Android.dll" file size is large. For example, in the 4.5.1 Android release, this file is 70MB. It contains the native binary for all supported CPU architectures, including "arm64-v8a", "armeabi-v7a", "x86" and "x64".
If you are building an app for Google Play Store submission, we recommend using the AAB (Android App Bundle) format. When you upload the AAB file, The compressed size of the Emgu CV for Android runtime will take about 30MB (4 CPU architectures). However, when end-user download the APK package generated from the AAB file, only one out of 4 CPU architectures matching the user device will be included, resulting in a much smaller size occupied by Emgu CV for Android runtime. FYI, the download size limit of the compressed APK generated from the AAB is 150MB as of Apr 2021. That should give you lots of rooms to include other libraries on top of Emgu CV.
At last, if you are only targeting arm64-v8a devices, you can select just arm64-v8a architecture. When the final APK is build, the compiler will strip out all the binary for the architectures that are not used. It will significantly reduce the final size of the APK. Depends on the number of functions you used, if you are only targeting a single arm64-v8a architecture, the final APK size should be some where around 20-30MB.
Upon searching for cvextern.dll i cannot find this in any of the folders of the newly built EMGU wrappers (See attached image 1). I have tried including the cvextern.dll from the previously working, older, version of EMGU.
I wanted to display my webcam feed in a WPF App. But although the below code is fairly simple, finding a good, recently updated and working library for this purpose and getting it installed took much more time than expected.
So for this reason I put it on my website so you don't have to go through the same struggle.
The app can also scan the webcam feed for a QR Code or other types and act as a barcode scanner if needed.
The library I ended up using is Emgu CV. You need to install three Emgu packages and the ZXing package for reading QR codes from NuGet into your project. Emgu.CV Emgu.CV.runtime.windows Emgu.CV.Bitmap ZXing.Net To install these packages you may need to right click on the file 'packages.config' in Visual Studio and select 'Migrate packages.config to PackageReference' if you are getting errors during installation.
See Emgu Issues on GitHub for more information.
Furthermore there was an issue with a missing library named 'cvextern.dll'. It was not added to the project initially. So it is included in the source files just to be sure.
It is the 64 bit version. So make sure you set the platform target to x64 in 'Properties > Build > Platform target' in your project.
3a8082e126