Hello everybody,
I'm working on a video acquisition project with an EURESYS frame grabber (Picolo).
I develop on Qt Creator EDI (Qt 4.8.3 based) with MS VC++ 10 compiler and I use eVision 6.7.1 library.
There is no problems with board configuration and image acquisition.
With OpenCV library, I can convert EImage to Mat and show it in a secondary window:
void MainWindow::ProcessingCallback(Channel &Ch, SignalInfo &Info)
{
try
{
// Update the eVision image with the acquired image data
UpdateImageConfig(*Info.Surf, EImgSrc);
// Convert EImage to Mat
Mat cvImg(EImgSrc.GetHeight(), EImgSrc.GetWidth(), CV_8UC3, EImgSrc.GetGenericImagePtr());
// Display the new image
imshow( "Display window", cvImg );
}
catch (Euresys::MultiCam::Exception &e)
{
// Display the exceptions...
}
}
void MainWindow::ProcessingCallback(Channel &Ch, SignalInfo &Info)
{
try
{
// Update the eVision image with the acquired image data
UpdateImageConfig(*Info.Surf, EImgSrc);
// Convert EImage to Mat
Mat cvImg(EImgSrc.GetHeight(), EImgSrc.GetWidth(), CV_8UC3, EImgSrc.GetGenericImagePtr());
// Display the new image
imshow( "Display window", cvImg );
}
catch (Euresys::MultiCam::Exception &e)
{
// Display the exceptions...
}
}
To copy to clipboard, switch view to plain text mode
So in the same way with Qt I done the next code:
void MainWindow::ProcessingCallback(Channel &Ch, SignalInfo &Info)
{
try
{
// Update the eVision image with the acquired image data
UpdateImageConfig(*Info.Surf, EImgSrc);
// Convert EImage to QImage
QImage imaq
((const uchar
*)EImgSrc.
GetGenericImagePtr(), EImgSrc.
GetWidth(), EImgSrc.
GetHeight(), EImgSrc.
GetBitsPerRow(),
QImage::Format_RGB888);
// Display the new image
painter.
drawImage(QPoint(0,
0), imaq
);
}
catch (Euresys::MultiCam::Exception &e)
{
// Display the exceptions...
}
}
void MainWindow::ProcessingCallback(Channel &Ch, SignalInfo &Info)
{
try
{
// Update the eVision image with the acquired image data
UpdateImageConfig(*Info.Surf, EImgSrc);
// Convert EImage to QImage
QImage imaq((const uchar*)EImgSrc.GetGenericImagePtr(), EImgSrc.GetWidth(), EImgSrc.GetHeight(), EImgSrc.GetBitsPerRow(), QImage::Format_RGB888);
// Display the new image
QPainter painter(this);
painter.drawImage(QPoint(0, 0), imaq);
}
catch (Euresys::MultiCam::Exception &e)
{
// Display the exceptions...
}
}
To copy to clipboard, switch view to plain text mode
But in this case, there are no display and output show this message :
QPainter::begin: Paint device returned engine
== 0, type
: 1
QPainter::begin: Paint device returned engine == 0, type: 1
To copy to clipboard, switch view to plain text mode
Could you advice me please?
Bookmarks