Fix weigths->weights
This commit is contained in:
parent
b736a3554e
commit
3ab6a92c6e
1 changed files with 5 additions and 5 deletions
|
@ -689,7 +689,7 @@ void TInbetween::Imp::computeTransformation() {
|
||||||
std::vector<TPointD> samplingPoint1(samplingPointNumber),
|
std::vector<TPointD> samplingPoint1(samplingPointNumber),
|
||||||
samplingPoint2(samplingPointNumber);
|
samplingPoint2(samplingPointNumber);
|
||||||
TStroke *stroke1, *stroke2;
|
TStroke *stroke1, *stroke2;
|
||||||
std::vector<double> ratioSampling, weigths, subStrokeXScaling,
|
std::vector<double> ratioSampling, weights, subStrokeXScaling,
|
||||||
subStrokeYScaling;
|
subStrokeYScaling;
|
||||||
|
|
||||||
UINT strokeCount1 = m_firstImage->getStrokeCount();
|
UINT strokeCount1 = m_firstImage->getStrokeCount();
|
||||||
|
@ -1011,8 +1011,8 @@ debugStream <<"num angoli 2: "<< angles2.size() << endl;
|
||||||
|
|
||||||
ratioSampling.clear();
|
ratioSampling.clear();
|
||||||
ratioSampling.reserve(samplingPointNumber);
|
ratioSampling.reserve(samplingPointNumber);
|
||||||
weigths.clear();
|
weights.clear();
|
||||||
weigths.reserve(samplingPointNumber);
|
weights.reserve(samplingPointNumber);
|
||||||
|
|
||||||
TPointD pOld, pNew;
|
TPointD pOld, pNew;
|
||||||
// double totalW=0;
|
// double totalW=0;
|
||||||
|
@ -1024,7 +1024,7 @@ debugStream <<"num angoli 2: "<< angles2.size() << endl;
|
||||||
if (pNew == stroke2Centroid) continue;
|
if (pNew == stroke2Centroid) continue;
|
||||||
versor1 = normalize(pOld - stroke1Centroid);
|
versor1 = normalize(pOld - stroke1Centroid);
|
||||||
versor2 = normalize(pNew - stroke2Centroid);
|
versor2 = normalize(pNew - stroke2Centroid);
|
||||||
weigths.push_back(tdistance(pOld, stroke1Centroid) +
|
weights.push_back(tdistance(pOld, stroke1Centroid) +
|
||||||
tdistance(pNew, stroke2Centroid));
|
tdistance(pNew, stroke2Centroid));
|
||||||
cs = versor1 * versor2;
|
cs = versor1 * versor2;
|
||||||
sn = cross(versor1, versor2);
|
sn = cross(versor1, versor2);
|
||||||
|
@ -1036,7 +1036,7 @@ debugStream <<"num angoli 2: "<< angles2.size() << endl;
|
||||||
subStroke1 = 0;
|
subStroke1 = 0;
|
||||||
subStroke2 = 0;
|
subStroke2 = 0;
|
||||||
|
|
||||||
double radRotation = weightedAverage(ratioSampling, weigths);
|
double radRotation = weightedAverage(ratioSampling, weights);
|
||||||
|
|
||||||
totalRadRotation += radRotation;
|
totalRadRotation += radRotation;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue