Porting OpenCV on WinCE07 platform - opencv

I have created a HOG based human detection code using OpenCV. While the code is runs well on my Windows 7 system, I now need to port this on a WinCE07 platform. How do I compile OpenCV for WinCE07 platform.

OpenCV site has instruction to build OpenCV from source, see "Installation in Windows - Installation by Making Your Own Libraries from the Source Files".
Basically you need:
A suitable development environment for Windows CE (some years ago the environment was eMbedded Visual C++ 4.0, I do not know what Microsoft has now).
The source code of OpenCV.
CMake, it is the program for managing the build. CMake will create the projects and solutions files. Usually CMake automatically recognize your development environment.

Related

Can I use OpenCV on AIX?

I developed an image processing library with OpenCV and it works well in Windows, Android(Native) and iOS.
Now I want to build my library to run on AIX server. Unfortunately I couldn't find any guidance for building OpenCV for AIX.
Can you give me any guidance?
There is no official support for OpenCV on AIX. No community driven project either.
However there is another project maintained by IBM called IBM AIX Toolbox for Linux Applications.
This project is intended for developers and provides most Linux based, especially GNU based programming languages, tools & libraries to be run on AIX.
You'll have to go through setting up the environment / dependencies, though it must compile just fine. Linux tutorials for building OpenCV using GCC should work just fine.
You might ask the person at Perzl if he could build it. He must have a lot of knowledge, tools, and environment already. I also find it much better than the IBM AIX Toolbox so if you want to try to do it yourself, I would start with his versions instead of IBM's.
Group Bull use to have a similar set of built open source packages but I don't know where they disappeared to.

Z3-OPT binary files for the windows 64 bit machine

I am trying to get Z3-OPT (optimization) binary files for the windows 64-bit machine. To make these files, I already tried to compile the code from the unstable branch. However, I could not compile them as my Visual Studio Community edition does not contain "nmake" command. I tried to follow instructions on the following page:
https://github.com/Z3Prover/z3
Can anyone share with me the latest Z3-OPT binary files?
Z3-opt is now the same as Z3, so you can just use the main links for downloading Z3.
The releases are in: https://github.com/Z3Prover/bin/tree/master/releases
There is also a folder with nightly builds.
You have to enable C++ features in VS before you get the command line build tools. This involves updating the installation of VS itself, something you can do from "Apps and Features" (in Windows 10) or similar place in previous versions of Windows. There is already some online discussions about this question. For example, https://developercommunity.visualstudio.com/content/problem/39632/adding-nmake-to-vs2017.html.

Is it possible to use TensorFlow C++ API on Windows?

I'm interested in incorporating TensorFlow into a C++ server application built in Visual Studio on Windows 10 and I need to know if that's possible.
Google recently announced Windows support for TensorFlow: https://developers.googleblog.com/2016/11/tensorflow-0-12-adds-support-for-windows.html
but from what I can tell this is just a pip install for the more commonly used Python package, and to use the C++ API you need to build the repo from source yourself: How to build and use Google TensorFlow C++ api
I tried building the project myself using bazel, but ran into issues trying to configure the build.
Is there a way to get TensorFlow C++ to work in native Windows (not using Docker or the new Windows 10 Linux subsystem, as I've seen others post about)?
Thanks,
Ian
It is certainly possible to use TensorFlow's C++ API on Windows, but it is not currently very easy. Right now, the easiest way to build against the C++ API on Windows would be to build with CMake, and adapt the CMake rules for the tf_tutorials_example_trainer project (see the source code here). Building with CMake will give you a Visual Studio project in which you can implement your C++ TensorFlow program.
Note that the tf_tutorials_example_trainer project builds a Console Application that statically links all of the TensorFlow runtime into your program. At present we have not written the necessary rules to create a reusable TensorFlow DLL, although this would be technially possible: for example, the Python extension is a DLL that includes the runtime, but does not export the necessary symbols to use TensorFlow's C or C++ APIs directly.
There is a detailed guide by Joe Antognini and a similar TensorFlow ReadMe at GitHub explaining the building of TensorFlow source via CMake. You also need to have SWIG installed on your machine which allows connecting C/C++ source with the Python scripting language. I did use Visual CMAKE (cmake-gui) with the screen capture shown below.
In the CMake configuration, I used Visual Studio 15 2017 compiler. Once this stage successfully completes, you can click on the Generate button to go ahead with the actual build process.
However, on Visual Studio 2015, when I attempted building via the "ALL_BUILD" project, the setup gave me "build tools for v141 cannot be found" error. This did not go away even when I attempted to retarget my solution. Finally, the solution got built successfully with Visual Studio 2017. You also need to manually set the SWIG_EXECUTABLE path in CMake before it successfully configures.
As indicated in the Antognini link, for me the build took about half an hour on a 16GB RAM, Core i7 machine. Once done, you might want to validate your build by attempting to run the tf_tutorials_example_trainer.exe file.
Hope this helps!
For our latest work on building TensorFlow C++ API on Windows, please look at this github page. This works on Windows 10, currently without CUDA support (only CPU).
PS:
Only the bazel build method works, because CMake is not supported and not maintained anymore, resulting in CMake configuration errors.
I had to use a downgraded version of my Visual Studio 2017 (from 15.7.5 to 15.4) by adding "VC++ 2017 version 15.4 v14.11 toolset" through the installer (Individual Components tab).
The cmake command which worked for me was:
cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release ^
-T "v141,version=14.11" ^
-DSWIG_EXECUTABLE="C:/Program Files/swigwin-3.0.12/swig.exe" ^
-DPYTHON_EXECUTABLE="C:/Program Files/Python/python.exe" ^
-DPYTHON_LIBRARIES="C:/Program Files/Python/libs/python27.lib" ^
-Dtensorflow_ENABLE_GPU=ON ^
-DCUDNN_HOME="C:/Program Files/cudnn-9.2-windows10-x64-v7.1/cuda" ^
-DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0"
After the build, open tensorflow.sln in Visual Studio and build ALL_BUILD.
If you want to enable GPU computation, do check your Graphics Card here (Compute Capability > 3.5). Do remember to install all the packages (Cuda Toolkit 9.0, cuDNN, Python 3.7, SWIG, Git, CMake...) and add the paths to the environment variable in the beginning.
I made a README detailing how to I built the Tensorflow dll and .lib file for the C++ API on Windows with GPU support building from source with Bazel. Tensorflow version 1.14
The tutorial is step by step and starts at the very beginning, so you may have to scroll down past steps you have already done, like checking your hardware, installing Bazel etc.
Here is the url: https://github.com/sitting-duck/stuff/tree/master/ai/tensorflow/build_tensorflow_1.14_source_for_Windows
Probably you will want to scroll all the way down to this part:
https://github.com/sitting-duck/stuff/tree/master/ai/tensorflow/build_tensorflow_1.14_source_for_Windows#step-7-build-the-dll
It shows how to pass command to create .lib and .dll.
Then to test your .lib you should link it into your c++ project,
Then it will show you how to identify and fix the missing symbols using the TF_EXPORT macro
I am actively working on making this tutorial better so feel free to leave comments on this answer if you are having problems.

The exact build configuration of pre-built OpenCV 3.1 on Windows

I recently use the pre-built OpenCV 3.1.0 on Windows which was downloaded from here. Actually, I followed the official installation.
The thing is that I find that the VideoCapture module of pre-built OpenCV processes video very slowly. It seems that it has no support of ffmpeg. And I find the official note:
To use the OpenCV library you have two options: Installation by Using the Pre-built Libraries or Installation by Making Your Own Libraries from the Source Files . While the first one is easier to complete, it only works if you are coding with the latest Microsoft Visual Studio IDE and doesn't take advantage of the most advanced technologies we integrate into our library.
It makes me curious about what is the actual build configuration of pre-built OpenCV 3.1.0 (or other versions) on Windows. No supports of TBB, IPP, Eigen, CUDA, etc...? I didn't find any clue on the internet. Anyone knows?

Picking The Right OpenCV Build For Windows

I'm trying to make heads and tails of the list of files available for Windows at OpenCV's website.
This is the list at SourceForge (http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3/) for v2.3:
OpenCV-2.3.0rc-gpu-support-win32-vs2008.zip
OpenCV-2.3.0rc-win64-vs2010.exe
OpenCV-2.3.0rc-win32-vs2008.exe
OpenCV-2.3.0rc-win-src.zip
I've deduced the following so far:
OpenCV-2.3.0rc-gpu-support-win32-vs2008.zip: The only way to get support for using GPUs.
OpenCV-2.3.0rc-win64-vs2010.exe: Used if you are using Visual Studio 2010 and 64-bit Windows
OpenCV-2.3.0rc-win32-vs2008.exe: Used if you are using VS 2008 and 32-bit Windows
OpenCV-2.3.0rc-win-src.zip: Source code for OpenCV on Windows (but might not support GPUs).
I'm left with the following questions (assuming that I don't want to compile from the source code):
Which version should I pick if want to use Visual Studio 2008, OpenCV, and a 64-bit version of Windows?
Which version should I pick for Visual Studio 2010, OpenCV, and 32-bit Windows?
If you notice the filenames they contain the letters rc which stand for release candidate. I would not recommend using this version just yet. Grab OpenCV 2.2 if you don't need specific features from the 2.3.
There's a README file on that page explaining what's inside each package. All v2.2 packages are 32-bit.
Which version should I pick if want to use Visual Studio 2008, OpenCV, and a 64-bit version of Windows?
You will have to rebuild OpenCV from the sources. Download OpenCV-2.2.0-win.zip or OpenCV-2.3.0rc-win-src.zip for the 2.3 version.
Which version should I pick for Visual Studio 2010, OpenCV, and 32-bit Windows?
For the 2.3 version, you will also have to rebuild OpenCV from the sources, OpenCV-2.3.0rc-win-src.zip. For the 2.2 version, there's the package OpenCV-2.2.0-win32-vs2010.exe, which includes OpenCV source code, documentation, samples and pre-compiled 32-bit binaries.

Resources