<?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[[SOLVED]Rotation of ROI]]></title><description><![CDATA[<p dir="auto">Hello my friends...</p>
<p dir="auto">I have drawn a rectangle in one image which is loaded on qgraphicsView.<br />
I got all of the dimensions from user and drew this rectangle.Now I am going to rotate this rectangle with respect to angle which is given by user...<br />
How can I do that?</p>
<p dir="auto">thanks in advance</p>
]]></description><link>https://forum.qt.io/topic/23395/solved-rotation-of-roi</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 17:57:36 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/23395.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Jan 2013 17:34:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED]Rotation of ROI on Sun, 20 Jan 2013 04:27:33 GMT]]></title><description><![CDATA[<p dir="auto">I am puzzled what you are trying to achieve.</p>
<p dir="auto">All of your image manipulation is being done with OpenCV, which has nothing to do with Qt.  If you want OpenCV to draw a rotated rectangle on top of the image you load from a file then you need to refer to the OpenCV documentation as to how you do that.</p>
<p dir="auto">If you want to rotate the entire image after you place it into the QGraphicsScene then you use QGraphicsItem::setRotation() on the QGraphicsPixmapItem you create as vidar suggested.</p>
<p dir="auto">All of this can be done without OpenCV.</p>
]]></description><link>https://forum.qt.io/post/163763</link><guid isPermaLink="true">https://forum.qt.io/post/163763</guid><dc:creator><![CDATA[ChrisW67]]></dc:creator><pubDate>Sun, 20 Jan 2013 04:27:33 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED]Rotation of ROI on Sat, 19 Jan 2013 19:20:37 GMT]]></title><description><![CDATA[<p dir="auto">hello<br />
excuse me ...can you guide me a little more? I am new comer in Qt and opencv world...<br />
this is my code...I want to rotate these drawn rectangles as much as angle which is given by user...</p>
<p dir="auto">/////////////////////////////////////////////////</p>
<p dir="auto">void MainWindow::on_btnSetROI_clicked()<br />
{<br />
CvRect rect,rectb,rectn;</p>
<p dir="auto">cv::Mat img;<br />
QGraphicsScene* scene = new QGraphicsScene();<br />
scene-&gt;clear(); //for cleaning the qgraphicsview and loading the image again</p>
<p dir="auto">img = imread(filename.toAscii().data());</p>
<p dir="auto">//Drawing ROIs</p>
<p dir="auto">rect.x=ui-&gt;txtx0-&gt;toPlainText().toInt();</p>
<p dir="auto">rect.y=ui-&gt;txty0-&gt;toPlainText().toInt();</p>
<p dir="auto">rect.height=ui-&gt;txtheight-&gt;toPlainText().toInt();</p>
<p dir="auto">rect.width=ui-&gt;txtwidth-&gt;toPlainText().toInt();</p>
<p dir="auto">cv::rectangle(img,rect,COLOR_RGB2RGBA,1,8,0);</p>
<p dir="auto">//ROI white</p>
<p dir="auto">rectb.x=ui-&gt;txtxb1-&gt;toPlainText().toInt();</p>
<p dir="auto">rectb.y=ui-&gt;txtyb1-&gt;toPlainText().toInt();</p>
<p dir="auto">rectb.height=ui-&gt;txtheightwhite-&gt;toPlainText().toInt();</p>
<p dir="auto">rectb.width=ui-&gt;txtwidthWhite-&gt;toPlainText().toInt();</p>
<p dir="auto">cv::rectangle(img,rectb,COLOR_RGB2RGBA,1,8,0);</p>
<p dir="auto">//ROI black</p>
<p dir="auto">rectn.x=ui-&gt;txtxn1-&gt;toPlainText().toInt();</p>
<p dir="auto">rectn.y=ui-&gt;txtyn1-&gt;toPlainText().toInt();</p>
<p dir="auto">rectn.height=ui-&gt;txtheightBlack-&gt;toPlainText().toInt();</p>
<p dir="auto">rectn.width=ui-&gt;txtwidthBlack-&gt;toPlainText().toInt();</p>
<p dir="auto">cv::rectangle(img,rectn,COLOR_RGB2RGBA,1,8,0);<br />
/////////////////////////////////<br />
QImage img1 = QImage((const unsigned char*)(img.data), img.cols, img.rows, img.step, QImage::Format_RGB888);<br />
QGraphicsPixmapItem* item = new QGraphicsPixmapItem(QPixmap::fromImage(img1));</p>
<p dir="auto">QGraphicsItem* i=new QGraphicsItem() ;<br />
ui-&gt;View-&gt;setScene(scene);  //"View" is the name of object that I have on my .ui file(form)<br />
--}</p>
]]></description><link>https://forum.qt.io/post/163741</link><guid isPermaLink="true">https://forum.qt.io/post/163741</guid><dc:creator><![CDATA[soheil1365]]></dc:creator><pubDate>Sat, 19 Jan 2013 19:20:37 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED]Rotation of ROI on Sat, 19 Jan 2013 18:08:07 GMT]]></title><description><![CDATA[<p dir="auto">hmmm, use QGraphicsItem::setRotation  ?</p>
]]></description><link>https://forum.qt.io/post/163738</link><guid isPermaLink="true">https://forum.qt.io/post/163738</guid><dc:creator><![CDATA[vidar]]></dc:creator><pubDate>Sat, 19 Jan 2013 18:08:07 GMT</pubDate></item></channel></rss>