Function mindspore::dataset::GetAffineTransform

Function Documentation

bool mindspore::dataset::GetAffineTransform(std::vector<Point> src_point, std::vector<Point> dst_point, LiteMat &M)

Affine transformation.

Parameters
  • src_point[in] Input coordinate point.

  • dst_point[in] Output coordinate point.

  • M[in] Output matrix.

Returns

Return true if transform successfully.

样例
/* Get Affine matrix */
std::vector<Point> src = {Point(50, 50), Point(200, 50), Point(50, 200)};
std::vector<Point> dst = {Point(40, 40), Point(100, 40), Point(50, 90)};
LiteMat M;
GetAffineTransform(src, dst, M);
std::cout << M.width_ << " " << M.height_ << " " << M.channel_ << std::endl;