Commit d5eeb91d authored by biagio montesano's avatar biagio montesano

New line extraction method and OpenCV standards accomplished

parent d79ae76a
set(the_description "Line descriptor")
ocv_define_module(line_descriptor opencv_imgproc opencv_optim)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIAS_CXX_FLAGS} -std=c++0x")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIAS_C_FLAGS}")
set(the_description "Line descriptor")
ocv_define_module(line_descriptor opencv_imgproc opencv_optim)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIAS_CXX_FLAGS} -std=c++0x")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIAS_C_FLAGS}")
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_LINE_DESCRIPTOR_HPP__
#define __OPENCV_LINE_DESCRIPTOR_HPP__
#include "opencv2/line_descriptor/descriptor.hpp"
#include "opencv2/core.hpp"
namespace cv
{
CV_EXPORTS bool initModule_line_descriptor(void);
}
#endif
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
//#ifdef __OPENCV_BUILD
//#error this is a compatibility header which should not be used inside the OpenCV library
//#endif
#ifndef __OPENCV_DESCRIPTOR_HPP__
#define __OPENCV_DESCRIPTOR_HPP__
#include "LineStructure.hpp"
#include "opencv2/core.hpp"
namespace cv
{
class CV_EXPORTS_W LineDescriptor : public virtual Algorithm
{
public:
virtual ~LineDescriptor();
void getLineBinaryDescriptor(std::vector<cv::Mat> & oct_binaryDescMat);
protected:
virtual void getLineBinaryDescriptorImpl(std::vector<cv::Mat> & oct_binaryDescMat,
ScaleLines &keyLines);
};
class CV_EXPORTS_W BinaryDescriptor : public LineDescriptor
{
public:
struct CV_EXPORTS_W_SIMPLE Params{
CV_WRAP Params();
/* global threshold for line descriptor distance, default is 0.35 */
CV_PROP_RW float LowestThreshold;
/* the NNDR threshold for line descriptor distance, default is 0.6 */
CV_PROP_RW float NNDRThreshold;
/* the size of Gaussian kernel: ksize X ksize, default value is 5 */
CV_PROP_RW int ksize_;
/* the number of image octaves (default = 5) */
CV_PROP_RW int numOfOctave_;
/* the number of bands used to compute line descriptor (default: 9) */
CV_PROP_RW int numOfBand_;
/* the width of band; (default: 7) */
CV_PROP_RW int widthOfBand_;
/* image's reduction ratio in construction of Gaussian pyramids */
CV_PROP_RW int reductionRatio;
void read( const FileNode& fn );
void write( FileStorage& fs ) const;
};
CV_WRAP BinaryDescriptor(const BinaryDescriptor::Params &parameters =
BinaryDescriptor::Params());
virtual void read( const cv::FileNode& fn );
virtual void write( cv::FileStorage& fs ) const;
void getLineBinaryDescriptor(cv::Mat & oct_binaryDescMat, ScaleLines &keyLines);
protected:
virtual void getLineBinaryDescriptorImpl(std::vector<cv::Mat> & oct_binaryDescMat, ScaleLines &keyLines);
AlgorithmInfo* info() const;
Params params;
private:
unsigned char binaryTest(float* f1, float* f2);
int ComputeLBD_(ScaleLines &keyLines);
/* the local gaussian coefficient apply to the orthogonal line direction within each band */
std::vector<float> gaussCoefL_;
/* the global gaussian coefficient apply to each Row within line support region */
std::vector<float> gaussCoefG_;
/* vector to store horizontal and vertical derivatives of octave images */
std::vector<cv::Mat> dxImg_vector, dyImg_vector;
/* vectot to store sizes of octave images */
std::vector<cv::Size> images_sizes;
};
}
#endif
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
//#ifdef __OPENCV_BUILD
//#error this is a compatibility header which should not be used inside the OpenCV library
//#endif
#ifndef __OPENCV_LINE_DETECTOR_HPP__
#define __OPENCV_LINE_DETECTOR_HPP__
#include <algorithm>
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "LineDescriptor.hpp"
#include "LineStructure.hpp"
#endif
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_TRACKING_HPP__
#define __OPENCV_TRACKING_HPP__
#include "opencv2/line_descriptor/line_detector.hpp"
namespace cv
{
CV_EXPORTS bool initModule_line_descriptor(void);
}
#endif //__OPENCV_TRACKING_HPP__
This diff is collapsed.
......@@ -40,20 +40,20 @@
//M*/
#include "precomp.hpp"
#include "opencv2/line_detector.hpp"
//#include "opencv2/line_descriptor.hpp"
//class BinaryDescriptor;
namespace cv
{
CV_INIT_ALGORITHM(EDLineDetector, "EDLINEDETECTOR",);
CV_INIT_ALGORITHM(LineDescriptor, "LINEDESCRIPTOR",);
CV_INIT_ALGORITHM(BinaryDescriptor, "BINARY.DESCRIPTOR",);
bool initModule_tracking(void)
bool initModule_line_descriptor(void)
{
bool all = true;
all &= !EDLineDetector_info_auto.name().empty();
all &= !LineDescriptor_info_auto.name().empty();
all &= !BinaryDescriptor_info_auto.name().empty();
return all;
}
......
......@@ -42,13 +42,17 @@
#ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__
#include "opencv2/line_descriptor/EDLineDetector.hpp"
#include "opencv2/line_descriptor/LineDescriptor.hpp"
#include "opencv2/line_descriptor/LineStructure.hpp"
#include <algorithm>
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
#include <algorithm>
#include <opencv2/imgproc.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/highgui.hpp>
#include "opencv2/line_descriptor.hpp"
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment