Re: [libdc1394-devel] detecting torn images
Capture and control API for IIDC compliant cameras
Brought to you by:
ddouxchamps,
gordp
From: David M. <dcm@MIT.EDU> - 2007-05-24 20:55:08
|
On Tue, 2007-05-22 at 23:14 +0200, Andy Gotz wrote: > > For the packet size I use USE_MAX_AVAIL. We do not use colour because > all our cameras are monchrome so far. I have attached a split image. I > do not know if it zoomed the way you want it. After setting up the capture, could you run dc1394_get_byte_per_packet() and tell me the exact number of bytes per packet? Also, instead of a Matlab screenshot, could you save the actual original pixels captured in a file, and then send me the result? Here is some code to write out a ppm from the raw capture: int pgm_write (FILE *fp, const uint8_t *pixels, int width, int height, int rowstride) { fprintf(fp, "P5\n%d\n%d\n%d\n", width, height, 255); int i, count; for (i=0; i<height; i++){ count = fwrite(pixels + i*rowstride, width, 1, fp); if (1 != count) return -1; } return 0; } > Stays stuck for all successive frames until I stop and start the iso > transmission again. Interesting. There are two ways it could get stuck: Either the camera itself is buggy and is generating bad frames, or the OHCI receive is getting borked. I have a possible theory about how OHCI might get borked, but I'll need the capture and exact packet size to decide if that's correct. Thanks, David |