Thanks, Can you please tell me briefly how to save the raw frame images to hard disk without image processing? [/quote]
You can use GetFrameImage() to get a buffer with the raw image data, then you can write that into a file.
For example, here is some code we used to save one frame to a PGM file. It expects pFrame to be a valid camera frame.
Code: Select all
#define IMAGE_WIDTH 640
#define IMAGE_HEIGHT 480
#define BITS_PER_PIXEL 8
#define BUFFER_FRAME_SIZE IMAGE_WIDTH * IMAGE_HEIGHT * (BITS_PER_PIXEL / 8)
#define PGM_HEADER_SIZE 15
unsigned char bufFrameCurrent[BUFFER_FRAME_SIZE];
unsigned char PGMheader[PGM_HEADER_SIZE] = {'P','5',' ', '6','4','0',' ', '4','8','0',' ', '2','5','5',' '};
pCamera->GetFrameImage(pFrame, IMAGE_WIDTH, IMAGE_HEIGHT,IMAGE_WIDTH, BITS_PER_PIXEL, (byte *) bufFrameCurrent);
CString str_FileName;
str_FileName.Format(TEXT("OptiTrack.pgm"));
CFile tImageFile(str_FileName, CFile::modeCreate | CFile::modeWrite);
tImageFile.Write(PGMheader, PGM_HEADER_SIZE);
tImageFile.Write(bufFrameCurrent, BUFFER_FRAME_SIZE);
tImageFile.Close();
Thanks, but your code uses MFC, which is incompatible with windows.h, which I have included in another .h file which is included in current .cpp file