<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kristou Says &#187; C++</title>
	<atom:link href="http://mehrez.kristou.org/category/computer/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://mehrez.kristou.org</link>
	<description>I share my experience</description>
	<lastBuildDate>Wed, 29 Jun 2011 19:25:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Color interpolation in OpenCV</title>
		<link>http://mehrez.kristou.org/color-interpolation-in-opencv/</link>
		<comments>http://mehrez.kristou.org/color-interpolation-in-opencv/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 04:23:07 +0000</pubDate>
		<dc:creator>Kristou Mehrez</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[OpenCV]]></category>

		<guid isPermaLink="false">http://mehrez.kristou.org/?p=1456</guid>
		<description><![CDATA[I could not find in Internet a function which can return a RGB color value between two colors So I had to do it myself. I hope it will be useful for someone. 

<code>CvScalar interpolate(CvScalar c1, CvScalar c2, double value){
    if( value <= 0.0 ){ return c1; }
    if( value >= 1.0 ){ return c2; }
    int red	= cvRound((1.0 - value) * c1.val[2] + value * c2.val[2]);
    int green	= cvRound((1.0 - value) * c1.val[1] + value * c2.val[1]);
    int blue	= cvRound((1.0 - value) * c1.val[0] + value * c2.val[0]);
    return CV_RGB(red, green, blue);
}</code>]]></description>
			<content:encoded><![CDATA[<p>I could not find in Internet a function which can return a RGB color value between two colors So I had to do it myself. I hope it will be useful for someone. </p>
<p><code>CvScalar interpolate(CvScalar c1, CvScalar c2, double value){<br />
    if( value <= 0.0 ){ return c1; }<br />
    if( value >= 1.0 ){ return c2; }<br />
    int red	= cvRound((1.0 - value) * c1.val[2] + value * c2.val[2]);<br />
    int green	= cvRound((1.0 - value) * c1.val[1] + value * c2.val[1]);<br />
    int blue	= cvRound((1.0 - value) * c1.val[0] + value * c2.val[0]);<br />
    return CV_RGB(red, green, blue);<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mehrez.kristou.org/color-interpolation-in-opencv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove items from deque, list or vector in a loop</title>
		<link>http://mehrez.kristou.org/remove-items-from-deque-list-or-vector-from-a-loop/</link>
		<comments>http://mehrez.kristou.org/remove-items-from-deque-list-or-vector-from-a-loop/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 15:42:53 +0000</pubDate>
		<dc:creator>Kristou Mehrez</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.kristou.com/?p=1207</guid>
		<description><![CDATA[Recently I needed to delete items from a sequence like a deque , list or vector from a for loop, I figured out that I have to do something like this: for(iter = list.begin(); iter != list.end(); ++iter) { // your code iter = list.erase(iter); --iter; // your code } It looks basic but it [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to delete items from a sequence like a deque , list or vector from a for loop, I figured out that I have to do something like this:</p>
<pre class="brush:cpp">
for(iter = list.begin(); iter != list.end(); ++iter)
{
// your code
iter = list.erase(iter);
--iter;
// your code
}
</pre>
<p>It looks basic but it took me a while to figure it out so I wanted to share in case somebody need it.</p>
]]></content:encoded>
			<wfw:commentRss>http://mehrez.kristou.org/remove-items-from-deque-list-or-vector-from-a-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++: Convert int to string</title>
		<link>http://mehrez.kristou.org/c-convert-int-to-string/</link>
		<comments>http://mehrez.kristou.org/c-convert-int-to-string/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 12:19:21 +0000</pubDate>
		<dc:creator>Kristou Mehrez</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.kristou.com/?p=406</guid>
		<description><![CDATA[This is an elegant function to convert int to string to use anywhere: std::string intToString(int i) { std::stringstream ss; std::string s; ss < < i; s = ss.str(); return s; }]]></description>
			<content:encoded><![CDATA[<p>This is an elegant function to convert int to string to use anywhere:</p>
<pre class="brush:cpp">
std::string intToString(int i)
{
    std::stringstream ss;
    std::string s;
    ss < < i;
    s = ss.str();

    return s;
}
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mehrez.kristou.org/c-convert-int-to-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++: Delete or remove a file</title>
		<link>http://mehrez.kristou.org/c-delete-or-remove-a-file/</link>
		<comments>http://mehrez.kristou.org/c-delete-or-remove-a-file/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 13:19:03 +0000</pubDate>
		<dc:creator>Kristou Mehrez</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://kristou.com/?p=132</guid>
		<description><![CDATA[To delete or remove a file in C++ you can use the remove function from stdio.h like follows: #include int main(){ if(remove("myfile.txt") == -1) fprintf(stderr,"Remove failed");]]></description>
			<content:encoded><![CDATA[<p>To delete or remove a file in C++ you can use the remove function from stdio.h like follows:</p>
<pre class="brush:c">

#include <stdio .h>

int main(){ if(remove("myfile.txt") == -1)

    fprintf(stderr,"Remove failed");

// your code .......

}
</stdio></pre>
]]></content:encoded>
			<wfw:commentRss>http://mehrez.kristou.org/c-delete-or-remove-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenCV: Implementation of Eigenface</title>
		<link>http://mehrez.kristou.org/implementation-of-eigenface-in-opencv/</link>
		<comments>http://mehrez.kristou.org/implementation-of-eigenface-in-opencv/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 13:04:23 +0000</pubDate>
		<dc:creator>Kristou Mehrez</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[OpenCV]]></category>

		<guid isPermaLink="false">http://kristou.com/?p=55</guid>
		<description><![CDATA[<p style="clear: both">I found a good tutorial which explain how the face recognition method called eigenface works: <a href="http://www.cognotics.com/opencv/servo_2007_series/part_5/index.html" title="Eignenface" target="_blank">Cognotics</a>This tutorial uses the deprecated function cvCalcEigenObjects(). The advised function is cvCalcPCA().</p>]]></description>
			<content:encoded><![CDATA[<p style="clear: both">I found a good tutorial which explain how the face recognition method called eigenface works: <a href="http://www.cognotics.com/opencv/servo_2007_series/part_5/index.html" title="Eignenface" target="_blank">Cognotics</a><br />This tutorial uses the deprecated function cvCalcEigenObjects(). <br />The advised function is cvCalcPCA().</p>
<p><br class="final-break" style="clear: both" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mehrez.kristou.org/implementation-of-eigenface-in-opencv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

