Created nested namespace. Modified interface classes.

pull/38/head
biagio montesano 11 years ago
parent 927619973b
commit e39065bf77
  1. 5
      modules/line_descriptor/include/opencv2/line_descriptor/descriptor.hpp
  2. 1
      modules/line_descriptor/perf/perf_descriptors.cpp
  3. 1
      modules/line_descriptor/perf/perf_detection.cpp
  4. 1
      modules/line_descriptor/perf/perf_matching.cpp
  5. 4
      modules/line_descriptor/samples/compute_descriptors.cpp
  6. 5
      modules/line_descriptor/samples/knn_matching.cpp
  7. 1
      modules/line_descriptor/samples/lines_extraction.cpp
  8. 1
      modules/line_descriptor/samples/lsd_lines_extraction.cpp
  9. 5
      modules/line_descriptor/samples/matching.cpp
  10. 1
      modules/line_descriptor/samples/radius_matching.cpp
  11. 11
      modules/line_descriptor/src/LSDDetector.cpp
  12. 3
      modules/line_descriptor/src/binary_descriptor.cpp
  13. 8
      modules/line_descriptor/src/binary_descriptor_matcher.cpp
  14. 3
      modules/line_descriptor/src/draw.cpp
  15. 3
      modules/line_descriptor/src/line_descriptor_init.cpp
  16. 1
      modules/line_descriptor/src/precomp.hpp
  17. 1
      modules/line_descriptor/test/test_descriptors_regression.cpp
  18. 1
      modules/line_descriptor/test/test_detector_regression.cpp
  19. 1
      modules/line_descriptor/test/test_matcher_regression.cpp

@ -55,8 +55,10 @@
namespace cv namespace cv
{ {
namespace line_descriptor
{
CV_EXPORTS bool initModule_line_descriptor(); //CV_EXPORTS bool initModule_line_descriptor();
struct CV_EXPORTS KeyLine struct CV_EXPORTS KeyLine
{ {
@ -430,5 +432,6 @@ CV_EXPORTS void drawKeylines( const Mat& image, const std::vector<KeyLine>& keyl
int flags = DrawLinesMatchesFlags::DEFAULT ); int flags = DrawLinesMatchesFlags::DEFAULT );
} }
}
#endif #endif

@ -42,6 +42,7 @@
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
using namespace std; using namespace std;
using namespace perf; using namespace perf;
using std::tr1::make_tuple; using std::tr1::make_tuple;

@ -42,6 +42,7 @@
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
using namespace std; using namespace std;
using namespace perf; using namespace perf;
using std::tr1::make_tuple; using std::tr1::make_tuple;

@ -42,6 +42,7 @@
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
using namespace std; using namespace std;
using namespace perf; using namespace perf;
using std::tr1::make_tuple; using std::tr1::make_tuple;

@ -50,6 +50,8 @@
#include <iostream> #include <iostream>
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
static const char* keys = static const char* keys =
{ "{@image_path | | Image path }" }; { "{@image_path | | Image path }" };
@ -96,3 +98,5 @@ int main( int argc, char** argv )
bd->compute( imageMat, keylines, descriptors); bd->compute( imageMat, keylines, descriptors);
} }

@ -52,6 +52,7 @@
#include <time.h> #include <time.h>
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
static const char* keys = static const char* keys =
{ "{@image_path1 | | Image path 1 }" { "{@image_path1 | | Image path 1 }"
@ -192,8 +193,6 @@ int main( int argc, char** argv )
/* require knn match */ /* require knn match */
bdm->knnMatch( descr1, descr2, matches, 6 ); bdm->knnMatch( descr1, descr2, matches, 6 );
} }

@ -50,6 +50,7 @@
#include <iostream> #include <iostream>
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
using namespace std; using namespace std;
static const char* keys = static const char* keys =

@ -50,6 +50,7 @@
#include <iostream> #include <iostream>
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
using namespace std; using namespace std;
static const char* keys = static const char* keys =

@ -52,6 +52,7 @@
#define MATCHES_DIST_THRESHOLD 25 #define MATCHES_DIST_THRESHOLD 25
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
static const char* keys = static const char* keys =
{ "{@image_path1 | | Image path 1 }" { "{@image_path1 | | Image path 1 }"
@ -146,7 +147,7 @@ int main( int argc, char** argv )
imshow( "Matches", outImg ); imshow( "Matches", outImg );
waitKey(); waitKey();
imwrite("/home/ubisum/Desktop/images/matches.jpg", outImg); imwrite("/home/ubisum/Desktop/images/env_match/matches.jpg", outImg);
/* create an LSD detector */ /* create an LSD detector */
Ptr<LSDDetector> lsd = LSDDetector::createLSDDetector(); Ptr<LSDDetector> lsd = LSDDetector::createLSDDetector();
@ -203,5 +204,7 @@ int main( int argc, char** argv )
imshow( "LSD matches", lsd_outImg ); imshow( "LSD matches", lsd_outImg );
waitKey(); waitKey();
} }

@ -51,6 +51,7 @@
#include <vector> #include <vector>
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
static const std::string images[] = static const std::string images[] =
{ "cameraman.jpg", "church.jpg", "church2.png", "einstein.jpg", "stuff.jpg" }; { "cameraman.jpg", "church.jpg", "church2.png", "einstein.jpg", "stuff.jpg" };

@ -41,8 +41,11 @@
#include "precomp.hpp" #include "precomp.hpp"
using namespace cv; //using namespace cv;
namespace cv
{
namespace line_descriptor
{
Ptr<LSDDetector> LSDDetector::createLSDDetector() Ptr<LSDDetector> LSDDetector::createLSDDetector()
{ {
return Ptr<LSDDetector>( new LSDDetector() ); 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++ ) for ( size_t keyCounter = 0; keyCounter < keylines.size(); keyCounter++ )
{ {
KeyLine kl = keylines[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 ); keylines.erase( keylines.begin() + keyCounter );
} }
} }
} }
}
}

@ -46,6 +46,8 @@
//using namespace cv; //using namespace cv;
namespace cv namespace cv
{ {
namespace line_descriptor
{
/* combinations of internal indeces for binary descriptor extractor */ /* combinations of internal indeces for binary descriptor extractor */
static const int combinations[32][2] = static const int combinations[32][2] =
@ -1345,3 +1347,4 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines, bool useDetectionData )
} }
} }
}

@ -41,7 +41,11 @@
#include "precomp.hpp" #include "precomp.hpp"
using namespace cv; //using namespace cv;
namespace cv
{
namespace line_descriptor
{
/* constructor */ /* constructor */
BinaryDescriptorMatcher::BinaryDescriptorMatcher() BinaryDescriptorMatcher::BinaryDescriptorMatcher()
@ -583,3 +587,5 @@ void BinaryDescriptorMatcher::radiusMatch( const Mat& queryDescriptors, std::vec
delete numres; delete numres;
} }
}
}

@ -43,6 +43,8 @@
namespace cv namespace cv
{ {
namespace line_descriptor
{
/* draw matches between two images */ /* draw matches between two images */
void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, const Mat& img2, const std::vector<KeyLine>& keylines2, 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, 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 cv
{ {
namespace line_descriptor
{
CV_INIT_ALGORITHM( BinaryDescriptor, "BINARY.DESCRIPTOR", ); CV_INIT_ALGORITHM( BinaryDescriptor, "BINARY.DESCRIPTOR", );
CV_INIT_ALGORITHM( BinaryDescriptorMatcher, "BINARY.DESCRIPTOR.MATCHER", ); CV_INIT_ALGORITHM( BinaryDescriptorMatcher, "BINARY.DESCRIPTOR.MATCHER", );
@ -59,3 +61,4 @@ bool initModule_line_descriptor( void )
} }
} }
}

@ -66,6 +66,7 @@
#include <time.h> #include <time.h>
#include <stdexcept> #include <stdexcept>
#include <sstream> #include <sstream>
#include <vector>
#include "opencv2/line_descriptor.hpp" #include "opencv2/line_descriptor.hpp"

@ -42,6 +42,7 @@
#include "test_precomp.hpp" #include "test_precomp.hpp"
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
/****************************************************************************************\ /****************************************************************************************\
* Regression tests for line detector comparing keylines. * * Regression tests for line detector comparing keylines. *

@ -42,6 +42,7 @@
#include "test_precomp.hpp" #include "test_precomp.hpp"
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
/****************************************************************************************\ /****************************************************************************************\
* Regression tests for line detector comparing keylines. * * Regression tests for line detector comparing keylines. *

@ -42,6 +42,7 @@
#include "test_precomp.hpp" #include "test_precomp.hpp"
using namespace cv; using namespace cv;
using namespace cv::line_descriptor;
class CV_BinaryDescriptorMatcherTest : public cvtest::BaseTest class CV_BinaryDescriptorMatcherTest : public cvtest::BaseTest
{ {

Loading…
Cancel
Save