Commit 8b733e09 authored by LaurentBerger's avatar LaurentBerger

review

parent c17fd6e9
...@@ -70,7 +70,7 @@ i.e. algorithms which somehow takes into account pixel affinities in natural ima ...@@ -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_fast_line_detector Fast line detector
@defgroup ximgproc_shape Fourier descriptors @defgroup ximgproc_fourier Fourier descriptors
@} @}
*/ */
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
namespace cv { namespace cv {
namespace ximgproc { namespace ximgproc {
//! @addtogroup ximgproc_shape //! @addtogroup ximgproc_fourier
//! @{ //! @{
/** @brief Class for ContourFitting algorithms. /** @brief Class for ContourFitting algorithms.
...@@ -40,20 +40,20 @@ namespace cv { ...@@ -40,20 +40,20 @@ namespace cv {
@param src Contour defining first shape. @param src Contour defining first shape.
@param dst Contour defining second shape (Target). @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 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. @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 /** @brief Fit two closed curves using fourier descriptors. More details in @cite PersoonFu1977 and @cite BergerRaghunathan1998
@param src Contour defining first shape. @param src Contour defining first shape.
@param dst Contour defining second shape (Target). @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 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. @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 /** @brief set number of Fourier descriptors used in estimateTransformation
@param n number of Fourier descriptors equal to number of contour points after resampling. @param n number of Fourier descriptors equal to number of contour points after resampling.
...@@ -78,32 +78,32 @@ namespace cv { ...@@ -78,32 +78,32 @@ namespace cv {
* *
* For more details about this implementation, please see @cite PersoonFu1977 * For more details about this implementation, please see @cite PersoonFu1977
* *
* @param _src contour type vector<Point> , vector<Point2f> or vector<Point2d> * @param src contour type vector<Point> , vector<Point2f> or vector<Point2d>
* @param _dst Mat of type CV_64FC2 and nbElt rows A VERIFIER * @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 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 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 * @brief transform a contour
* *
* @param _src contour or Fourier Descriptors if fd is true * @param src contour or Fourier Descriptors if fd is true
* @param _t transform Mat given by estimateTransformation * @param t transform Mat given by estimateTransformation
* @param _dst Mat of type CV_64FC2 and nbElt rows * @param dst Mat of type CV_64FC2 and nbElt rows
* @param fdContour true _src are Fourier Descriptors. fdContour false _src is a contour * @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 . * @brief Contour sampling .
* *
* @param _src contour type vector<Point> , vector<Point2f> or vector<Point2d> * @param src contour type vector<Point> , vector<Point2f> or vector<Point2d>
* @param _out Mat of type CV_64FC2 and nbElt rows * @param out Mat of type CV_64FC2 and nbElt rows
* @param nbElt number of points in _out contour * @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 * @brief create
...@@ -113,7 +113,7 @@ namespace cv { ...@@ -113,7 +113,7 @@ namespace cv {
*/ */
CV_EXPORTS_W Ptr<ContourFitting> create(int ctr = 1024, int fd = 16); CV_EXPORTS_W Ptr<ContourFitting> create(int ctr = 1024, int fd = 16);
//! @} ximgproc_shape //! @} ximgproc_fourier
} }
} }
#endif #endif
// 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.hpp>
#include <opencv2/core/utility.hpp> #include <opencv2/core/utility.hpp>
#include <opencv2/highgui.hpp> #include <opencv2/highgui.hpp>
...@@ -58,10 +54,10 @@ int main(void) ...@@ -58,10 +54,10 @@ int main(void)
double dist; double dist;
vector<vector<Point> > c; vector<vector<Point> > c;
Mat img; Mat img;
cout << "******************** PRESS G TO MATCH CURVES *************\n"; cout << "******************** PRESS g TO MATCH CURVES *************\n";
do do
{ {
code = waitKey(30)&0xFF; code = waitKey(30);
if (p.update) if (p.update)
{ {
Mat r = getRotationMatrix2D(Point(p.xg, p.yg), p.angle, 10.0/ p.scale10); Mat r = getRotationMatrix2D(Point(p.xg, p.yg), p.angle, 10.0/ p.scale10);
......
...@@ -13,7 +13,7 @@ Coalescence in 2 dimensions: experiments on thin copolymer films and numerical s ...@@ -13,7 +13,7 @@ Coalescence in 2 dimensions: experiments on thin copolymer films and numerical s
*/ */
namespace cv { namespace cv {
namespace ximgproc { namespace ximgproc {
void ContourFitting::setCtrSize(int n) void ContourFitting::setCtrSize(int n)
......
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