<?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[QImage-&gt;copy(x,y,width,height)]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I am trying to find the equivalent of the copy(x,y,width,height) method in the QImage class for cv::Mat in OpenCV. Looking at the header qimage.h<br />
I see that the copy method is a wrapper over</p>
<pre><code>    QImage copy(const QRect &amp;rect = QRect()) const;
    inline QImage copy(int x, int y, int w, int h) const
        { return copy(QRect(x, y, w, h)); }

</code></pre>
<p dir="auto">which is wrapper over QRect. Using cv::Mat in OpenCV (<a href="http://docs.opencv.org/3.1.0/d3/d63/classcv_1_1Mat.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://docs.opencv.org/3.1.0/d3/d63/classcv_1_1Mat.html</a>) would the equivalent be<br />
convertTo, copyTo or simply there is no equivalent and I have to write the equivalent?</p>
<p dir="auto">Fb.</p>
]]></description><link>https://forum.qt.io/topic/77063/qimage-copy-x-y-width-height</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 03:41:38 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/77063.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Mar 2017 01:36:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QImage-&gt;copy(x,y,width,height) on Fri, 10 Mar 2017 08:27:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
You can copy section using ctor</p>
<p dir="auto">int x = 10,<br />
y = 20,<br />
width = 200,<br />
height = 200;</p>
<p dir="auto">Mat img1, img2;<br />
img1 = imread("Lenna.png");<br />
img2 = img1(Rect(x, y, width, height));</p>
]]></description><link>https://forum.qt.io/post/381184</link><guid isPermaLink="true">https://forum.qt.io/post/381184</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Fri, 10 Mar 2017 08:27:43 GMT</pubDate></item><item><title><![CDATA[Reply to QImage-&gt;copy(x,y,width,height) on Fri, 10 Mar 2017 08:08:51 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">It's not a wrapper over QRect, it calls the copy method that takes a QRect as parameter. It's more or less the equivaled of the copyTo method that takes two parameters but in the case case of QImage, it copies all channels in the QImage object that is returned by that function.</p>
]]></description><link>https://forum.qt.io/post/381176</link><guid isPermaLink="true">https://forum.qt.io/post/381176</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 10 Mar 2017 08:08:51 GMT</pubDate></item></channel></rss>