<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[cvShowImage von openCV innerhalb von QT Programm]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe ein QT4 Programm am laufen und öffne aus diesem heraus ein neues Fenster welches via cvShowImage ( aus openCV ) ein Bild darstellt. Ich setze auch cvWaitKey(0) um das neue Fenster solange anzuzeigen, bis ich eine Taste drücke.</p>
<p>Sobald ich eine Taste drücke stürzt mir das ganze Programm aber ab.<br />
Starte ich denn openCV code direkt , also nicht aus QT heraus, klappt alles wunderbar.</p>
<p>Woran kann das liegen?</p>
<p>Sollte der openCV allenfalls in einem eigenen Thread gestartet werden?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/237096/cvshowimage-von-opencv-innerhalb-von-qt-programm</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 14:27:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/237096.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Mar 2009 16:42:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to cvShowImage von openCV innerhalb von QT Programm on Tue, 24 Mar 2009 16:42:15 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe ein QT4 Programm am laufen und öffne aus diesem heraus ein neues Fenster welches via cvShowImage ( aus openCV ) ein Bild darstellt. Ich setze auch cvWaitKey(0) um das neue Fenster solange anzuzeigen, bis ich eine Taste drücke.</p>
<p>Sobald ich eine Taste drücke stürzt mir das ganze Programm aber ab.<br />
Starte ich denn openCV code direkt , also nicht aus QT heraus, klappt alles wunderbar.</p>
<p>Woran kann das liegen?</p>
<p>Sollte der openCV allenfalls in einem eigenen Thread gestartet werden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1685322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1685322</guid><dc:creator><![CDATA[vittel]]></dc:creator><pubDate>Tue, 24 Mar 2009 16:42:15 GMT</pubDate></item><item><title><![CDATA[Reply to cvShowImage von openCV innerhalb von QT Programm on Thu, 26 Mar 2009 07:12:07 GMT]]></title><description><![CDATA[<p>Zeig am besten mal ein wenig Code.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686152</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686152</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 26 Mar 2009 07:12:07 GMT</pubDate></item><item><title><![CDATA[Reply to cvShowImage von openCV innerhalb von QT Programm on Thu, 26 Mar 2009 08:29:53 GMT]]></title><description><![CDATA[<p>Ok.</p>
<p>Hier ein minimal Beispiel:</p>
<pre><code class="language-cpp">#include &quot;window.h&quot;
#include &lt;highgui.h&gt;

Window::Window(){

 setText(&quot;Show Image&quot;);
 connect(this, SIGNAL(clicked()),this,SLOT(image()));

}

void Window::image() {

	IplImage *imgA = cvLoadImage(&quot;b4.jpg&quot;);

	cvNamedWindow(&quot;Bild&quot;, 0);
	cvShowImage(&quot;Bild&quot;, imgA);
	cvWaitKey(0);

	cvReleaseImage(&amp;imgA);
	cvDestroyWindow(&quot;Bild&quot;);
}
</code></pre>
<pre><code class="language-cpp">#ifndef WINDOW_H_
#define WINDOW_H_

#include &lt;qpushbutton.h&gt;

class Window : public QPushButton
{
	Q_OBJECT
public :
	Window();

public slots:
	void image();
};

#endif /* WINDOW_H_ */
</code></pre>
<pre><code class="language-cpp">#include &lt;qapplication.h&gt;
#include &lt;window.h&gt;

int main( int argc, char **argv )
{
	QApplication app( argc, argv );

	Window * win = new Window();
	win-&gt;show();

	return app.exec();

}
</code></pre>
<p>pro file:</p>
<pre><code>######################################################################
# Automatically generated by qmake (2.01a) Do Mrz 26 09:07:47 2009
######################################################################

TEMPLATE = app
TARGET = 
DEPENDPATH += .
INCLUDEPATH += . /opt/local/include/opencv  #opencv include dateien
LIBS += -lhighgui -lcxcore  #opencv libraries

# Input
HEADERS += window.h
SOURCES += main.cpp window.cpp
</code></pre>
<p>Bild wird korrekt angezeigt, falls dann aber eine Tastatureingabe erfolgt, hängt sich das Programm auf. cvWaitKey(0) soll das Bild solange anzeigen bis eine Taste gedrückt wird, und dann weitergehen im Code.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686160</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686160</guid><dc:creator><![CDATA[vittel]]></dc:creator><pubDate>Thu, 26 Mar 2009 08:29:53 GMT</pubDate></item><item><title><![CDATA[Reply to cvShowImage von openCV innerhalb von QT Programm on Thu, 26 Mar 2009 11:56:24 GMT]]></title><description><![CDATA[<p>Beim ersten Mal hast du gesagt, das Programm stürzt ab. Beim deinem zweiten Post aber sagst du, es hängt sich auf. Wat denn nu? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Kommt da eine Fehlermeldung? Wenn ja, welche?</p>
<p>An cvWaitKey wird es wohl kaum liegen. Ich vermute mal, dass entweder cvReleaseImage oder cvDestroyWindow das Problem verursacht. Hau das cvWaitKey mal raus, setz einen Breakpoint auf cvReleaseImage und geh schrittweise durch, bis ein Fehler kommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686260</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 26 Mar 2009 11:56:24 GMT</pubDate></item><item><title><![CDATA[Reply to cvShowImage von openCV innerhalb von QT Programm on Thu, 26 Mar 2009 12:34:43 GMT]]></title><description><![CDATA[<p>_matze schrieb:</p>
<blockquote>
<p>Beim ersten Mal hast du gesagt, das Programm stürzt ab. Beim deinem zweiten Post aber sagst du, es hängt sich auf. Wat denn nu? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Kommt da eine Fehlermeldung? Wenn ja, welche?</p>
</blockquote>
<p>Ja, sorry für die Ungenauigkeit. Das Programm stürzt nicht ab, es hängt sich auf. Genauer gesagt hängt sich nur das Fenster mit Bild auf, welches von openCV gestartet wurde. Der Qt Button funktioniert weiter. Ein Klick darauf und ein weiteres Fenster mit einem Bild geht auf. Keine Fehlermeldungen.</p>
<p>Lasse ich cvWaitKey() / cvReleaseImage oder, und cvDestroyWindow ändert sich nichts am Ganzen.</p>
<p>Mit dem debugger konnte ich auch nichts verdächtiges sehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686290</guid><dc:creator><![CDATA[vittel]]></dc:creator><pubDate>Thu, 26 Mar 2009 12:34:43 GMT</pubDate></item></channel></rss>