|
|
|
@ -24,9 +24,9 @@ private: |
|
|
|
|
{ |
|
|
|
|
for(int i = 0; i < N; i++) |
|
|
|
|
{ |
|
|
|
|
p.at<double>(0,i) = opoints.at<OpointType>(0,i).x; |
|
|
|
|
p.at<double>(1,i) = opoints.at<OpointType>(0,i).y; |
|
|
|
|
p.at<double>(2,i) = opoints.at<OpointType>(0,i).z; |
|
|
|
|
p.at<double>(0,i) = opoints.at<OpointType>(i).x; |
|
|
|
|
p.at<double>(1,i) = opoints.at<OpointType>(i).y; |
|
|
|
|
p.at<double>(2,i) = opoints.at<OpointType>(i).z; |
|
|
|
|
|
|
|
|
|
// compute mean of object points
|
|
|
|
|
mn.at<double>(0) += p.at<double>(0,i); |
|
|
|
@ -34,12 +34,12 @@ private: |
|
|
|
|
mn.at<double>(2) += p.at<double>(2,i); |
|
|
|
|
|
|
|
|
|
// make z into unit vectors from normalized pixel coords
|
|
|
|
|
double sr = std::pow(ipoints.at<IpointType>(0,i).x, 2) + |
|
|
|
|
std::pow(ipoints.at<IpointType>(0,i).y, 2) + (double)1; |
|
|
|
|
double sr = std::pow(ipoints.at<IpointType>(i).x, 2) + |
|
|
|
|
std::pow(ipoints.at<IpointType>(i).y, 2) + (double)1; |
|
|
|
|
sr = std::sqrt(sr); |
|
|
|
|
|
|
|
|
|
z.at<double>(0,i) = ipoints.at<IpointType>(0,i).x / sr; |
|
|
|
|
z.at<double>(1,i) = ipoints.at<IpointType>(0,i).y / sr; |
|
|
|
|
z.at<double>(0,i) = ipoints.at<IpointType>(i).x / sr; |
|
|
|
|
z.at<double>(1,i) = ipoints.at<IpointType>(i).y / sr; |
|
|
|
|
z.at<double>(2,i) = (double)1 / sr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|