An error pops up saying that
opencv_ml245.dll are missing.
These are related to the OpenCV (Open Source Computer Vision) Library. You may wish to try installing that first.
The OpenCV extractor for Windows (currently packaged as an
.exe) will prompt for a path to extract to when run. An
opencv folder is created automatically at that location.
In a broad sense, it shouldn't matter where you choose to extract these file. However, your program may have specific requirements (which you will need to verify) as to the placement of the missing .dlls.
Some programs may require a path to the library to be defined in their settings while others may require you to manually place files e.g. in their program folder(s) (or other locations). You will need to confirm which of these options apply through your program documentation or further research.
OpenCV comes with a number of
builds. You should match the "bitness" of your selected library .dlls to the "bitness" of your program (i.e. 32-bit or 64-bit).
For TITARL, the missing .dlls need to placed in the same folder as
Unfortunately, OpenCV 2.4.5 (and these .dlls) no longer seem easily available as pre-compiled binaries. However, the OpenCV 2.4.5 Library is still available as source code from the official GitHub repository. The missing .dlls need to be compiled from this source code before the program will run.
If you trust strangers on the internet, I have compiled 64-bit versions of these two .dlls for you. They seemed to work correctly with the
example_learning.bat provided with TITARL. However, they have not been thoroughly tested by any means.
These .dlls were built with Visual Studio 14 (2015) on Window 7 with no Python support.
Support for FFmpeg and DirectShow were included in the build options but have not been directly tested in any way.
No other .dlls were built besides
If you do decide to try these and run into trouble (e.g. unexplained behaviors or other issues), you may simply need to compile them yourself. I give an overview of the steps I took below.
Mini-Compilation Guide for Visual Studio
Based on this general guide to compiling OpenCV 3 with Visual Studio, which you have mentioned in the comments, the following steps should allow you to get at least a minimally functioning installation of TITARL by building the necessary missing .dlls.
Download and install Microsoft Visual Studio Community Edition (free). They have older versions as well, depending on your needs. Be aware that older versions currently require a free Dev Essentials account to access.
Download and install CMake. CMake is a utility that helps compilation go a bit easier and OpenCV 2.4.5. has the necessary files to work with it.
Download and extract the source code linked earlier (if you haven't already done so). Where you extract the source code is your choice.
Assuming CMake is installed, open the GUI interface (e.g. from the icon on your desktop).
At the top of the main window, enter the path to your source code in the first field. In the secondary field just below, add a path to where you would like to store files related to compilation (the location of this second path is your choice). Throughout these steps, I will be using a folder called
build, located in the same directory as the source code:
Once these paths are entered, press Configure near the bottom of the main window. A new dialog box should appear.
In this dialog box, select the correct "generator" for your .dlls. For Visual Studio, this will be the edition name followed by either nothing (which builds 32-bit binaries) or
Win64 (which builds 64-bit binaries). TITARL is a 64-bit program (
TITARL 1.7 [Win x64 - Public release]), therefore you will want to select e.g
Visual Studio 14 2015 Win64 or
Visual Studio 15 2017 Win64 to build the appropriate 64-bit .dlls:
Press Finish to close the dialog box. CMake will automatically begin processing the OpenCV 2.4.5 source code. In the main window, the Configure button will have changed to a Stop button and the Generating... and Open Project... buttons next to it will be grayed out. Note that this initial processing may take a few minutes.
Once this processing is completed, the upper pane in the main CMake window will display a large amount of information in red (these are newly-detected options). The lower pane should read "Configuring done":
Find the build options marked
* is a name such as
apps). They should all be in one block. Uncheck the checkbox next to each item, excluding
BUILD_opencv_ml. Press Configure again. After processing finishes once more, press Generate.... When completed, the main CMake window should look something like this:
Fixing OpenCV 2.4.5
Normally, everything would be ready for compiling the missing .dlls at this point. However, OpenCV 2.4.5. has a generic issue with Visual Studio 12+ where it generates a large number of
"max" : is not a member of "std" errors, which prevent the necessary .dlls from being created.
Thankfully, as detailed in an answer to this StackOverflow question, compilation can be achieved with some minor alterations to the original source code.
To fix this issue:
OpenCV.sln solution generated by CMake earlier (e.g. under
Double-click the file to open it in Visual Studio. Since this is likely the first time you've opened this solution, it may take a minute or two for Visual Studio to fully parse it. Watch the blue activity bar at the bottom of the main Visual Studio window and wait till it says "Ready" before continuing.
Once Visual Studio has settled down, press Ctrl + H to open the Find and Replace dialog box, then do the following:
Find what: enter
Replace with: enter
#include <algorithm>\n#include <string>.
Look in to
Entire Solution (as needed).
Find options, make certain
Use Regular Expressions is marked.
- Press Replace All when finished.
Once all the steps above are complete, you should be ready to compile with CMake. Open a command window in your
build directory (ex.
C:\path\to\opencv-2.4.5\build) and type e.g.:
C:\path\to\cmake.exe --build . --config Release --target INSTALL
After short time (under 15 minutes), compiling should be completed and the missing .dlls should be available under the
install\bin folder of the
build directory (e.g
C:\path\to\opencv-2.4.5\build\install\bin). As noted earlier, the .dlls in this folder need to placed in the same folder as
Following the steps above, I encountered no major errors beyond the necessary code correction with Visual Studio. However, I did not attempt to build the entire library.
Not every step presented here exactly mirrors the steps given in the guide links. You may wish to refer back to those links for additional details.
Visual Studio Notes
Visual Studio can be a large installation and may need configuration in its own right. Therefore, Preparation Step 1 may take longer than you might otherwise think.
If you plan to tinker with Python support in OpenCV, Visual Studio may need to be setup with
Python Tools for Visual Studio along with its support for
Yellow warning messages during compilation can often be safely ignored. Red error messages, on the other hand, indicate problems that will cause a build to fail (i.e. no .dlls will be produced). However, these are not the same as the potentially "safe" red errors CMake generates below.
\ for Windows paths in its GUI interface. That said, pasted paths should have any
\ switched to
If you do not wish to type the full path to
cmake.exe in the final compilation step, choose the option to add CMake to your PATH during its installation.
The option to build .dlls supporting Python in CMake requires steps which are not listed here.
Preparation Step 7 can cause incorrect binaries to be built if you select the wrong generator (i.e. 32-bit .dlls will not work with a 64-bit program).
Leaving the radio button option as
Use default native compilers should be fine, however.
If you make any mistakes with CMake, etc., simply delete your
build folder and start again from Preparation Step 4.
In CMake, with the steps given, red "errors" in the interface did not seem to cause any serious issues. That said, its probably worthwhile to generally note any error or warning you encounter.
If there are any serious issues, configuration will not complete and an error log will be written.