I am using opencv in C++ to get images from a webcam, and want to store them in a binary file. After that I want to be able to pull the data from that file into a new struct.
This is the struct if it makes any difference:
Code:
typedef struct _IplImage
{
int nSize;
int ID;
int nChannels;
int alphaChannel;
int depth;
char colorModel[4];
char channelSeq[4];
int dataOrder;
int origin;
int align;
int width;
int height;
struct _IplROI *roi;
struct _IplImage *maskROI;
void *imageId;
struct _IplTileInfo *tileInfo;
int imageSize;
char *imageData;
int widthStep;
int BorderMode[4];
int BorderConst[4];
char *imageDataOrigin;
}
IplImage;
It's an opencv struct. I've tried several methods and modified code samples for reading and writing into binary files but can't get it to work. At one point I was getting just a black screen when I tried to show the image that contained the data from the binary file, so I am guessing I wasn't reading the data properly. Now I'm just getting a segfault, which I should be able to fix. When I just show the image that I'm getting from the camera, it works just fine. It's when I try to store it in a binary file and try to pull it out from there again that I get a black screen.
Any help would be great. Thank you in advance!