Hi I want to show an IPL image created but with imshow I am having problems, I was searching how to solve that error but I didn't find anything.... so if someone could help me I would be very please. I am in a raspberry pi, using opencv 3.0.0 I know is better use Mat know but I didnt know hot to convert an Image captured by other API to a Mat object and not and IPL
#include <uEye.h>
#include <ueye_deprecated.h>
#include <wchar.h>
#include <locale.h>
#include <stdlib.h>
#include <stdio.h>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
rest of code
if(is_FreezeVideo(hCam, IS_WAIT) == IS_SUCCESS){
void *pMemVoid; //pointer to where the image is stored
is_GetImageMem (hCam, &pMemVoid);
IplImage * img;
img=cvCreateImage(cvSize(img_width, img_height), IPL_DEPTH_8U, 3);
img->nSize=112;
img->ID=0;
img->nChannels=3;
img->alphaChannel=0;
img->depth=8;
img->dataOrder=0;
img->origin=0;
img->align=4;
img->width=img_width;
img->height=img_height;
img->roi=NULL;
img->maskROI=NULL;
img->imageId=NULL;
img->tileInfo=NULL;
img->imageSize=3*img_width*img_height;
img->imageData=(char*)pMemVoid; //the pointer to imagaData
img->widthStep=3*img_width;
img->imageDataOrigin=(char*)pMemVoid; //and again
//now you can use your img just like a normal OpenCV image
namedWindow( "A", 1 );
cv::imshow("A",img);
waitKey(0);
}
rest of code
}