Skip to content
Snippets Groups Projects
Commit fb6afa58 authored by angelsantamaria's avatar angelsantamaria
Browse files

created structure of detector, descriptor and matcher

parent 4ecc8cc7
No related branches found
No related tags found
No related merge requests found
Showing
with 387 additions and 10 deletions
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1819918851">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.1819918851" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.1819918851" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1819918851.1318867162" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.1801134637" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.479045570" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder arguments="-j4" buildPath="${workspace_loc:/vision_utils/build}" command="make" id="cdt.managedbuild.target.gnu.builder.base.1436699615" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.401435208" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1649772065" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.146329834" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.593702953" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.392834553" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1306470347" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.537733253" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1810403800" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.1501387796" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1737692358" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="vision_utils.null.883408120" name="vision_utils"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/vision_utils"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>
/Default/
.project 0 → 100644
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>vision_utils</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.toolchain.gnu.base.1819918851" name="Default">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1476617952823822664" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project>
# library source files # library source files
SET(sources vision_utils.cpp) SET(sources vision_utils.cpp cam_utils/cam_utils.cpp feature_detector/feature_detector.cpp feature_descriptor/feature_descriptor.cpp feature_matcher/feature_matcher.cpp)
# application header files # application header files
SET(headers vision_utils.h) SET(headers vision_utils.h cam_utils/cam_utils.h feature_detector/feature_detector.h feature_descriptor/feature_descriptor.h feature_matcher/feature_matcher.h)
# locate the necessary dependencies # locate the necessary dependencies
FIND_PACKAGE(Eigen3 REQUIRED)
FIND_PACKAGE(OpenCV REQUIRED)
# add the necessary include directories # add the necessary include directories
INCLUDE_DIRECTORIES(.) INCLUDE_DIRECTORIES(. ${EIGEN3_INCLUDE_DIR} ${OpenCV_INCLUDE_DIRS})
# create the shared library # create the shared library
ADD_LIBRARY(vision_utils SHARED ${sources}) ADD_LIBRARY(vision_utils SHARED ${sources})
# link necessary libraries # link necessary libraries
TARGET_LINK_LIBRARIES(vision_utils ${OpenCV_LIBS})
# install
INSTALL(TARGETS vision_utils INSTALL(TARGETS vision_utils
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/vision_utils LIBRARY DESTINATION lib/vision_utils
ARCHIVE DESTINATION lib/vision_utils) ARCHIVE DESTINATION lib/vision_utils)
INSTALL(FILES ${headers} DESTINATION include/vision_utils) INSTALL(FILES ${headers} DESTINATION include/vision_utils)
INSTALL(FILES ../Findvision_utils.cmake DESTINATION ${CMAKE_ROOT}/Modules/) INSTALL(FILES ../Findvision_utils.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
# examples of usage
ADD_SUBDIRECTORY(examples) ADD_SUBDIRECTORY(examples)
#include "cam_utils.h"
CCamUtils::CCamUtils()
{
}
CCamUtils::~CCamUtils()
{
}
bool CCamUtils::openCamera(const int& _cam_num, cv::VideoCapture& _cam)
{
cv::VideoCapture camera(_cam_num);
if (!camera.isOpened()) // check if we succeeded
{
std::cerr << "ERROR: Could not open camera: " << _cam_num << std::endl;
return false;
}
_cam = camera;
return true;
}
bool CCamUtils::getFrame(cv::VideoCapture& _cam, cv::Mat& _frame)
{
try
{
_cam >> _frame;
}
catch (cv::Exception& e)
{
std::cout << "An exception occurred. Ignoring frame. " << e.err << std::endl;
return false;
}
return true;
}
bool CCamUtils::showFrame(const std::string& _window_name, const cv::Mat& _frame)
{
try
{
cv::imshow(_window_name, _frame);
}
catch (cv::Exception& e)
{
std::cout << "An exception occurred. Ignoring frame. " << e.err << std::endl;
return false;
}
return true;
}
#ifndef _CAMUTILS_H
#define _CAMUTILS_H
// std stuff
#include <stdio.h>
#include <iostream>
// OpenCV stuff
#include "opencv2/opencv.hpp"
class CCamUtils
{
public:
/**
* \brief Constructor
*
* Main class constructor.
*/
CCamUtils();
/**
* \brief Destructor
*
* Main class destructor.
*/
~CCamUtils();
/**
* \brief Open Webcam
*
* This method opens the specified webcam using OpenCV
* Inputs:
* _cam_num: system camera number (int)
* Ouptuts:
* cam: camera handle (cv::VideoCapture)
*
* Returns true if the camera is correctly opened
*
*/
bool openCamera(const int& _cam_num, cv::VideoCapture& _cam);
/**
* \brief Get frame
*
* This method gets a frame from the specified webcam
*
* Inputs:
* cam: camera handle (cv::VideoCapture)
* Outputs:
* frame: filled frame (cv::Mat)
* Returns true if the frame is correctly obtained
*/
bool getFrame(cv::VideoCapture& _cam, cv::Mat& _frame);
/**
*\brief Show Frame
*
* This method shows the specified frame using OpenCV
*
* Inputs:
* window_name: Window name inwhich the frame will be displayed (string)
* frame: Frame to be displayed (cv::Mat)
* Returns true if the frame is correctly displayed
*/
bool showFrame(const std::string& _window_name, const cv::Mat& _frame);
};
#endif
# create an example application # create an example application
ADD_EXECUTABLE(vision_utils_test vision_utils_test.cpp) ADD_EXECUTABLE(capture capture.cpp)
ADD_EXECUTABLE(feature_detection feature_detection.cpp)
# link necessary libraries # link necessary libraries
TARGET_LINK_LIBRARIES(vision_utils_test vision_utils) TARGET_LINK_LIBRARIES(capture vision_utils)
TARGET_LINK_LIBRARIES(feature_detection vision_utils)
\ No newline at end of file
// OWN stuff
#include "cam_utils/cam_utils.h"
#include "vision_utils.h"
// STD stuff
#include <string>
int main(int argc, char *argv[])
{
// Camera object definition
cv::VideoCapture cam;
CCamUtils cam_fc;
// Open camera
cam_fc.openCamera(0, cam);
for (int nframe = 0; nframe < 1000; ++nframe)
{
// Get frame
cv::Mat frame;
cam_fc.getFrame(cam, frame);
// Show frame
cv::namedWindow("Cam Test");
cam_fc.showFrame("Cam Test", frame);
if (cv::waitKey(30) >= 0)
break;
}
}
// OWN stuff
#include "cam_utils/cam_utils.h"
#include "vision_utils.h"
// STD stuff
#include <string>
int main(int argc, char *argv[])
{
// Camera object definition
cv::VideoCapture cam;
CCamUtils cam_fc;
// Open camera
cam_fc.openCamera(0, cam);
for (int nframe = 0; nframe < 1000; ++nframe)
{
// Get frame
cv::Mat frame;
cam_fc.getFrame(cam, frame);
// Show ORIGINAL frame
cv::namedWindow("Cam Test");
cam_fc.showFrame("Cam Test", frame);
// Detect features
// Show frame with features
if (cv::waitKey(30) >= 0)
break;
}
}
#include "vision_utils.h"
int main(int argc, char *argv[])
{
}
#include "feature_descriptor.h"
CFeature_Descriptor::CFeature_Descriptor()
{
}
CFeature_Descriptor::~CFeature_Descriptor()
{
}
#ifndef _FEATURE_DESCRIPTOR_H
#define _FEATURE_DESCRIPTOR_H
// Descriptor types
enum DESCRIPTOR_TYPE
{
ORB, SIFT, SURF, AKAZE, KAZE, BRISK, LATCH, FREAK, BRIEF, DAISY, LBD, ROOTSIFT
};
class CFeature_Descriptor
{
public:
CFeature_Descriptor();
~CFeature_Descriptor();
};
#endif
#include "feature_detector.h"
CFeature_Detector::CFeature_Detector()
{
}
CFeature_Detector::~CFeature_Detector()
{
}
#ifndef _FEATURE_DETECTOR_H
#define _FEATURE_DETECTOR_H
// Descriptor types
enum DETECTOR_TYPE
{
ORB, SIFT, SURF, AKAZE, KAZE, BRISK, MSER, FAST, LSD, ED, AGAST
};
class CFeature_Detector
{
public:
CFeature_Detector();
~CFeature_Detector();
};
#endif
#include "feature_matcher.h"
CFeature_Matcher::CFeature_Matcher()
{
}
CFeature_Matcher::~CFeature_Matcher()
{
}
#ifndef _FEATURE_MATCHER_H
#define _FEATURE_MATCHER_H
// Matcher types
enum MATCHER_TYPE
{
BF_NORM_L2, BF_NORM_HAMMING, BF_NORM_HAMMING2
};
class CFeature_Matcher
{
public:
CFeature_Matcher();
~CFeature_Matcher();
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment