| OpenCV 3.4.8 Open Source Computer Vision

Classes | Functions
Fourier descriptors
Extended Image Processing

## Classes
class | cv::ximgproc::ContourFitting
| Class for ContourFitting algorithms. ContourFitting match two contours \( z_a \) and \( z_b \) minimizing distance

\[ d(z_a,z_b)=\sum (a_n - s b_n e^{j(n \alpha +\phi )})^2 \]

where \( a_n \) and \( b_n \) are Fourier descriptors of \( z_a \) and \( z_b \) and s is a scaling factor and \( \phi \) is angle rotation and \( \alpha \) is starting point factor adjustement. More...

## Functions
void | cv::ximgproc::contourSampling (InputArray src, OutputArray out, int nbElt)
| Contour sampling . More...
Ptr< ContourFitting > | cv::ximgproc::createContourFitting (int ctr=1024, int fd=16)
| create ContourFitting algorithm object More...
void | cv::ximgproc::fourierDescriptor (InputArray src, OutputArray dst, int nbElt=-1, int nbFD=-1)
| Fourier descriptors for planed closed curves. More...
void | cv::ximgproc::transformFD (InputArray src, InputArray t, OutputArray dst, bool fdContour=true)
| transform a contour More...

## Detailed Description

## Function Documentation

## § contourSampling()

void cv::ximgproc::contourSampling | ( | InputArray | src,
|  | OutputArray | out,
|  | int | nbElt
| ) |  |

Python:
| out | = | cv.ximgproc.contourSampling( | src, nbElt[, out] | )

`#include <opencv2/ximgproc/fourier_descriptors.hpp>`

Contour sampling .

Parameters

  src | contour type vector<Point> , vector<Point2f> or vector<Point2d>
  out | Mat of type CV_64FC2 and nbElt rows
  nbElt | number of points in out contour

## § createContourFitting()

Ptr<ContourFitting> cv::ximgproc::createContourFitting | ( | int | ctr = `1024`,
|  | int | fd = `16`
| ) |  |

Python:
| retval | = | cv.ximgproc.createContourFitting( | [, ctr[, fd]] | )

`#include <opencv2/ximgproc/fourier_descriptors.hpp>`

create ContourFitting algorithm object

Parameters

  ctr | number of Fourier descriptors equal to number of contour points after resampling.
  fd | Contour defining second shape (Target).

## § fourierDescriptor()

void cv::ximgproc::fourierDescriptor | ( | InputArray | src,
|  | OutputArray | dst,
|  | int | nbElt = `-1`,
|  | int | nbFD = `-1`
| ) |  |

Python:
| dst | = | cv.ximgproc.fourierDescriptor( | src[, dst[, nbElt[, nbFD]]] | )

`#include <opencv2/ximgproc/fourier_descriptors.hpp>`

Fourier descriptors for planed closed curves.

For more details about this implementation, please see [167]

Parameters

  src | contour type vector<Point> , vector<Point2f> or vector<Point2d>
  dst | Mat of type CV_64FC2 and nbElt rows A VERIFIER
  nbElt | number of rows in dst or getOptimalDFTSize rows if nbElt=-1
  nbFD | number of FD return in dst dst = [FD(1...nbFD/2) FD(nbFD/2-nbElt+1...:nbElt)]

## § transformFD()

void cv::ximgproc::transformFD | ( | InputArray | src,
|  | InputArray | t,
|  | OutputArray | dst,
|  | bool | fdContour = `true`
| ) |  |

Python:
| dst | = | cv.ximgproc.transformFD( | src, t[, dst[, fdContour]] | )

`#include <opencv2/ximgproc/fourier_descriptors.hpp>`

transform a contour

Parameters

  src | contour or Fourier Descriptors if fd is true
  t | transform Mat given by estimateTransformation
  dst | Mat of type CV_64FC2 and nbElt rows
  fdContour | true src are Fourier Descriptors. fdContour false src is a contour