void ResultWindow::addImage(QImage img, Matrix3f H, Vector3f centroid, QVector<Vector3f> lista) { // QImage newImage = CVlib::generateImage(img,H); // RenderArea *render = new RenderArea(container); // render->setPixmap(QPixmap::fromImage(newImage)); // render->centroid = H * centroid; // render->centroid /= render->centroid(2); // render->limits = CVlib::getHomographyBounds(lista, H); // render->show(); // list.push_back(render); RenderArea *render = new RenderArea(); render->setPixmap(QPixmap::fromImage(img)); render->H = H; Vector3f TL; TL << 0, 0, 1; Vector3f BL; BL << 0, img.height(),1; Vector3f BR; BR << img.width(), img.height(), 1; Vector3f TR; TR << img.width(), 0, 1; QVector<Vector3f> L; L.push_back(TL); L.push_back(BL); L.push_back(BR); L.push_back(TR); render->limits = CVlib::getHomographyBounds(L, H); list.push_back(render); }
int main(int argc, char *argv[]) { QApplication app(argc, argv); RenderArea area; area.setGeometry(100, 100, 600, 500); area.show(); QTeXPaintDevice tex(QString("example.tex"), QSize(600, 500)); tex.setDocumentMode(); QPainter paint; paint.begin(&tex); area.draw(&paint); paint.end(); return app.exec(); }
void TriggerRecognizer::displayImage() const { // debug method. should be not used in production! std::cerr << "displayImage" << std::endl; QWidget *activeWindow = QApplication::activeWindow(); RenderArea *renderArea = new RenderArea; QObject::connect(activeWindow, SIGNAL(closed()), renderArea, SLOT(close()) ); renderArea->setImage(image); renderArea->show(); renderArea->update(); std::cerr << "Recognizer: created new RenderArea and displayed it" << std::endl; }