IplImage * ImageToIplImage(QPixmap * qPix){
int width = (qPix->toImage()).width();
int height =(qPix->toImage()).height();
// Creates a iplImage with 3 channels
IplImage *img = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 3);
for(int y=0;y<height;y++)
{
for(int x=0;x<width;x++ )
{
QRgb color = qPix->toImage().pixel(x,y);
cvSet2D(img,y,x,cvScalar(qBlue(color),qGreen(color),qRed(color),1));
}
}
return img; }
это сработало !!благодаря Фатеху Бенмерзоугу