Feature/opencv4 (#706)

* Travis OpenCV4 update, testing Ubuntu with new OpenCV

* Fix to Ubuntu travis

* Another attempt at OpenCV 4.0 for Ubuntu

* And another OpenCV attempt.

* Simplifying the travis script

* Ubuntu OpenCV 4 support.

* Updating to OpenCV 4, for x64 windows.

* Fixes to move to OpenCV 4 on windows.

* Travis fix for OpenCV 4 on OSX

* Renaming a lib.

* Travis opencv4 fix.

* Building OpenCV4 versions using appveyor.

* Attempt mac travis fix.

* Small travis fix.

* Travis fix attempt.

* First iteration in boost removal and upgrade to C++17

* Test with ocv 4.0

* Moving filesystem out of stdafx

* Some more boost testing with cmake.

* More CMAKE options

* More compiler flag changes

* Another attempt at compiler options.

* Another attempt.

* More filesystem stuff.

* Linking to filesystem.

* Cmake fix with target linking.

* Attempting travis with g++-8

* Attempting to setup g++8 on travis linux.

* Another travis change.

* Adding OpenBLAS to travis and removing g++-8

* Fixing typo

* More travis experiments.

* More travis debugging.

* A small directory change.

* Adding some more travis changes.

* travis typo fix.

* Some reordering of travis, for cleaner yml

* Removing `using namespace std` in order to avoid clash with byte and to make the code more consistent.

* Working towards removing std::filesystem requirement, allow boost::filesystem as well.

* Making boost an optional dependency

* Fixing std issue.

* Fixing cmake issue.

* Fixing the precompiled header issue.

* Another cmake boost fix.

* Including missing files.

* Removing unnecessary includes.

* Removing more includes.

* Changes to appveyor build, proper removal of VS2015

* If boost is present, do not need to link to filesystem.

* Removing un-needed link library.

* oops

* Mac attempt at opencv4 travis.

* Upgrading OCV to 4.1 on VS2018

* Downloading OpenCV binaries through a script

* Triger an appveyor build.

* Upgrading VS version.

* Attempting VS2017 build

* Adding win-32 libraries for OpenCV 4.1

* Adding OpenCV 32 bit libraries.
This commit is contained in:
Tadas Baltrusaitis
2019-05-28 19:49:17 +01:00
committed by GitHub
parent 330383fef7
commit 9147dfe2f3
2762 changed files with 37401 additions and 353002 deletions

View File

@@ -43,14 +43,11 @@
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/videoio/videoio.hpp> // Video write
#include <opencv2/videoio/videoio_c.h> // Video write
#include <stdio.h>
#include <time.h>
#include <filesystem.hpp>
#include <filesystem/fstream.hpp>
#include <filesystem>
#define INFO_STREAM( stream ) \
std::cout << stream << std::endl
@@ -70,8 +67,6 @@ static void printErrorAndAbort( const std::string & error )
#define FATAL_STREAM( stream ) \
printErrorAndAbort( std::string( "Fatal error: " ) + stream )
using namespace std;
// Get current date/time, format is YYYY-MM-DD.HH:mm:ss
const std::string currentDateTime() {
time_t now = time(0);
@@ -85,14 +80,14 @@ const std::string currentDateTime() {
return buf;
}
vector<string> get_arguments(int argc, char **argv)
std::vector<std::string> get_arguments(int argc, char **argv)
{
vector<string> arguments;
std::vector<std::string> arguments;
for(int i = 1; i < argc; ++i)
{
arguments.push_back(string(argv[i]));
arguments.push_back(std::string(argv[i]));
}
return arguments;
}
@@ -100,10 +95,10 @@ vector<string> get_arguments(int argc, char **argv)
int main (int argc, char **argv)
{
vector<string> arguments = get_arguments(argc, argv);
std::vector<std::string> arguments = get_arguments(argc, argv);
// Some initial parameters that can be overriden from command line
string outroot, outfile;
std::string outroot, outfile;
TCHAR NPath[200];
GetCurrentDirectory(200, NPath);
@@ -152,16 +147,16 @@ int main (int argc, char **argv)
cv::Mat img;
vCap >> img;
boost::filesystem::path dir(outroot);
boost::filesystem::create_directory(dir);
std::filesystem::path dir(outroot);
std::filesystem::create_directory(dir);
string out_file = outroot + outfile;
std::string out_file = outroot + outfile;
// saving the videos
cv::VideoWriter video_writer(out_file, CV_FOURCC('D','I','V','X'), 30, img.size(), true);
cv::VideoWriter video_writer(out_file, cv::VideoWriter::fourcc('D','I','V','X'), 30, img.size(), true);
ofstream outlog;
outlog.open((outroot + outfile + ".log").c_str(), ios_base::out);
outlog << "frame, time(ms)" << endl;
std::ofstream outlog;
outlog.open((outroot + outfile + ".log").c_str(), std::ios_base::out);
outlog << "frame, time(ms)" << std::endl;
double freq = cv::getTickFrequency();
@@ -180,7 +175,7 @@ int main (int argc, char **argv)
video_writer << img;
outlog << frameProc + 1 << " " << curr_time;
outlog << endl;
outlog << std::endl;
cv::imshow("rec", img);

View File

@@ -21,57 +21,53 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{2D80FA0B-2DE8-4475-BA5A-C08A9E1EDAAC}</ProjectGuid>
<RootNamespace>Recording</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\lib\3rdParty\boost\boost_d.props" />
<Import Project="..\..\lib\3rdParty\OpenCV3.4\openCV3.4.props" />
<Import Project="..\..\lib\3rdParty\OpenCV\openCV.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\lib\3rdParty\boost\boost_d.props" />
<Import Project="..\..\lib\3rdParty\OpenCV3.4\openCV3.4.props" />
<Import Project="..\..\lib\3rdParty\OpenCV\openCV.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\lib\3rdParty\boost\boost.props" />
<Import Project="..\..\lib\3rdParty\OpenCV3.4\openCV3.4.props" />
<Import Project="..\..\lib\3rdParty\OpenCV\openCV.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\lib\3rdParty\boost\boost.props" />
<Import Project="..\..\lib\3rdParty\OpenCV3.4\openCV3.4.props" />
<Import Project="..\..\lib\3rdParty\OpenCV\openCV.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -86,6 +82,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -96,6 +93,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -110,6 +108,7 @@
<OpenMPSupport>false</OpenMPSupport>
<CallingConvention>Cdecl</CallingConvention>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -128,6 +127,7 @@
<OpenMPSupport>false</OpenMPSupport>
<CallingConvention>Cdecl</CallingConvention>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>