Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
e06ef978
Commit
e06ef978
authored
Aug 15, 2014
by
Alexander Shishkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added namespace ximgproc
parent
6ebd07b2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
23 deletions
+29
-23
structured_edge_detection.hpp
...oc/include/opencv2/ximgproc/structured_edge_detection.hpp
+6
-2
structured_edge_detection.cpp
modules/ximgproc/samples/structured_edge_detection.cpp
+6
-7
advanced_types.hpp
modules/ximgproc/src/advanced_types.hpp
+6
-1
structured_edge_detection.cpp
modules/ximgproc/src/structured_edge_detection.cpp
+9
-11
test_structured_edge_detection.cpp
modules/ximgproc/test/test_structured_edge_detection.cpp
+2
-2
No files found.
modules/ximgproc/include/opencv2/ximgproc/structured_edge_detection.hpp
View file @
e06ef978
...
...
@@ -42,6 +42,7 @@
#ifndef __OPENCV_STRUCTURED_EDGE_DETECTION_HPP__
#define __OPENCV_STRUCTURED_EDGE_DETECTION_HPP__
#ifdef __cplusplus
/*
* structured_edge_detection.hpp
...
...
@@ -57,7 +58,8 @@
*/
namespace
cv
{
namespace
ximgproc
{
/*! \class RFFeatureGetter
Helper class for training part of [P. Dollar and C. L. Zitnick. Structured Forests for Fast Edge Detection, 2013].
*/
...
...
@@ -120,5 +122,6 @@ CV_EXPORTS_W Ptr<StructuredEdgeDetection> createStructuredEdgeDetection(const St
const
RFFeatureGetter
*
howToGetFeatures
=
NULL
);
}
}
#endif
#endif
/* __OPENCV_STRUCTURED_EDGE_DETECTION_HPP__ */
\ No newline at end of file
modules/ximgproc/samples/structured_edge_detection.cpp
View file @
e06ef978
#include "opencv2/ximpgroc/structured_edge_detection.hpp"
#include "opencv2/imgproc.hpp"
#include <opencv2/ximgproc.hpp>
#include "opencv2/highgui.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/imgproc/types_c.h"
using
namespace
cv
;
using
namespace
cv
::
ximgproc
;
const
char
*
keys
=
{
...
...
@@ -49,8 +48,8 @@ int main( int argc, const char** argv )
cv
::
Mat
edges
(
image
.
size
(),
image
.
type
());
cv
::
Ptr
<
cv
::
StructuredEdgeDetection
>
pDollar
=
c
v
::
c
reateStructuredEdgeDetection
(
modelFilename
);
cv
::
Ptr
<
StructuredEdgeDetection
>
pDollar
=
createStructuredEdgeDetection
(
modelFilename
);
pDollar
->
detectEdges
(
image
,
edges
);
if
(
outFilename
==
""
)
...
...
modules/ximgproc/src/advanced_types.hpp
View file @
e06ef978
...
...
@@ -39,6 +39,7 @@
#ifndef __ADVANCED_TYPES_HPP__
#define __ADVANCED_TYPES_HPP__
#ifdef __cplusplus
#include <opencv2/core.hpp>
...
...
@@ -69,6 +70,8 @@ typedef cv::Mat NChannelsMat;
namespace
cv
{
namespace
ximgproc
{
template
<
typename
_Tp
,
typename
_Tp2
>
inline
cv
::
Size_
<
_Tp
>
operator
*
(
const
_Tp2
&
x
,
const
cv
::
Size_
<
_Tp
>
&
sz
)
...
...
@@ -83,5 +86,6 @@ template <typename _Tp, typename _Tp2> inline
}
}
// cv
}
#endif
#endif
/* __ADVANCED_TYPES_HPP__ */
\ No newline at end of file
modules/ximgproc/src/structured_edge_detection.cpp
View file @
e06ef978
...
...
@@ -43,17 +43,9 @@
#include <iostream>
#include <cmath>
#include "opencv2/ximpgroc/structured_edge_detection.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/core.hpp"
#include "opencv2/core/core_c.h"
#include "precomp.hpp"
#include "advanced_types.hpp"
#include "opencv2/core/types.hpp"
#include "opencv2/core/types_c.h"
/********************* Helper functions *********************/
...
...
@@ -196,7 +188,7 @@ static void gradientHist(const cv::Mat &src, cv::Mat &magnitude, cv::Mat &histog
magnitude
.
create
(
src
.
size
(),
cv
::
DataType
<
float
>::
type
);
phase
.
create
(
src
.
size
(),
cv
::
DataType
<
float
>::
type
);
histogram
.
create
(
src
.
size
()
/
float
(
pSize
)
,
histogram
.
create
(
cv
::
Size
(
src
.
size
().
width
/
float
(
pSize
),
src
.
size
().
height
/
float
(
pSize
))
,
CV_MAKETYPE
(
cv
::
DataType
<
float
>::
type
,
nBins
)
);
histogram
.
setTo
(
0
);
...
...
@@ -258,6 +250,8 @@ static void gradientHist(const cv::Mat &src, cv::Mat &magnitude, cv::Mat &histog
namespace
cv
{
namespace
ximgproc
{
class
RFFeatureGetterImpl
:
public
RFFeatureGetter
{
...
...
@@ -325,12 +319,15 @@ Ptr<RFFeatureGetter> createRFFeatureGetter()
return
makePtr
<
RFFeatureGetterImpl
>
();
}
};
}
}
/********************* StructuredEdgeDetection class *********************/
namespace
cv
{
namespace
ximgproc
{
class
StructuredEdgeDetectionImpl
:
public
StructuredEdgeDetection
{
...
...
@@ -692,3 +689,4 @@ Ptr<StructuredEdgeDetection> createStructuredEdgeDetection(const String &model,
}
}
}
modules/ximgproc/test/test_structured_edge_detection.cpp
View file @
e06ef978
...
...
@@ -10,8 +10,8 @@ TEST(ximpgroc_StructuredEdgeDetection, regression)
float
threshold
=
0.01
f
;
cv
::
String
modelName
=
dir
+
"model.yml.gz"
;
cv
::
Ptr
<
cv
::
StructuredEdgeDetection
>
pDollar
=
cv
::
createStructuredEdgeDetection
(
modelName
);
cv
::
Ptr
<
cv
::
ximgproc
::
StructuredEdgeDetection
>
pDollar
=
cv
::
ximgproc
::
createStructuredEdgeDetection
(
modelName
);
for
(
int
i
=
0
;
i
<
nTests
;
++
i
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment