user3189436
user3189436

Reputation: 5

Accessing Individual elements of cv::Mat_16UC1

I have a cv::Mat object of type 16UC1 which is basically containing the depth values from a kinect device, I tried several methods like using

    cout << depthMat.at<uchar>(0,0) << endl;
    cout << depthMat.at<char>(0,0) << endl;
    cout << depthMat.at<double>(0,0) << endl;

etc. but all of them gives ambiguous results. Any idea how can i access these 16-bit values in eclipse c++/opencv in linux enviroment.

Upvotes: 0

Views: 162

Answers (1)

Haris
Haris

Reputation: 14043

Just change the code to

cout << depthMat.at<unsigned short>(0,0) << endl;

Upvotes: 2

Related Questions