Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

err is a matrix which contains the distance of a pair of pixel after applying a transformation to them. Using the notation of CvMat above, the median should be computed of all elements in err. Since the CvMat is marked as deprecated, I wanted to rewrite this part using CvMat's C++ counterpart cv::Mat. I did not really find an equivalent pointer based solution but I found one, that gave me same results using a cv::Mat variable.

err.at<float>(0, (_numberOfMatches / 2)) : (err.at<float>(0, (_numberOfMatches / 2) - 1) + err.at<float>(0, (_numberOfMatches / 2))*0.5;