简体   繁体   中英

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.

只需将代码更改为

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM