Hey Everyone, Fingers crossed someone can help! I am calibrating my kinect by means of taking an Infrared image and RGB image, I create objects for each videoinputs as so;
RGB = videoinput('kinect',1,'RGB_640x480');IR = videoinput('kinect',1,'Infrared_640x480');
And save them into a cell matrix (because eventually I will have numerous kinects connected)
RGB_cams{1,1}= RGB;RGB_cams{1,2}= IR;
I want to basically go through and take an RGB image then take an Infrared image seconds later so that the checkerboard is in the same position for each pair of images. I am using; (p.s. don't worry about 'l' and 'i' variables they are just numbering systems I am using)
% RGB image capture
image = getsnapshot(RGB_cams{1,1});filename = sprintf('Calib_RGB2Depth/%d_%d.jpg',l,i);imwrite(image,filename);RGB_images{i,l} = image;% Infrared Image capture
imageIR = getsnapshot(RGB_cams{l,2});filename = sprintf('Calib_RGB2Depth/%dIR_%d.tiff',l,i);imwrite(imageIR,filename);
This is looped N amount of times (N = 20 usually), sometimes it will take 16 pairs of images before an error sometimes it takes 4 pairs of images and errors, either way I have tried everything I could find i.e. pauses, clearing everything (including deleting saved videoinputs using delete(imaqfind)),using triggering instead of getsnapshot. However, I still get the error shown below;
Error using imaqdevice/getsnapshot (line 66)Could not connect to the image acquisition device. Device may be in use.
There is nuthing physically running when I get this error aka no previews, I delete all videoinputs and clear everything and sometimes it still persists.Please tell me someone has had this issue before? How can I just take one image in RGB then in Infrared format??? Any help would be amazing!! Thanks in advance
Best Answer