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
8b733e09
Commit
8b733e09
authored
Jul 31, 2017
by
LaurentBerger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review
parent
c17fd6e9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
30 deletions
+26
-30
ximgproc.hpp
modules/ximgproc/include/opencv2/ximgproc.hpp
+1
-1
fourier_descriptors.hpp
...ximgproc/include/opencv2/ximgproc/fourier_descriptors.hpp
+22
-22
fourier_descriptors_demo.cpp
modules/ximgproc/samples/fourier_descriptors_demo.cpp
+2
-6
fourier_descriptors.cpp
modules/ximgproc/src/fourier_descriptors.cpp
+1
-1
No files found.
modules/ximgproc/include/opencv2/ximgproc.hpp
View file @
8b733e09
...
...
@@ -70,7 +70,7 @@ i.e. algorithms which somehow takes into account pixel affinities in natural ima
@defgroup ximgproc_fast_line_detector Fast line detector
@defgroup ximgproc_
shape
Fourier descriptors
@defgroup ximgproc_
fourier
Fourier descriptors
@}
*/
...
...
modules/ximgproc/include/opencv2/ximgproc/fourier_descriptors.hpp
View file @
8b733e09
...
...
@@ -8,9 +8,9 @@
#include <opencv2/core.hpp>
namespace
cv
{
namespace
ximgproc
{
namespace
ximgproc
{
//! @addtogroup ximgproc_shape
//! @addtogroup ximgproc_fourier
//! @{
/** @brief Class for ContourFitting algorithms.
...
...
@@ -40,20 +40,20 @@ namespace cv {
@param src Contour defining first shape.
@param dst Contour defining second shape (Target).
@param _alphaPhiST : \f$ \alpha \f$=_alphaPhiST(0,0), \f$ \phi \f$=_alphaPhiST(0,1) (in radian), s=_alphaPhiST(0,2), Tx=_alphaPhiST(0,3), Ty=_
alphaPhiST(0,4) rotation center
@param alphaPhiST : \f$ \alpha \f$=alphaPhiST(0,0), \f$ \phi \f$=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=
alphaPhiST(0,4) rotation center
@param dist distance between src and dst after matching.
@param fdContour false then src and dst are contours and true src and dst are fourier descriptors.
*/
CV_WRAP
void
estimateTransformation
(
InputArray
src
,
InputArray
dst
,
OutputArray
_
alphaPhiST
,
double
*
dist
=
0
,
bool
fdContour
=
false
);
CV_WRAP
void
estimateTransformation
(
InputArray
src
,
InputArray
dst
,
OutputArray
alphaPhiST
,
double
*
dist
=
0
,
bool
fdContour
=
false
);
/** @brief Fit two closed curves using fourier descriptors. More details in @cite PersoonFu1977 and @cite BergerRaghunathan1998
@param src Contour defining first shape.
@param dst Contour defining second shape (Target).
@param _alphaPhiST : \f$ \alpha \f$=_alphaPhiST(0,0), \f$ \phi \f$=_alphaPhiST(0,1) (in radian), s=_alphaPhiST(0,2), Tx=_alphaPhiST(0,3), Ty=_
alphaPhiST(0,4) rotation center
@param alphaPhiST : \f$ \alpha \f$=alphaPhiST(0,0), \f$ \phi \f$=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=
alphaPhiST(0,4) rotation center
@param dist distance between src and dst after matching.
@param fdContour false then src and dst are contours and true src and dst are fourier descriptors.
*/
CV_WRAP
void
estimateTransformation
(
InputArray
src
,
InputArray
dst
,
OutputArray
_
alphaPhiST
,
double
&
dist
,
bool
fdContour
=
false
);
CV_WRAP
void
estimateTransformation
(
InputArray
src
,
InputArray
dst
,
OutputArray
alphaPhiST
,
double
&
dist
,
bool
fdContour
=
false
);
/** @brief set number of Fourier descriptors used in estimateTransformation
@param n number of Fourier descriptors equal to number of contour points after resampling.
...
...
@@ -78,32 +78,32 @@ namespace cv {
*
* For more details about this implementation, please see @cite PersoonFu1977
*
* @param _
src contour type vector<Point> , vector<Point2f> or vector<Point2d>
* @param _
dst Mat of type CV_64FC2 and nbElt rows A VERIFIER
* @param nbElt number of rows in _
dst or getOptimalDFTSize rows if nbElt=-1
* @param nbFD number of FD return in _dst _
dst = [FD(1...nbFD/2) FD(nbFD/2-nbElt+1...:nbElt)]
* @param
src contour type vector<Point> , vector<Point2f> or vector<Point2d>
* @param
dst Mat of type CV_64FC2 and nbElt rows A VERIFIER
* @param nbElt number of rows in
dst or getOptimalDFTSize rows if nbElt=-1
* @param nbFD number of FD return in dst
dst = [FD(1...nbFD/2) FD(nbFD/2-nbElt+1...:nbElt)]
*
*/
CV_EXPORTS_W
void
fourierDescriptor
(
InputArray
_src
,
OutputArray
_
dst
,
int
nbElt
=-
1
,
int
nbFD
=-
1
);
CV_EXPORTS_W
void
fourierDescriptor
(
InputArray
src
,
OutputArray
dst
,
int
nbElt
=-
1
,
int
nbFD
=-
1
);
/**
* @brief transform a contour
*
* @param _
src contour or Fourier Descriptors if fd is true
* @param _
t transform Mat given by estimateTransformation
* @param _
dst Mat of type CV_64FC2 and nbElt rows
* @param fdContour true _src are Fourier Descriptors. fdContour false _
src is a contour
* @param
src contour or Fourier Descriptors if fd is true
* @param
t transform Mat given by estimateTransformation
* @param
dst Mat of type CV_64FC2 and nbElt rows
* @param fdContour true src are Fourier Descriptors. fdContour false
src is a contour
*
*/
CV_EXPORTS_W
void
transform
(
InputArray
_src
,
InputArray
_t
,
OutputArray
_
dst
,
bool
fdContour
=
true
);
CV_EXPORTS_W
void
transform
(
InputArray
src
,
InputArray
t
,
OutputArray
dst
,
bool
fdContour
=
true
);
/**
* @brief Contour sampling .
*
* @param _
src contour type vector<Point> , vector<Point2f> or vector<Point2d>
* @param _
out Mat of type CV_64FC2 and nbElt rows
* @param nbElt number of points in _
out contour
* @param
src contour type vector<Point> , vector<Point2f> or vector<Point2d>
* @param
out Mat of type CV_64FC2 and nbElt rows
* @param nbElt number of points in
out contour
*
*/
CV_EXPORTS_W
void
contourSampling
(
InputArray
_src
,
OutputArray
_
out
,
int
nbElt
);
CV_EXPORTS_W
void
contourSampling
(
InputArray
src
,
OutputArray
out
,
int
nbElt
);
/**
* @brief create
...
...
@@ -113,7 +113,7 @@ namespace cv {
*/
CV_EXPORTS_W
Ptr
<
ContourFitting
>
create
(
int
ctr
=
1024
,
int
fd
=
16
);
//! @} ximgproc_shape
}
//! @} ximgproc_fourier
}
}
#endif
modules/ximgproc/samples/fourier_descriptors_demo.cpp
View file @
8b733e09
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#include <opencv2/core.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/highgui.hpp>
...
...
@@ -58,10 +54,10 @@ int main(void)
double
dist
;
vector
<
vector
<
Point
>
>
c
;
Mat
img
;
cout
<<
"******************** PRESS
G
TO MATCH CURVES *************
\n
"
;
cout
<<
"******************** PRESS
g
TO MATCH CURVES *************
\n
"
;
do
{
code
=
waitKey
(
30
)
&
0xFF
;
code
=
waitKey
(
30
);
if
(
p
.
update
)
{
Mat
r
=
getRotationMatrix2D
(
Point
(
p
.
xg
,
p
.
yg
),
p
.
angle
,
10.0
/
p
.
scale10
);
...
...
modules/ximgproc/src/fourier_descriptors.cpp
View file @
8b733e09
...
...
@@ -13,7 +13,7 @@ Coalescence in 2 dimensions: experiments on thin copolymer films and numerical s
*/
namespace
cv
{
namespace
ximgproc
{
namespace
ximgproc
{
void
ContourFitting
::
setCtrSize
(
int
n
)
...
...
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