Infrared images can be acquired with a resolution of 512 x 424 as well as Depth images.
The obtained infrared image is represented by UINT16 for each pixel.
type of return value | function name | descriptions |
---|---|---|
void | setInfrared() | Set infrared image to the member variable "infraredImage" |
type | variable name | descriptions |
---|---|---|
cv::Mat | infraredImage | Infrared image. Resolution is 512 x 4s4, and each pixel is represented by UINT16. The coordinates of the image are the positions in the DepthSpace coordinate system.
UINT16 infrared = rgbImage.at<UINT16>(y , x ); |
Call kinect.setInfrared() function to set the infrared image to kinect.infraredImage.
main.cpp |
#include <iostream> #include <sstream> #include "NtKinect.h" using namespace std; void doJob() { NtKinect kinect; while (1) { kinect.setInfrared(); cv::imshow("infrared", kinect.infraredImage); auto key = cv::waitKey(1); if (key == 'q') break; } cv::destroyAllWindows(); } int main(int argc, char** argv) { try { doJob(); } catch (exception &ex) { cout << ex.what() << endl; string s; cin >> s; } return 0; } |
Since the above zip file may not include the latest "NtKinect.h", Download the latest version from here and replace old one with it.