Currently I am using the Image API to grab raw images. Although the size of the raw images turns out to be 640x240.
This doesn't seem to be the maximum attainable image size. How do I obtain full size images using the Image API.
This is the code that I am currently using:
const Leap::Frame frame = controller.frame();
// Frame frame = controller.frame();
Leap::ImageList images = frame.images();
for(int i = 0; i < 2; ++i) {
Leap::Image image = images[i];
int w = image.width();
int h = image.height();
if(w > 0 && h > 0) {
Mat img(h, w, cv::DataType<unsigned char>::type);
const unsigned char* image_buffer = image.data();
int buffer_size = w * h * image.bytesPerPixel();
for(int j = 0; j < buffer_size; ++j) {
RGB& rgb = img.ptr<RGB>(j / w)[j % w];
// set RGB colors
rgb.red = image_buffer[j];
rgb.green = image_buffer[j];
rgb.blue = image_buffer[j];
}
// create window for image
namedWindow("Grayscale image", CV_WINDOW_AUTOSIZE);
// display image
imshow("Grayscale Image", img);
waitKey(0);
}
}
Is there some configuration that I need to change in ~/.Leap Motion/config.json
.
I am a Linux developer.