Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

accessing element in a homography matrix

Hi all, I have a 3x3 homography matrix , which I computed using findHomography() function. I store it in a cv::Mat matrix.

I am trying to do element access using the following code

float cvHomography::accessElements(const cv::Mat& aCvMat) { //cout << aCvMat << endl;

const float* Mi;
for( int i = 0; i < aCvMat.rows; i++){
    Mi = aCvMat.ptr<float>(i);
    for( int j = 0; j < aCvMat.cols; j++){
        cout << Mi.at<float>(j); << endl;
    }
}

}

the above does not compile giving me the error:

error: request for member ‘at’ in ‘Mi’, which is of non-class type ‘const float*’

I have searched through documentation , tutorials and google and I honestly cannot see what I am doing wrong..

accessing element in a homography matrix

Hi all, I have a 3x3 homography matrix , which I computed using findHomography() function. I store it in a cv::Mat matrix.

I am trying to do element access using the following code

float cvHomography::accessElements(const cv::Mat& aCvMat) { //cout << aCvMat << endl;

const float* Mi;
for( int i = 0; i < aCvMat.rows; i++){
    Mi = aCvMat.ptr<float>(i);
    for( int j = 0; j < aCvMat.cols; j++){
        cout << Mi.at<float>(j); Mi[j] << endl;
    }
}

}

the The above does not compile giving me return the error:

error: request for member ‘at’ in ‘Mi’, which is of non-class type ‘const float*’

correct value from the homography matrix. I have searched through documentation , tutorials and google and I honestly cannot see what I am doing wrong..wrong.