本文共 958 字,大约阅读时间需要 3 分钟。
@Date 2018.09.27
// pointer存储关键点矩阵信息Point2f pointerX = new Point2f();Point2f pointerY = new Point2f();// 转换pointer到matMat matSrcA = new Mat(3, 2, CV_32FC1, pointerX);Mat matSrcB = new Mat(3, 2, CV_32FC1, pointerY);// Javacv中返回值需要提前开辟传入Point2f cv = new Point2f();Mat cvEstimateOut = new Mat(2, 3, CV_32FC1, cv);// 关键点矩阵转换cvEstimateRigidTransform(new CvMat(matSrcA), new CvMat(matSrcB), new CvMat(cvEstimateOut), 0);// JavaCV函数 : 根据前后关键点矩阵, 进行指定图片大小的变换Mat result = new Mat(80, 80, CV_8UC3);warpAffine(matImage, result, cvEstimateOut, new Size(80, 80));
转载地址:http://fphna.baihongyu.com/