byteit101
25-02-2010, 17:22
last year, our robot saved the axis images to the onboard flash, we then got the images, processed them, and put them in a video. we used the imaqWriteJPEGfile and imaqWritePNGfile functions, and it worked fine. I tried the (almost exact) code in the 2010 Vision demo (modded for ball tracking, http://www.chiefdelphi.com/forums/showthread.php?t=81556#14), using WPILib 4.3, cRIO v20 and got nothing. I don't know if it is expected, but leaving fn to "" causes the file name to be truncated after 3 or 4 loops. the output is "i:0 B123t.jpg" (with code as is).char* fn="1234567890-qwertyusdfghjcvbn";
//char* fn="";
sprintf(fn,"B%dt.jpg\0",d);//d is a loop counter
// get the camera image
ColorImage *image = new ColorImage(IMAQ_IMAGE_RGB);
camera.GetImage(image);
printf("i:%i %s", imaqWriteJPEGFile(image->GetImaqImage(),fn,1000,NULL),fn);
///imaqWritePNGFile2(image->GetImaqImage(),fn,9,NULL,false);
Also, is there a way to stream and look at the imaq images like labview to help with debugging?
//char* fn="";
sprintf(fn,"B%dt.jpg\0",d);//d is a loop counter
// get the camera image
ColorImage *image = new ColorImage(IMAQ_IMAGE_RGB);
camera.GetImage(image);
printf("i:%i %s", imaqWriteJPEGFile(image->GetImaqImage(),fn,1000,NULL),fn);
///imaqWritePNGFile2(image->GetImaqImage(),fn,9,NULL,false);
Also, is there a way to stream and look at the imaq images like labview to help with debugging?