Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A number of changes to bring up master to version 2.0.6 #581

Merged
merged 8 commits into from
Oct 6, 2018
Prev Previous commit
Next Next commit
Feature/code cleanup (#573)
* Header guard cleanup (making sure naming is compliant with C++ standards and consistent).

* Removing un-needed nullptr checks.

* Removing SSE warnings for x64 builds (as SSE is enabled by default no need for a flag)

* Reverting Mat deletion
  • Loading branch information
TadasBaltrusaitis committed Sep 24, 2018
commit a274365998222252a3fc5e76046d2e562e0ac445
6 changes: 4 additions & 2 deletions exe/FaceLandmarkImg/FaceLandmarkImg.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\lib\local\LandmarkDetector\include;$(SolutionDir)\lib\local\FaceAnalyser\include;$(SolutionDir)\lib\local\GazeAnalyser\include;$(SolutionDir)\lib\local\Utilities\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
Expand Down Expand Up @@ -169,7 +170,8 @@
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\lib\local\LandmarkDetector\include;$(SolutionDir)\lib\local\FaceAnalyser\include;$(SolutionDir)\lib\local\GazeAnalyser\include;$(SolutionDir)\lib\local\Utilities\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OpenMPSupport>false</OpenMPSupport>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
Expand Down
6 changes: 4 additions & 2 deletions exe/FaceLandmarkVid/FaceLandmarkVid.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@
<PreprocessorDefinitions>WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\lib\local\LandmarkDetector\include;$(SolutionDir)\lib\local\FaceAnalyser\include;$(SolutionDir)\lib\local\GazeAnalyser\include;$(SolutionDir)\lib\local\Utilities\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OpenMPSupport>false</OpenMPSupport>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
Expand Down Expand Up @@ -172,7 +173,8 @@
<AdditionalIncludeDirectories>$(SolutionDir)\lib\local\LandmarkDetector\include;$(SolutionDir)\lib\local\FaceAnalyser\include;$(SolutionDir)\lib\local\GazeAnalyser\include;$(SolutionDir)\lib\local\Utilities\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OpenMPSupport>false</OpenMPSupport>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
Expand Down
6 changes: 4 additions & 2 deletions exe/FaceLandmarkVidMulti/FaceLandmarkVidMulti.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)\lib\local\LandmarkDetector\include;$(SolutionDir)\lib\local\Utilities\include;$(SolutionDir)\lib\local\FaceAnalyser\include;$(SolutionDir)\lib\local\GazeAnalyser\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
Expand Down Expand Up @@ -152,7 +153,8 @@
</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(SolutionDir)\lib\local\LandmarkDetector\include;$(SolutionDir)\lib\local\Utilities\include;$(SolutionDir)\lib\local\FaceAnalyser\include;$(SolutionDir)\lib\local\GazeAnalyser\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
6 changes: 4 additions & 2 deletions exe/FeatureExtraction/FeatureExtraction.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
<PreprocessorDefinitions>WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\lib\local\FaceAnalyser\include;$(SolutionDir)\lib\local\LandmarkDetector\include;$(SolutionDir)\lib\local\GazeAnalyser\include;$(SolutionDir)\lib\local\Utilities\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OpenMPSupport>false</OpenMPSupport>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
Expand Down Expand Up @@ -172,7 +173,8 @@
<AdditionalIncludeDirectories>$(SolutionDir)\lib\local\FaceAnalyser\include;$(SolutionDir)\lib\local\LandmarkDetector\include;$(SolutionDir)\lib\local\GazeAnalyser\include;$(SolutionDir)\lib\local\Utilities\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OpenMPSupport>false</OpenMPSupport>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
Expand Down
6 changes: 4 additions & 2 deletions lib/3rdParty/CameraEnumerator/CameraEnumerator.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -124,7 +125,8 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
6 changes: 4 additions & 2 deletions lib/local/CppInerop/CppInerop.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;CPPINEROP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./;$(SolutionDir)lib\local\LandmarkDetector\include;$(SolutionDir)lib\local\FaceAnalyser\include;$(SolutionDir)lib\local\GazeAnalyser\include;$(SolutionDir)lib\local\Utilities\include;$(SolutionDir)lib\3rdParty\CameraEnumerator;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -168,7 +169,8 @@
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;CPPINEROP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./;$(SolutionDir)lib\local\LandmarkDetector\include;$(SolutionDir)lib\local\FaceAnalyser\include;$(SolutionDir)lib\local\GazeAnalyser\include;$(SolutionDir)lib\local\Utilities\include;$(SolutionDir)lib\3rdParty\CameraEnumerator;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
38 changes: 9 additions & 29 deletions lib/local/CppInerop/FaceAnalyserInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
///////////////////////////////////////////////////////////////////////////////

// FaceAnalyser_Interop.h
#ifndef __FACE_ANALYSER_INTEROP_h_
#define __FACE_ANALYSER_INTEROP_h_
#ifndef FACE_ANALYSER_INTEROP_H
#define FACE_ANALYSER_INTEROP_H

#pragma once

Expand Down Expand Up @@ -269,32 +269,12 @@ public ref class FaceAnalyserManaged
// but not automatically called on explicit Dispose().
// May be called multiple times.
!FaceAnalyserManaged()
{

if (hog_features != nullptr)
{
delete hog_features;
}

if (aligned_face != nullptr)
{
delete aligned_face;
}

if (num_cols != nullptr)
{
delete num_cols;
}

if (num_rows != nullptr)
{
delete num_rows;
}

if (face_analyser != nullptr)
{
delete face_analyser;
}
{
delete hog_features;
delete aligned_face;
delete num_cols;
delete num_rows;
delete face_analyser;
}

// Destructor. Called on explicit Dispose() only.
Expand All @@ -306,4 +286,4 @@ public ref class FaceAnalyserManaged
};
}

#endif
#endif // FACE_ANALYSER_INTEROP_H
21 changes: 6 additions & 15 deletions lib/local/CppInerop/FaceDetectorInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
//
///////////////////////////////////////////////////////////////////////////////

#ifndef __LANDMARK_DETECTOR_UTILS_INTEROP_h_
#define __LANDMARK_DETECTOR_UTILS_INTEROP_h_
#ifndef FACE_DETECTOR_INTEROP_H
#define FACE_DETECTOR_INTEROP_H

#pragma once

Expand Down Expand Up @@ -139,18 +139,9 @@ namespace FaceDetectorInterop {
// May be called multiple times.
!FaceDetector()
{
if (face_detector_hog != nullptr)
{
delete face_detector_hog;
}
if (face_detector_mtcnn != nullptr)
{
delete face_detector_mtcnn;
}
if (face_detector_haar != nullptr)
{
delete face_detector_haar;
}
delete face_detector_hog;
delete face_detector_mtcnn;
delete face_detector_haar;
}

// Destructor. Called on explicit Dispose() only.
Expand All @@ -163,4 +154,4 @@ namespace FaceDetectorInterop {

}

#endif
#endif // FACE_DETECTOR_INTEROP_H
37 changes: 8 additions & 29 deletions lib/local/CppInerop/GazeAnalyserInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
//
///////////////////////////////////////////////////////////////////////////////

// FaceAnalyser_Interop.h
#ifndef __GAZE_ANALYSER_INTEROP_h_
#define __GAZE_ANALYSER_INTEROP_h_
#ifndef GAZE_ANALYSER_INTEROP_H
#define GAZE_ANALYSER_INTEROP_H

#pragma once

Expand Down Expand Up @@ -175,31 +174,11 @@ namespace GazeAnalyser_Interop {
// May be called multiple times.
!GazeAnalyserManaged()
{
if (gazeDirection0 != nullptr)
{
delete gazeDirection0;
}

if (gazeDirection1 != nullptr)
{
delete gazeDirection1;
}

if (gazeAngle != nullptr)
{
delete gazeAngle;
}

if (pupil_left != nullptr)
{
delete pupil_left;
}

if (pupil_right != nullptr)
{
delete pupil_right;
}

delete gazeDirection0;
delete gazeDirection1;
delete gazeAngle;
delete pupil_left;
delete pupil_right;
}

// Destructor. Called on explicit Dispose() only.
Expand All @@ -211,4 +190,4 @@ namespace GazeAnalyser_Interop {
};
}

#endif
#endif // GAZE_ANALYSER_INTEROP_H
23 changes: 4 additions & 19 deletions lib/local/CppInerop/ImageReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,25 +175,10 @@ namespace UtilitiesOF {
// May be called multiple times.
!ImageReader()
{
// Automatically closes capture object before freeing memory.
if (m_image_capture != nullptr)
{
delete m_image_capture;
}

if (m_rgb_frame != nullptr)
{
delete m_rgb_frame;
}
if (m_gray_frame != nullptr)
{
delete m_gray_frame;
}
if (m_is_opened != nullptr)
{
delete m_is_opened;
}

delete m_image_capture;
delete m_rgb_frame;
delete m_gray_frame;
delete m_is_opened;
}

// Destructor. Called on explicit Dispose() only.
Expand Down
6 changes: 3 additions & 3 deletions lib/local/CppInerop/LandmarkDetectorInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
//
///////////////////////////////////////////////////////////////////////////////

#ifndef __LANDMARK_DETECTOR_INTEROP_h_
#define __LANDMARK_DETECTOR_INTEROP_h_
#ifndef LANDMARK_DETECTOR_INTEROP_H
#define LANDMARK_DETECTOR_INTEROP_H

#pragma once

Expand Down Expand Up @@ -450,4 +450,4 @@ namespace CppInterop {

}

#endif
#endif // LANDMARK_DETECTOR_INTEROP_H
16 changes: 2 additions & 14 deletions lib/local/CppInerop/RecorderInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
//
///////////////////////////////////////////////////////////////////////////////

// Camera_Interop.h

#pragma once

#pragma unmanaged
Expand Down Expand Up @@ -77,12 +75,7 @@ namespace UtilitiesOF {

!RecorderOpenFaceParameters()
{
// Automatically closes capture object before freeing memory.
if (m_params != nullptr)
{
delete m_params;
}

delete m_params;
}

// Destructor. Called on explicit Dispose() only.
Expand Down Expand Up @@ -249,12 +242,7 @@ namespace UtilitiesOF {
// May be called multiple times.
!RecorderOpenFace()
{
// Automatically closes capture object before freeing memory.
if (m_recorder != nullptr)
{
delete m_recorder;
}

delete m_recorder;
}

// Destructor. Called on explicit Dispose() only.
Expand Down
18 changes: 3 additions & 15 deletions lib/local/CppInerop/SequenceReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,21 +222,9 @@ namespace UtilitiesOF {
// May be called multiple times.
!SequenceReader()
{
// Automatically closes capture object before freeing memory.
if (m_sequence_capture != nullptr)
{
delete m_sequence_capture;
}

if (m_rgb_frame != nullptr)
{
delete m_rgb_frame;
}
if (m_gray_frame != nullptr)
{
delete m_gray_frame;
}

delete m_sequence_capture;
delete m_rgb_frame;
delete m_gray_frame;
}

// Destructor. Called on explicit Dispose() only.
Expand Down
6 changes: 1 addition & 5 deletions lib/local/CppInerop/VisualizerInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,7 @@ namespace UtilitiesOF {
!Visualizer()
{
// Automatically closes capture object before freeing memory.
if (m_visualizer != nullptr)
{
delete m_visualizer;
}

delete m_visualizer;
}

// Destructor. Called on explicit Dispose() only.
Expand Down
Loading