我将 IplImage 转换为 SDL_Surface
引用此link
SDL_Surface *single_channel_ipl_to_surface (IplImage *opencvimg)
{
SDL_Surface *surface = SDL_CreateRGBSurfaceFrom((void*)opencvimg->imageData,
opencvimg->width,
opencvimg->height,
opencvimg->depth*opencvimg->nChannels,
opencvimg->widthStep,
1, 1, 1 ,0);
return surface;
}
如何将 SDL_Surface 转换为 IplImage
答案 0 :(得分:0)
您需要从SDL_Surface检索4条信息,因此请调查API以了解如何检索:
之后,您可create an IplImage from scratch cvCreateImageHeader()
后跟cvSetData()
。