diff --git a/Emgu.CV.Contrib/Emgu.CV.Contrib.projitems b/Emgu.CV.Contrib/Emgu.CV.Contrib.projitems index 91cdefb54..8995adbec 100644 --- a/Emgu.CV.Contrib/Emgu.CV.Contrib.projitems +++ b/Emgu.CV.Contrib/Emgu.CV.Contrib.projitems @@ -20,5 +20,6 @@ + diff --git a/Emgu.CV.Contrib/LineDescriptor/MKeyLine.cs b/Emgu.CV.Contrib/LineDescriptor/MKeyLine.cs new file mode 100644 index 000000000..55b794cc6 --- /dev/null +++ b/Emgu.CV.Contrib/LineDescriptor/MKeyLine.cs @@ -0,0 +1,79 @@ +//---------------------------------------------------------------------------- +// Copyright (C) 2004-2016 by EMGU Corporation. All rights reserved. +//---------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using Emgu.CV.Structure; +using Emgu.CV.Text; +using Emgu.CV.Util; +using Emgu.Util; +using System.Diagnostics; +using System.Drawing; + +namespace Emgu.CV.LineDescriptor +{ + public struct MKeyLine + { + /// + /// Orientation of the line + /// + public float Angle; + + /// + /// Object ID, that can be used to cluster keylines by the line they represent + /// + public int ClassId; + + /// + /// Octave (pyramid layer), from which the keyline has been extracted + /// + public int Octave; + + /// + /// Coordinates of the middlepoint + /// + public PointF Pt; + + /// + /// The response, by which the strongest keylines have been selected. + /// It's represented by the ratio between line's length and maximum between + /// image's width and height + /// + public float Response; + + /// + /// Minimum area containing line + /// + public float Size; + + /// + /// Lines's extremes in original image + /// + public float StartPointX; + public float StartPointY; + public float EndPointX; + public float EndPointY; + + /// + /// Line's extremes in image it was extracted from + /// + public float SPointInOctaveX; + public float SPointInOctaveY; + public float EPointInOctaveX; + public float EPointInOctaveY; + + /// + /// The length of line + /// + public float LineLength; + + /// + /// Number of pixels covered by the line + /// + public int NumOfPixels; + + } +} \ No newline at end of file diff --git a/Emgu.CV.Extern/CMakeLists.txt b/Emgu.CV.Extern/CMakeLists.txt index e9d0364f8..8f2d12258 100644 --- a/Emgu.CV.Extern/CMakeLists.txt +++ b/Emgu.CV.Extern/CMakeLists.txt @@ -71,6 +71,10 @@ IF(HAVE_opencv_text) CREATE_VECTOR_CS("ERStat" "cv::text::ERStat" "MCvERStat" "struct" ${CMAKE_CURRENT_SOURCE_DIR}/../Emgu.CV.Contrib/Text Emgu.CV.Text "#include \"opencv2/text/erfilter.hpp\"") ENDIF() +IF(HAVE_opencv_line_descriptor) + CREATE_VECTOR_CS("KeyLine" "cv::line_descriptor::KeyLine" "MKeyLine" "struct" ${CMAKE_CURRENT_SOURCE_DIR}/../Emgu.CV.Contrib/LineDescriptor Emgu.CV.LineDescriptor "#include \"opencv2/line_descriptor.hpp\"") +ENDIF() + IF(HAVE_opencv_highgui) CREATE_VECTOR_CS("ColorPoint" "ColorPoint" "ColorPoint" "struct" ${CMAKE_CURRENT_SOURCE_DIR}/../Emgu.CV/Util Emgu.CV.Util "#include \"highgui_c_extra.h\"") ENDIF() diff --git a/Emgu.CV.Extern/line_descriptor/line_descriptor_c.cpp b/Emgu.CV.Extern/line_descriptor/line_descriptor_c.cpp index b355cc643..f2f35d562 100644 --- a/Emgu.CV.Extern/line_descriptor/line_descriptor_c.cpp +++ b/Emgu.CV.Extern/line_descriptor/line_descriptor_c.cpp @@ -12,6 +12,10 @@ cv::line_descriptor::BinaryDescriptor* cveLineDescriptorBinaryDescriptorCreate() ptr.addref(); return ptr.get(); } +void cveBinaryDescriptorDetect(cv::line_descriptor::BinaryDescriptor* descriptor, cv::Mat* image, std::vector* keypoints, cv::Mat* mask) +{ + descriptor->detect(*image, *keypoints, mask ? *mask : cv::Mat()); +} void cveLineDescriptorBinaryDescriptoyRelease(cv::line_descriptor::BinaryDescriptor** descriptor) { delete * descriptor; diff --git a/Emgu.CV.Extern/line_descriptor/line_descriptor_c.h b/Emgu.CV.Extern/line_descriptor/line_descriptor_c.h index 03e935786..5c884167e 100644 --- a/Emgu.CV.Extern/line_descriptor/line_descriptor_c.h +++ b/Emgu.CV.Extern/line_descriptor/line_descriptor_c.h @@ -12,5 +12,6 @@ #include "opencv2/line_descriptor.hpp" CVAPI(cv::line_descriptor::BinaryDescriptor*) cveLineDescriptorBinaryDescriptorCreate(); +CVAPI(void) cveBinaryDescriptorDetect(cv::line_descriptor::BinaryDescriptor* descriptor, cv::Mat* image, std::vector* keypoints, cv::Mat* mask); CVAPI(void) cveLineDescriptorBinaryDescriptoyRelease(cv::line_descriptor::BinaryDescriptor** descriptor); #endif \ No newline at end of file