Commit e39065bf authored by biagio montesano's avatar biagio montesano

Created nested namespace. Modified interface classes.

parent 92761997
......@@ -55,8 +55,10 @@
namespace cv
{
namespace line_descriptor
{
CV_EXPORTS bool initModule_line_descriptor();
//CV_EXPORTS bool initModule_line_descriptor();
struct CV_EXPORTS KeyLine
{
......@@ -421,14 +423,15 @@ struct CV_EXPORTS DrawLinesMatchesFlags
/* draw matches between two images */
CV_EXPORTS void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, const Mat& img2, const std::vector<KeyLine>& keylines2,
const std::vector<DMatch>& matches1to2, Mat& outImg, const Scalar& matchColor = Scalar::all( -1 ),
const Scalar& singleLineColor = Scalar::all( -1 ), const std::vector<char>& matchesMask = std::vector<char>(),
int flags = DrawLinesMatchesFlags::DEFAULT );
const std::vector<DMatch>& matches1to2, Mat& outImg, const Scalar& matchColor = Scalar::all( -1 ),
const Scalar& singleLineColor = Scalar::all( -1 ), const std::vector<char>& matchesMask = std::vector<char>(),
int flags = DrawLinesMatchesFlags::DEFAULT );
/* draw extracted lines on original image */
CV_EXPORTS void drawKeylines( const Mat& image, const std::vector<KeyLine>& keylines, Mat& outImage, const Scalar& color = Scalar::all( -1 ),
int flags = DrawLinesMatchesFlags::DEFAULT );
int flags = DrawLinesMatchesFlags::DEFAULT );
}
}
#endif
......@@ -42,6 +42,7 @@
#include "perf_precomp.hpp"
using namespace cv;
using namespace cv::line_descriptor;
using namespace std;
using namespace perf;
using std::tr1::make_tuple;
......
......@@ -42,6 +42,7 @@
#include "perf_precomp.hpp"
using namespace cv;
using namespace cv::line_descriptor;
using namespace std;
using namespace perf;
using std::tr1::make_tuple;
......
......@@ -42,6 +42,7 @@
#include "perf_precomp.hpp"
using namespace cv;
using namespace cv::line_descriptor;
using namespace std;
using namespace perf;
using std::tr1::make_tuple;
......
......@@ -50,6 +50,8 @@
#include <iostream>
using namespace cv;
using namespace cv::line_descriptor;
static const char* keys =
{ "{@image_path | | Image path }" };
......@@ -96,3 +98,5 @@ int main( int argc, char** argv )
bd->compute( imageMat, keylines, descriptors);
}
......@@ -52,6 +52,7 @@
#include <time.h>
using namespace cv;
using namespace cv::line_descriptor;
static const char* keys =
{ "{@image_path1 | | Image path 1 }"
......@@ -192,8 +193,6 @@ int main( int argc, char** argv )
/* require knn match */
bdm->knnMatch( descr1, descr2, matches, 6 );
}
......@@ -50,6 +50,7 @@
#include <iostream>
using namespace cv;
using namespace cv::line_descriptor;
using namespace std;
static const char* keys =
......
......@@ -50,6 +50,7 @@
#include <iostream>
using namespace cv;
using namespace cv::line_descriptor;
using namespace std;
static const char* keys =
......
......@@ -52,6 +52,7 @@
#define MATCHES_DIST_THRESHOLD 25
using namespace cv;
using namespace cv::line_descriptor;
static const char* keys =
{ "{@image_path1 | | Image path 1 }"
......@@ -146,7 +147,7 @@ int main( int argc, char** argv )
imshow( "Matches", outImg );
waitKey();
imwrite("/home/ubisum/Desktop/images/matches.jpg", outImg);
imwrite("/home/ubisum/Desktop/images/env_match/matches.jpg", outImg);
/* create an LSD detector */
Ptr<LSDDetector> lsd = LSDDetector::createLSDDetector();
......@@ -203,5 +204,7 @@ int main( int argc, char** argv )
imshow( "LSD matches", lsd_outImg );
waitKey();
}
......@@ -51,6 +51,7 @@
#include <vector>
using namespace cv;
using namespace cv::line_descriptor;
static const std::string images[] =
{ "cameraman.jpg", "church.jpg", "church2.png", "einstein.jpg", "stuff.jpg" };
......
......@@ -41,8 +41,11 @@
#include "precomp.hpp"
using namespace cv;
//using namespace cv;
namespace cv
{
namespace line_descriptor
{
Ptr<LSDDetector> LSDDetector::createLSDDetector()
{
return Ptr<LSDDetector>( new LSDDetector() );
......@@ -199,10 +202,12 @@ void LSDDetector::detectImpl( const Mat& imageSrc, std::vector<KeyLine>& keyline
for ( size_t keyCounter = 0; keyCounter < keylines.size(); keyCounter++ )
{
KeyLine kl = keylines[keyCounter];
if( mask.at<uchar>( (int)kl.startPointY, (int)kl.startPointX ) == 0 && mask.at<uchar>( (int)kl.endPointY, (int)kl.endPointX ) == 0 )
if( mask.at<uchar>( (int) kl.startPointY, (int) kl.startPointX ) == 0 && mask.at<uchar>( (int) kl.endPointY, (int) kl.endPointX ) == 0 )
keylines.erase( keylines.begin() + keyCounter );
}
}
}
}
}
......@@ -46,6 +46,8 @@
//using namespace cv;
namespace cv
{
namespace line_descriptor
{
/* combinations of internal indeces for binary descriptor extractor */
static const int combinations[32][2] =
......@@ -1345,3 +1347,4 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines, bool useDetectionData )
}
}
}
......@@ -41,7 +41,11 @@
#include "precomp.hpp"
using namespace cv;
//using namespace cv;
namespace cv
{
namespace line_descriptor
{
/* constructor */
BinaryDescriptorMatcher::BinaryDescriptorMatcher()
......@@ -583,3 +587,5 @@ void BinaryDescriptorMatcher::radiusMatch( const Mat& queryDescriptors, std::vec
delete numres;
}
}
}
......@@ -43,6 +43,8 @@
namespace cv
{
namespace line_descriptor
{
/* draw matches between two images */
void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, const Mat& img2, const std::vector<KeyLine>& keylines2,
const std::vector<DMatch>& matches1to2, Mat& outImg, const Scalar& matchColor, const Scalar& singleLineColor,
......@@ -185,3 +187,4 @@ void drawKeylines( const Mat& image, const std::vector<KeyLine>& keylines, Mat&
}
}
}
......@@ -43,6 +43,8 @@
namespace cv
{
namespace line_descriptor
{
CV_INIT_ALGORITHM( BinaryDescriptor, "BINARY.DESCRIPTOR", );
CV_INIT_ALGORITHM( BinaryDescriptorMatcher, "BINARY.DESCRIPTOR.MATCHER", );
......@@ -59,3 +61,4 @@ bool initModule_line_descriptor( void )
}
}
}
......@@ -66,6 +66,7 @@
#include <time.h>
#include <stdexcept>
#include <sstream>
#include <vector>
#include "opencv2/line_descriptor.hpp"
......
......@@ -42,6 +42,7 @@
#include "test_precomp.hpp"
using namespace cv;
using namespace cv::line_descriptor;
/****************************************************************************************\
* Regression tests for line detector comparing keylines. *
......
......@@ -42,6 +42,7 @@
#include "test_precomp.hpp"
using namespace cv;
using namespace cv::line_descriptor;
/****************************************************************************************\
* Regression tests for line detector comparing keylines. *
......
......@@ -42,6 +42,7 @@
#include "test_precomp.hpp"
using namespace cv;
using namespace cv::line_descriptor;
class CV_BinaryDescriptorMatcherTest : public cvtest::BaseTest
{
......
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