-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问代码里的initial_guess和getsimilarTransform是什么意思?谢谢 #3
Comments
initial_guess是我们最开始认为的人脸关键点的位置,一般就是mean shape做最初始的guess,然后一步一步去调整各个点的位置,往关键点真正的坐标位置移动(这个词不是那么贴切),guess多一点就是增加模型的鲁棒性 getsimilarTransform, 就是我有两个shape A, shape B, 如果我从A变换到B到怎么做,这个函数就是算从A变换到B要转过多少的角度,然后缩小放大的倍数(这两步反一下也没问题) |
getsimilarTransform我有英语注释: |
那么在程序中getsimilarTransform函数具体有啥作用呢,是否可以直接回归delta S 而不用先Transform再Transform回来呢? |
这里2.1节讲了原因,face-alignment-at-3000fps是在这篇的基础上做的,框架一模一样 |
@freesouls 麻烦能不能具体分析一下getSimilarityTransform 是如何进行坐标变换的,特别是下面这段代码,取自于utils.cpp的74行到92行。calcCovarMatrix输出的协方差矩阵covariance1维度是(2, 2), 而均值矩阵mean1 却是一个(68, 1)的矩阵,如果说协方差矩阵是(2, 2)的,这证明这个协方差输出的是人脸坐标点的X坐标和Y坐标的相关性,但是均值却是每个坐标点的X和Y的均值,这点实在有点想不明白。谢谢你啦。 cv::calcCovarMatrix(temp1, covariance1, mean1, cv::COVAR_COLS, CV_64F); //CV_COVAR_COLS
cv::calcCovarMatrix(temp2, covariance2, mean2, cv::COVAR_COLS, CV_64F);
double s1 = sqrt(norm(covariance1));
double s2 = sqrt(norm(covariance2));
scale = s1 / s2;
temp1 = 1.0 / s1 * temp1;
temp2 = 1.0 / s2 * temp2;
double num = 0.0;
double den = 0.0;
for (int i = 0; i < shape_to.rows; i++){
num = num + temp1(i, 1) * temp2(i, 0) - temp1(i, 0) * temp2(i, 1);
den = den + temp1(i, 0) * temp2(i, 0) + temp1(i, 1) * temp2(i, 1);
}
double norm = sqrt(num*num + den*den);
double sin_theta = num / norm;
double cos_theta = den / norm; |
@gmlyytt-YANG ,请问你找到理论依据了吗? |
如题,谢谢,没有太懂。
The text was updated successfully, but these errors were encountered: