imgData = cvLoadImage( s, -1 );
cvSaveImage("cvImage.png",imgData );
img.create( imgData->width, imgData->height, 8, 255 );
unsigned char *buff = img.bits();
memcpy(buff,(uchar*)imgData->imageData,
imgData->widthStep*imgData->height);
for ( int i=0; i<255; i++ ) // build color table
img.setColor( i, qRgb(i,0,0) );
img.save( "qtimage", "PNG", 0 );
pixmap.convertFromImage(img);
m_pixmap->setPixmap(pixmap);
imgData = cvLoadImage( s, -1 );
cvSaveImage("cvImage.png",imgData );
QImage img;
img.create( imgData->width, imgData->height, 8, 255 );
unsigned char *buff = img.bits();
memcpy(buff,(uchar*)imgData->imageData,
imgData->widthStep*imgData->height);
for ( int i=0; i<255; i++ ) // build color table
img.setColor( i, qRgb(i,0,0) );
img.save( "qtimage", "PNG", 0 );
QPixmap pixmap;
pixmap.convertFromImage(img);
m_pixmap->setPixmap(pixmap);
To copy to clipboard, switch view to plain text mode
but result is somehow far from what I expect
Bookmarks