Commit 01ad783f authored by Thiago C. Santini's avatar Thiago C. Santini

Initial commit

EyeRec is moving to its own repository for the public release.

The commit history was removed as it may contain sensitive information.

Swirski and Starburst pupil detection algorithms are disabled and not
included as to not contaminate the licensing until we get an answer from
the legal department in this regard.

For internal use:

This is a reorganization of the build structure from:

Repository: SOMA
Branch: migration
Commit: commit ba09d5c3533bf0fd45dd0f94f8aee7f13d70b17d

For the private version containing industry-related features use:

Repository: SOMA
Branch: EyeRec
parents
QT += core gui opengl network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
#DEFINES += STARBURST
#DEFINES += SWIRSKI
TOP = $$PWD
TARGET = EyeRec
SOURCES += \
$${TOP}/src/main.cpp \
$${TOP}/src/ImageProcessing.cpp \
$${TOP}/src/ImageAcquisition.cpp \
$${TOP}/src/NetworkStream.cpp \
$${TOP}/src/Journal.cpp \
$${TOP}/src/Gui.cpp \
$${TOP}/src/PerfCounter.cpp \
$${TOP}/src/Calibration.cpp \
$${TOP}/src/settings.cpp \
$${TOP}/src/utils.cpp
HEADERS += \
$${TOP}/src/ImageProcessing.h \
$${TOP}/src/ImageAcquisition.h \
$${TOP}/src/Journal.h \
$${TOP}/src/PerfCounter.h \
$${TOP}/src/Calibration.h \
$${TOP}/src/settings.h \
$${TOP}/src/utils.h \
$${TOP}/src/NetworkStream.h \
$${TOP}/src/Gui.h \
$${TOP}/excuse/algo.h \
$${TOP}/excuse/bw_select.h \
$${TOP}/excuse/canny_ml.h \
$${TOP}/excuse/canny_neu.h \
$${TOP}/excuse/find_best_edge.h \
$${TOP}/excuse/get_curves.h \
$${TOP}/excuse/hypot.h \
$${TOP}/excuse/optimize_pos.h \
$${TOP}/excuse/peek.h \
$${TOP}/excuse/remove_points_with_low_angle.h \
$${TOP}/excuse/rgb2gray_matlab.h \
$${TOP}/excuse/stdafx.h \
$${TOP}/excuse/targetver.h \
$${TOP}/excuse/th_angular_histo.h \
$${TOP}/excuse/zero_around_region_th_border.h \
$${TOP}/else/algo.h \
$${TOP}/else/blob_gen.h \
$${TOP}/else/canny_impl.h \
$${TOP}/else/filter_edges.h \
$${TOP}/else/find_best_edge.h
FORMS += \
$${TOP}/src/Gui.ui
INCLUDEPATH += $${TOP}/src
RESOURCES += \
$${TOP}/resources.qrc
win32: RC_ICONS = $${TOP}/icons/eyerec.ico
Debug:DBG_SUFFIX = "d"
CV_SUFFIX=300
OPENCV_INC_DIR = $${TOP}/deps/opencv3.0.0/include
OPENCV_LIB_DIR = $${TOP}/deps/opencv3.0.0/x86/vc11/lib
INCLUDEPATH += "$${OPENCV_INC_DIR}"
LIBS += "-L$${OPENCV_LIB_DIR}"
LIBS += \
-lopencv_calib3d$${CV_SUFFIX} \
-lopencv_core$${CV_SUFFIX} \
-lopencv_highgui$${CV_SUFFIX} \
-lopencv_imgcodecs$${CV_SUFFIX} \
-lopencv_imgproc$${CV_SUFFIX} \
-lopencv_videoio$${CV_SUFFIX}
VIDEOMAN_INC_DIR = $${TOP}/deps/VideoMan1.1/include
VIDEOMAN_LIB_DIR = $${TOP}/deps/VideoMan1.1/bin
INCLUDEPATH += "$${VIDEOMAN_INC_DIR}"
LIBS += "-L$${VIDEOMAN_LIB_DIR}"
LIBS += -lVideoMan$${DBG_SUFFIX}
contains(DEFINES, STARBURST) {
SOURCES += $${TOP}/starburst/Starburst.cpp
HEADERS += $${TOP}/starburst/Starburst.h
}
contains(DEFINES, SWIRSKI) {
SOURCES += $${TOP}/swirski/Swirski.cpp
HEADERS += $${TOP}/swirski/Swirski.h
TBB_INC_DIR = $${TOP}/deps/tbb43/include
TBB_LIB_DIR = $${TOP}/deps/tbb43/lib/ia32/vc11
INCLUDEPATH += "$${TBB_INC_DIR}"
LIBS += "-L$${TBB_LIB_DIR}"
LIBS += -ltbb
}
cmake_minimum_required(VERSION 2.4)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
PROJECT( VideoMan )
SET ( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
SET ( CMAKE_DEBUG_POSTFIX d )
IF ( NOT VideoMan_3rdParty )
SET ( LIBRARY_OUTPUT_PATH ${VideoMan_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all libraries." FORCE )
SET ( EXECUTABLE_OUTPUT_PATH ${VideoMan_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all executables." FORCE )
ENDIF()
set_property(GLOBAL PROPERTY USE_FOLDERS On)
INCLUDE_DIRECTORIES( include )
option(VIDEOMAN_BUILD_OPENGL_RENDERER "Use OpenGL Renderer" ON)
IF ( VIDEOMAN_BUILD_OPENGL_RENDERER )
FIND_PACKAGE( OpenGL )
add_definitions(-DVM_OGLRenderer)
INCLUDE_DIRECTORIES( ${OPENGL_INCLUDE_DIR} )
ENDIF ( VIDEOMAN_BUILD_OPENGL_RENDERER )
LINK_DIRECTORIES(
)
SET( VideoMan_SRCS
control/VideoManControl.cpp
include/VideoManControl.h
control/VideoManControlPrivate.h
control/VideoManFactory.cpp
control/VideoManFactory.h
control/VideoManInputFormat.cpp
include/VideoManInputFormat.h
)
SET( VideoMan_SRCS_INPUTS
control/inputs/UserInput.cpp
control/inputs/UserInput.h
control/inputs/VideoManInputController.cpp
include/VideoManInputController.h
include/VideoInput.h
)
SET( VideoMan_SRCS_RENDERER
control/renderers/VideoManRenderer.cpp
control/renderers/VideoManRenderer.h
)
IF ( VIDEOMAN_BUILD_OPENGL_RENDERER )
SET( VideoMan_SRCS_RENDERER
${VideoMan_SRCS_RENDERER}
control/renderers/VideoManRendererOGL.cpp
control/renderers/VideoManRendererOGL.h
)
ENDIF ( VIDEOMAN_BUILD_OPENGL_RENDERER )
SOURCE_GROUP(inputs FILES ${VideoMan_SRCS_INPUTS})
SOURCE_GROUP(renderer FILES ${VideoMan_SRCS_RENDERER})
ADD_LIBRARY( VideoMan SHARED
${VideoMan_SRCS}
${VideoMan_SRCS_INPUTS}
${VideoMan_SRCS_RENDERER}
)
SET_PROPERTY(TARGET VideoMan PROPERTY LINK_INTERFACE_LIBRARIES "")
IF ( VIDEOMAN_BUILD_OPENGL_RENDERER )
TARGET_LINK_LIBRARIES( VideoMan ${OPENGL_LIBRARIES} )
ENDIF ( VIDEOMAN_BUILD_OPENGL_RENDERER )
add_subdirectory( inputs )
option(VIDEOMAN_BUILD_EXAMPLES "Build examples" ON)
option(VIDEOMAN_BUILD_EXAMPLES_OPENCV "Build examples using OpenCV" ON)
IF(VIDEOMAN_BUILD_OPENGL_RENDERER)
option(VIDEOMAN_BUILD_EXAMPLES_GLUT "Build examples based on GLUT" ON)
option(VIDEOMAN_BUILD_EXAMPLES_SFML "Build examples based on SFML" ON)
option(VIDEOMAN_BUILD_EXAMPLES_QT "Build examples based on QT" OFF)
option(VIDEOMAN_BUILD_EXAMPLES_CUDA "Build examples using CUDA" OFF)
ENDIF ( VIDEOMAN_BUILD_OPENGL_RENDERER )
IF ( NOT VIDEOMAN_BUILD_EXAMPLES)
SET( VIDEOMAN_BUILD_EXAMPLES_OPENCV OFF CACHE BOOL "" FORCE )
SET( VIDEOMAN_BUILD_EXAMPLES_GLUT OFF CACHE BOOL "" FORCE )
SET( VIDEOMAN_BUILD_EXAMPLES_SFML OFF CACHE BOOL "" FORCE )
SET( VIDEOMAN_BUILD_EXAMPLES_QT OFF CACHE BOOL "" FORCE )
SET( VIDEOMAN_BUILD_EXAMPLES_CUDA OFF CACHE BOOL "" FORCE )
ENDIF ( NOT VIDEOMAN_BUILD_EXAMPLES )
IF(NOT VIDEOMAN_BUILD_OPENGL_RENDERER)
SET( VIDEOMAN_BUILD_EXAMPLES_GLUT OFF CACHE BOOL "" FORCE )
SET( VIDEOMAN_BUILD_EXAMPLES_SFML OFF CACHE BOOL "" FORCE )
SET( VIDEOMAN_BUILD_EXAMPLES_QT OFF CACHE BOOL "" FORCE )
SET( VIDEOMAN_BUILD_EXAMPLES_CUDA OFF CACHE BOOL "" FORCE )
ENDIF(NOT VIDEOMAN_BUILD_OPENGL_RENDERER)
IF(VIDEOMAN_BUILD_EXAMPLES)
add_subdirectory( examples )
ENDIF(VIDEOMAN_BUILD_EXAMPLES)
#------ FindVideoMan.cmake ---------
set(${PROJECT_NAME}_VERSION "1.1.0" )
string(REGEX MATCHALL "[0-9]" ${PROJECT_NAME}_VERSION_PARTS "${${PROJECT_NAME}_VERSION}" )
list(GET ${PROJECT_NAME}_VERSION_PARTS 0 ${PROJECT_NAME}_VERSION_MAJOR)
list(GET ${PROJECT_NAME}_VERSION_PARTS 1 ${PROJECT_NAME}_VERSION_MINOR)
list(GET ${PROJECT_NAME}_VERSION_PARTS 2 ${PROJECT_NAME}_VERSION_PATCH)
set(${PROJECT_NAME}_SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}" )
#set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE ${PROJECT_SOURCE_DIR}/include/)
#set(CMAKE_LIB_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/lib CACHE PATH "Output directory for libraries" )
set(CMAKE_LIB_DIRS_CONFIGCMAKE ${VideoMan_BINARY_DIR}/bin/ )
set( VideoMan_DEBUG_POSTFIX d)
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/config.cmake.in" "${VideoMan_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @ONLY)
SET( $ENV{VideoMan_DIR} ${PROJECT_BINARY_DIR} )
Changes in Videoman 1.1:
-General:
* Namespace VideoMan
* New Naming convention
* Better documentation
-Inputs:
* VMIDSFalcon for IDS Falcon framegrabbers
* VMIDSuEye for IDS uEye cameras
* VMImageFile for loading an image with OpenCV
-Examples:
* New example with Qt
* IDS uEye cameras
* Nvidia CUDA
* PointGrey cameras
* Example with VMImageSequence
* Glut replaced by Freeglut
* PointGrey example using SFML
\ No newline at end of file
# ===================================================================================
# VideoMan CMake configuration file
#
# ** File generated automatically, do not modify **
#
# Usage from an external project:
# In your CMakeLists.txt, add these lines:
#
# FIND_PACKAGE(VideoMan REQUIRED )
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${VideoMan_LIBS})
#
# This file will define the following variables:
# - VideoMan_LIBS : The list of libraries to links against.
# - VideoMan_LIB_DIR : The directory where lib files are. Calling LINK_DIRECTORIES
# with this path is NOT needed.
# - VideoMan_VERSION : The version of this gu build. Example: "1.2.0"
# - VideoMan_VERSION_MAJOR : Major version part of gu_VERSION. Example: "1"
# - VideoMan_VERSION_MINOR : Minor version part of gu_VERSION. Example: "2"
# - VideoMan_VERSION_PATCH : Patch version part of gu_VERSION. Example: "0"
#
# ===================================================================================
OPTION (VIDEOMAN_INCLUDE_PROJECT "Include VideoMan project to the solution" OFF )
# Extract the directory where *this* file has been installed (determined at cmake run-time)
# This variable may or may not be used below, depending on the parsing of VideoManConfig.cmake
get_filename_component(THIS_VideoMan_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
SET( VideoMan_3rdParty TRUE )
# ======================================================
# Include directories to add to the user project:
# ======================================================
INCLUDE_DIRECTORIES(@CMAKE_INCLUDE_DIRS_CONFIGCMAKE@)
# ======================================================
# Link directories to add to the user project:
# ======================================================
IF (VIDEOMAN_INCLUDE_PROJECT)
LINK_DIRECTORIES("${CMAKE_BINARY_DIR}/bin" )
# Provide the libs directory anyway, it may be needed in some cases.
SET(VideoMan_LIB_DIR "${CMAKE_BINARY_DIR}/bin" )
ELSE(VIDEOMAN_INCLUDE_PROJECT)
LINK_DIRECTORIES( @CMAKE_BINARY_DIR@/bin )
# Provide the libs directory anyway, it may be needed in some cases.
SET(VideoMan_LIB_DIR "@CMAKE_BINARY_DIR@/bin" )
ENDIF(VIDEOMAN_INCLUDE_PROJECT)
# ====================================================================
# Link libraries
# ====================================================================
if (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4) # CMake>=2.6 supports the notation "debug XXd optimized XX"
SET(VideoMan_LIBS debug VideoMan@VideoMan_DLLVERSION@@VideoMan_DEBUG_POSTFIX@ optimized VideoMan@VideoMan_DLLVERSION@)
else() # Old CMake:
SET(VideoMan_LIBS VideoMan@VideoMan_DLLVERSION@)
endif()
# ======================================================
# Version variables:
# ======================================================
SET(VideoMan_VERSION @VideoMan_VERSION@)
SET(VideoMan_VERSION_MAJOR @VideoMan_VERSION_MAJOR@)
SET(VideoMan_VERSION_MINOR @VideoMan_VERSION_MINOR@)
SET(VideoMan_VERSION_PATCH @VideoMan_VERSION_PATCH@)
IF (NOT TARGET VideoMan)
IF (VIDEOMAN_INCLUDE_PROJECT)
add_subdirectory("@PROJECT_SOURCE_DIR@" ${CMAKE_BINARY_DIR}/VideoMan)
ENDIF(VIDEOMAN_INCLUDE_PROJECT)
ENDIF (NOT TARGET VideoMan)
#ifndef VIDEOINPUT_H
#define VIDEOINPUT_H
#include "VideoManInputFormat.h"
#include "VideoManInputController.h"
namespace VideoManPrivate
{
class VideoInput
{
public:
//format must be completed when the input is initialized
VideoInput( void )
{
pixelBuffer = NULL;
callback = NULL;
roiMode = false;
}
virtual ~VideoInput( void )
{
if ( identification.uniqueName )
delete identification.uniqueName;
identification.uniqueName = NULL;
if ( identification.friendlyName )
delete identification.friendlyName;
identification.friendlyName = NULL;
if ( identification.identifier )
delete identification.identifier;
identification.identifier = NULL;
if ( identification.fileName )
delete identification.fileName;
identification.fileName = NULL;
};
/** \brief Get the format of the video input
*/
VideoMan::VMInputFormat getVideoManInputFormat(){ return format; }
/** \brief Get a new frame
\param wait [in] if it must wait for next sample or not
\return the frame of the video
*/
virtual char *getFrame( bool wait = false) = 0;
virtual VideoManPrivate::VideoManInputController *getController(){ return NULL; }
virtual bool linkController( VideoManPrivate::VideoManInputController *controller ){return false;}
virtual void releaseFrame(){}
char* pixelBuffer; //The last captured frame
VideoMan::VMInputIdentification getIdentification()
{
return identification;
}
typedef void (*getFrameCallback)( char *pixelBuffer, size_t input, double timestamp, void *data );
virtual void setFrameCallback( getFrameCallback theCallback, void *data )
{
callback = theCallback;
frameCallbackData = data;
}
virtual bool supportFrameCallback()
{
return false;
}
/** VIDEO FILE METHODS **/
virtual void play(){}
virtual void pause(){}
virtual void stop(){}
virtual double getLengthSeconds(){return 0;}
virtual int getLengthFrames(){return 0;}
virtual double getPositionSeconds(){return 0;}
virtual int getPositionFrames(){return 0;}
virtual void goToFrame( int frame ){}
virtual void goToMilisecond( double milisecond ){}
/** CAPTURE DEVICES METHODS **/
virtual void showPropertyPage(){}
/** USER INPUT METHODS **/
virtual void setImage( char *image ){}
void setInputID( size_t input ){inputID = input;}
bool isRoiModeEnabled(){ return roiMode; }
void getImageRoi( int &x, int &y, int &width, int &height )
{
x = xRoi;
y = yRoi;
width = wRoi;
height = hRoi;
}
protected:
VideoMan::VMInputFormat format; //The internal format of the frames
VideoMan::VMInputIdentification identification; //The information about the input (must be released by the input module)
bool frameCaptured; //if a frame was already captured
getFrameCallback callback;
/** VIDEO FILES MEMBERS **/
int videoLengthFrames;
double videoLengthSeconds;
size_t inputID;
void *frameCallbackData;
bool roiMode;
int xRoi, yRoi, wRoi, hRoi;
};
};
#endif
This diff is collapsed.
#ifndef VIDEOMANINPUTCONTROLLER_H
#define VIDEOMANINPUTCONTROLLER_H
#ifdef WIN32
#ifdef VideoMan_EXPORTS
#define VIDEOMAN_API __declspec(dllexport)
#else
#define VIDEOMAN_API __declspec(dllimport)
#endif
#endif
#ifdef linux
#define VIDEOMAN_API
#endif
#include <string>
namespace VideoManPrivate
{
class VideoInput;
class VIDEOMAN_API VideoManInputController
{
public:
VideoManInputController( const char *identifier );
virtual ~VideoManInputController(void);
virtual bool setInput( VideoInput *input ) = 0;
const char *getIdentifier();
private:
std::string identifier;
};
};
#endif
\ No newline at end of file
#ifndef VIDEOMANINPUTFORMAT_H
#define VIDEOMANINPUTFORMAT_H
#ifdef WIN32
#ifdef VideoMan_EXPORTS
#define VIDEOMAN_API __declspec(dllexport)
#else
#define VIDEOMAN_API __declspec(dllimport)
#endif
#endif
#ifdef linux
#define VIDEOMAN_API
#endif
namespace VideoMan
{
/** \brief A structure to contain the identification of a video input.
It is needed for creating a video input with VideoManControl::addVideoInput.
In order to indentify a video input you need to know the module that will control it, for example VMDirectShow.
Each module support at least one identifier, for example VMDirectShow supports "DSHOW_VIDEO_FILE" and "DSHOW_CAPTURE_DEVICE".
The field identifier contains the identifier of the input module, for example "DSHOW_VIDEO_FILE".
- If you want to create a video input from a video file you need to fill the field fileName with its path "C:/videos/video.avi".
- If you want to create it from a capture device you need to know its friendly name, for example "Logitec webcam", and its unique name.
What this name represents depends on the input module; it could be the serial number, the device path or just an id. The unique name identifies
cameras with the same friendly name.
You can get the list of available devices with VideoManControl::getAvailableDevices. Also you can get the list of supported identifier with VideoManControl::getSupportedIdentifiers.
*/
struct VMInputIdentification
{
/** Path of a video file */
char* fileName;
/** Friendly name of a capture device */
char* friendlyName;
/** Unique name of a capture device */
char* uniqueName;
/** Identifier of the videoman module that controls the input */
char* identifier;
VMInputIdentification()
{
fileName = 0;
friendlyName = 0;
uniqueName = 0;
identifier = 0;
}
};