<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Prodigy Productions, LLC</title>
	<atom:link href="http://www.prodigyproductionsllc.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.prodigyproductionsllc.com</link>
	<description>Learn software development, computer vision, and A.I. programming.</description>
	<lastBuildDate>Sun, 19 Feb 2012 16:59:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1100</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sun, 19 Feb 2012 16:59:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1100</guid>
		<description>Thanks LuCus..U have been very helpful to me in my project..I wil try what u said..</description>
		<content:encoded><![CDATA[<p>Thanks LuCus..U have been very helpful to me in my project..I wil try what u said..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1098</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Sun, 19 Feb 2012 15:19:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1098</guid>
		<description>MinMaxLoc returns several values. 2 of them are for min and max locations. These indicate the top left and bottom right corners of the template as it&#039;s found in your image. You can also use these to check that your template has been found before drawing your rectangle. Here&#039;s the docs for this function. http://opencv.willowgarage.com/documentation/cpp/core_operations_on_arrays.html#minMaxLoc</description>
		<content:encoded><![CDATA[<p>MinMaxLoc returns several values. 2 of them are for min and max locations. These indicate the top left and bottom right corners of the template as it&#8217;s found in your image. You can also use these to check that your template has been found before drawing your rectangle. Here&#8217;s the docs for this function. <a href="http://opencv.willowgarage.com/documentation/cpp/core_operations_on_arrays.html#minMaxLoc" rel="nofollow">http://opencv.willowgarage.com/documentation/cpp/core_operations_on_arrays.html#minMaxLoc</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1097</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sun, 19 Feb 2012 15:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1097</guid>
		<description>wat values are returned by cvMatchTemplate and cvMinmaxloc...should i go through any reference documents ?</description>
		<content:encoded><![CDATA[<p>wat values are returned by cvMatchTemplate and cvMinmaxloc&#8230;should i go through any reference documents ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1096</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Sun, 19 Feb 2012 15:07:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1096</guid>
		<description>You can probably check that both minval and maxval are greater than zero and only draw your rectangle if that&#039;s true.</description>
		<content:encoded><![CDATA[<p>You can probably check that both minval and maxval are greater than zero and only draw your rectangle if that&#8217;s true.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1095</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sun, 19 Feb 2012 15:03:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1095</guid>
		<description>thanks for ur words Lucus..:)</description>
		<content:encoded><![CDATA[<p>thanks for ur words Lucus..:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1094</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Sun, 19 Feb 2012 15:03:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1094</guid>
		<description>Thanks for choosing my site to help you learn OpenCV and computer vision. SURF is a pretty tough technique to use and understand, especially when first starting out with computer vision. However, as soon as I get time, I will write up an article explaining exactly how it works. Until then, I have uploaded an example app that uses SURF to locate a box within another image. You can download it from http://www.prodigyproductionsllc.com/downloads/SURF.zip</description>
		<content:encoded><![CDATA[<p>Thanks for choosing my site to help you learn OpenCV and computer vision. SURF is a pretty tough technique to use and understand, especially when first starting out with computer vision. However, as soon as I get time, I will write up an article explaining exactly how it works. Until then, I have uploaded an example app that uses SURF to locate a box within another image. You can download it from <a href="http://www.prodigyproductionsllc.com/downloads/SURF.zip" rel="nofollow">http://www.prodigyproductionsllc.com/downloads/SURF.zip</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1093</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Sun, 19 Feb 2012 14:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1093</guid>
		<description>Sorry. I went out last night and didn&#039;t get home till late. Yes, what you did is definitely advisable. Your images should always contain the same number of channels. Glad you got it working!</description>
		<content:encoded><![CDATA[<p>Sorry. I went out last night and didn&#8217;t get home till late. Yes, what you did is definitely advisable. Your images should always contain the same number of channels. Glad you got it working!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1092</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sun, 19 Feb 2012 11:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1092</guid>
		<description>how could i deal with the scores of the template matching techniques...becoz  a rectangle [my used way to find the match] is drawn even when there is  no proper match or  no match...
I want the single match that is most accurate...
 is CV_TM_CCOEFF_NORMED the best one (i consider only accuracy)..??</description>
		<content:encoded><![CDATA[<p>how could i deal with the scores of the template matching techniques&#8230;becoz  a rectangle [my used way to find the match] is drawn even when there is  no proper match or  no match&#8230;<br />
I want the single match that is most accurate&#8230;<br />
 is CV_TM_CCOEFF_NORMED the best one (i consider only accuracy)..??</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1091</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sun, 19 Feb 2012 10:35:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1091</guid>
		<description>hurray..i got it... i found that the tpl is of 3 channels while img is 1...
this made that work tpl-&gt;nChannels=1;...

 wat i did is advisable . ?</description>
		<content:encoded><![CDATA[<p>hurray..i got it&#8230; i found that the tpl is of 3 channels while img is 1&#8230;<br />
this made that work tpl-&gt;nChannels=1;&#8230;</p>
<p> wat i did is advisable . ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by easyfrog</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1090</link>
		<dc:creator>easyfrog</dc:creator>
		<pubDate>Sun, 19 Feb 2012 10:27:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1090</guid>
		<description>Hi LuCus :

    I am from you here to start learning OpenCvSharp. It&#039;s very helpful for me .But . I Still Don&#039;t know how to use SURF.
   Could you write a SURF article ? Thank you very much!~</description>
		<content:encoded><![CDATA[<p>Hi LuCus :</p>
<p>    I am from you here to start learning OpenCvSharp. It&#8217;s very helpful for me .But . I Still Don&#8217;t know how to use SURF.<br />
   Could you write a SURF article ? Thank you very much!~</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1089</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sun, 19 Feb 2012 09:25:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1089</guid>
		<description>Sorry for not noticing this before..the following error is also displayed..Hope this wud be an easy nut  for u to crack ...

&quot;OpenCV Error: Sizes of input arguments do not match (image and template should h
ave the same type) in unknown function, file ..\..\..\..\ocv\opencv\src\cv\cvtem
plmatch.cpp, line 356&quot;</description>
		<content:encoded><![CDATA[<p>Sorry for not noticing this before..the following error is also displayed..Hope this wud be an easy nut  for u to crack &#8230;</p>
<p>&#8220;OpenCV Error: Sizes of input arguments do not match (image and template should h<br />
ave the same type) in unknown function, file ..\..\..\..\ocv\opencv\src\cv\cvtem<br />
plmatch.cpp, line 356&#8243;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1088</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sat, 18 Feb 2012 17:56:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1088</guid>
		<description>It takes only few seconds to reach the exception...Immediately after the light for webcam glows...
When i show a bright object(orange color) , i want it to be in white with background(including all other objects) black , so i thought i could use flip n HSv....
I moved that tpl line as u said...</description>
		<content:encoded><![CDATA[<p>It takes only few seconds to reach the exception&#8230;Immediately after the light for webcam glows&#8230;<br />
When i show a bright object(orange color) , i want it to be in white with background(including all other objects) black , so i thought i could use flip n HSv&#8230;.<br />
I moved that tpl line as u said&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1087</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Sat, 18 Feb 2012 17:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1087</guid>
		<description>On a related note, move this line &quot;tpl = cvLoadImage( “c://b.png”, CV_LOAD_IMAGE_COLOR );&quot; to above where you begin your while loop since it only needs to be instantiated 1 time. It looks like you have a memory leak. Even though this isn&#039;t the only thing you can do to help with memory, it&#039;s definitely a start. You can also move the following lines to above your while loop since they won&#039;t be changing either.

tpl_width = tpl-&gt;width;
tpl_height = tpl-&gt;height;</description>
		<content:encoded><![CDATA[<p>On a related note, move this line &#8220;tpl = cvLoadImage( “c://b.png”, CV_LOAD_IMAGE_COLOR );&#8221; to above where you begin your while loop since it only needs to be instantiated 1 time. It looks like you have a memory leak. Even though this isn&#8217;t the only thing you can do to help with memory, it&#8217;s definitely a start. You can also move the following lines to above your while loop since they won&#8217;t be changing either.</p>
<p>tpl_width = tpl->width;<br />
tpl_height = tpl->height;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1086</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Sat, 18 Feb 2012 17:38:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1086</guid>
		<description>Does the exception get thrown right away? Does it take a few minutes or seconds before it gets thrown? Does it do it when finding the template or when the template is removed? BTW, is there a particular reason you&#039;re flipping the image and converting it to HSV?</description>
		<content:encoded><![CDATA[<p>Does the exception get thrown right away? Does it take a few minutes or seconds before it gets thrown? Does it do it when finding the template or when the template is removed? BTW, is there a particular reason you&#8217;re flipping the image and converting it to HSV?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1085</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sat, 18 Feb 2012 17:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1085</guid>
		<description>this is the exception....
Unhandled exception at 0x772115ee in testing.exe: Microsoft C++ exception: cv::Exception at memory location 0x0035f62c..

[pls note that cvShowImage in the above code works..]</description>
		<content:encoded><![CDATA[<p>this is the exception&#8230;.<br />
Unhandled exception at 0x772115ee in testing.exe: Microsoft C++ exception: cv::Exception at memory location 0x0035f62c..</p>
<p>[pls note that cvShowImage in the above code works..]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1084</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Sat, 18 Feb 2012 17:08:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1084</guid>
		<description>What is the exception it&#039;s throwing?</description>
		<content:encoded><![CDATA[<p>What is the exception it&#8217;s throwing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1083</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sat, 18 Feb 2012 16:33:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1083</guid>
		<description>Actually I’m not creating a blank image with img…the updated code goes as follows :
”
CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );

after while loop :
frame = cvQueryFrame( capture );
cvFlip(frame,frame,1);
// Convert the image into an HSV image
imgHSV = cvCreateImage(cvGetSize(frame), 8, 3);
cvCvtColor(frame, imgHSV, CV_BGR2HSV);

img = cvCreateImage(cvGetSize(frame), 8, 1);
	cvInRangeS(imgHSV,cvScalar(h1,s1,v1),cvScalar(h2,s2,v2),img);
cvShowImage( &quot;Threshold&quot;,img);//works
tpl = cvLoadImage( “c://b.png”, CV_LOAD_IMAGE_COLOR );

/* get image’s properties */
img_width = img-&gt;width;
img_height = img-&gt;height;
tpl_width = tpl-&gt;width;
tpl_height = tpl-&gt;height;
res_width = img_width – tpl_width + 1;
res_height = img_height – tpl_height + 1;

res = cvCreateImage( cvSize( res_width, res_height ), IPL_DEPTH_32F, 1 );

cvMatchTemplate(img, tpl, res, CV_TM_SQDIFF ); ”

When i try the same with frame instead of img , the program runs but now an exception is thrown..</description>
		<content:encoded><![CDATA[<p>Actually I’m not creating a blank image with img…the updated code goes as follows :<br />
”<br />
CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );</p>
<p>after while loop :<br />
frame = cvQueryFrame( capture );<br />
cvFlip(frame,frame,1);<br />
// Convert the image into an HSV image<br />
imgHSV = cvCreateImage(cvGetSize(frame), 8, 3);<br />
cvCvtColor(frame, imgHSV, CV_BGR2HSV);</p>
<p>img = cvCreateImage(cvGetSize(frame), 8, 1);<br />
	cvInRangeS(imgHSV,cvScalar(h1,s1,v1),cvScalar(h2,s2,v2),img);<br />
cvShowImage( &#8220;Threshold&#8221;,img);//works<br />
tpl = cvLoadImage( “c://b.png”, CV_LOAD_IMAGE_COLOR );</p>
<p>/* get image’s properties */<br />
img_width = img-&gt;width;<br />
img_height = img-&gt;height;<br />
tpl_width = tpl-&gt;width;<br />
tpl_height = tpl-&gt;height;<br />
res_width = img_width – tpl_width + 1;<br />
res_height = img_height – tpl_height + 1;</p>
<p>res = cvCreateImage( cvSize( res_width, res_height ), IPL_DEPTH_32F, 1 );</p>
<p>cvMatchTemplate(img, tpl, res, CV_TM_SQDIFF ); ”</p>
<p>When i try the same with frame instead of img , the program runs but now an exception is thrown..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1082</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sat, 18 Feb 2012 16:16:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1082</guid>
		<description>Thank you sir..I had followed what u said now...I have been thinking of making the program to run rather than thinking of the performance...Now changed ma mind for getting both...:)</description>
		<content:encoded><![CDATA[<p>Thank you sir..I had followed what u said now&#8230;I have been thinking of making the program to run rather than thinking of the performance&#8230;Now changed ma mind for getting both&#8230;:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1081</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Sat, 18 Feb 2012 16:09:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1081</guid>
		<description>Actually I&#039;m not creating a blank image with img...the code goes as follows :
&quot;
 CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );

after while loop :
     frame = cvQueryFrame( capture );
    cvFlip(frame,frame,1);
   // Convert the image into an HSV image
     imgHSV = cvCreateImage(cvGetSize(frame), 8, 3);
    cvCvtColor(frame, imgHSV, CV_BGR2HSV);

 img = cvCreateImage(cvGetSize(frame), 8, 1);
 tpl = cvLoadImage( “c://b.png”, CV_LOAD_IMAGE_COLOR );

/* get image&#039;s properties */
	img_width  = img-&gt;width;
	img_height = img-&gt;height;
	tpl_width  = tpl-&gt;width;
	tpl_height = tpl-&gt;height;
	res_width  = img_width - tpl_width + 1;
	res_height = img_height - tpl_height + 1;

res = cvCreateImage( cvSize( res_width, res_height ), IPL_DEPTH_32F, 1 );

cvMatchTemplate(img, tpl, res, CV_TM_SQDIFF ); ”


When i try the same with frame instead of img ,  the program runs but now an exception is thrown..</description>
		<content:encoded><![CDATA[<p>Actually I&#8217;m not creating a blank image with img&#8230;the code goes as follows :<br />
&#8221;<br />
 CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );</p>
<p>after while loop :<br />
     frame = cvQueryFrame( capture );<br />
    cvFlip(frame,frame,1);<br />
   // Convert the image into an HSV image<br />
     imgHSV = cvCreateImage(cvGetSize(frame), 8, 3);<br />
    cvCvtColor(frame, imgHSV, CV_BGR2HSV);</p>
<p> img = cvCreateImage(cvGetSize(frame), 8, 1);<br />
 tpl = cvLoadImage( “c://b.png”, CV_LOAD_IMAGE_COLOR );</p>
<p>/* get image&#8217;s properties */<br />
	img_width  = img-&gt;width;<br />
	img_height = img-&gt;height;<br />
	tpl_width  = tpl-&gt;width;<br />
	tpl_height = tpl-&gt;height;<br />
	res_width  = img_width &#8211; tpl_width + 1;<br />
	res_height = img_height &#8211; tpl_height + 1;</p>
<p>res = cvCreateImage( cvSize( res_width, res_height ), IPL_DEPTH_32F, 1 );</p>
<p>cvMatchTemplate(img, tpl, res, CV_TM_SQDIFF ); ”</p>
<p>When i try the same with frame instead of img ,  the program runs but now an exception is thrown..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1080</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Fri, 17 Feb 2012 22:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1080</guid>
		<description>If you&#039;re using a live camera feed, make sure you put a &quot;while&quot; loop or something around the part that does the QueryFrame so that it continues to grab each frame from the video. Otherwise you can use cvGrabFrame or cvRetrieveFrame to grab individual frames. Make sure you put the CvCapture* cap ... outside of the loop so that it doesn&#039;t get rebuilt every time around. Also, it&#039;s usually a good idea for performance if you put all of your object declarations outside of the loop and only instantiate them inside the loop. Something like this:

&lt;code&gt;CvCapture* cap ...;
IplImage* img ...;
IplImage* tpl = cvLoadImage ...;
IplImage* res ...;

while(true) ...

img = cvQueryFrame(cap);
res = cvCreateImage ...
&lt;/code&gt;

You&#039;ll notice that I also instantiated the template outside of the loop since it only needs to get built once.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using a live camera feed, make sure you put a &#8220;while&#8221; loop or something around the part that does the QueryFrame so that it continues to grab each frame from the video. Otherwise you can use cvGrabFrame or cvRetrieveFrame to grab individual frames. Make sure you put the CvCapture* cap &#8230; outside of the loop so that it doesn&#8217;t get rebuilt every time around. Also, it&#8217;s usually a good idea for performance if you put all of your object declarations outside of the loop and only instantiate them inside the loop. Something like this:</p>
<p><code>CvCapture* cap ...;<br />
IplImage* img ...;<br />
IplImage* tpl = cvLoadImage ...;<br />
IplImage* res ...;</p>
<p>while(true) ...</p>
<p>img = cvQueryFrame(cap);<br />
res = cvCreateImage ...<br />
</code></p>
<p>You&#8217;ll notice that I also instantiated the template outside of the loop since it only needs to get built once.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1079</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Fri, 17 Feb 2012 22:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1079</guid>
		<description>I see the problem. You&#039;re not putting anything into &quot;img&quot;. All you&#039;re doing is creating a blank image. Are you planning on doing this with a camera? If so, you can skip the &quot;cvCreateImage&quot; for IplImage* img&quot; and populate it directly with &quot;cap.QueryFrame()&quot;. In C#, that looks something like this:

&lt;code&gt;CvCapture cap = CvCapture.FromCamera(1);
IplImage img = cap.QueryFrame();&lt;/code&gt;

C++ should look something like this:

&lt;code&gt;CvCapture* cap = CvCapture.fromCamera(1);
IplImage* img = cvQueryFrame(cap);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I see the problem. You&#8217;re not putting anything into &#8220;img&#8221;. All you&#8217;re doing is creating a blank image. Are you planning on doing this with a camera? If so, you can skip the &#8220;cvCreateImage&#8221; for IplImage* img&#8221; and populate it directly with &#8220;cap.QueryFrame()&#8221;. In C#, that looks something like this:</p>
<p><code>CvCapture cap = CvCapture.FromCamera(1);<br />
IplImage img = cap.QueryFrame();</code></p>
<p>C++ should look something like this:</p>
<p><code>CvCapture* cap = CvCapture.fromCamera(1);<br />
IplImage* img = cvQueryFrame(cap);</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1078</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Fri, 17 Feb 2012 22:18:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1078</guid>
		<description>No i think.since i took a frame from video,edited and saved it as b.png .</description>
		<content:encoded><![CDATA[<p>No i think.since i took a frame from video,edited and saved it as b.png .</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1077</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Fri, 17 Feb 2012 22:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1077</guid>
		<description>Is it possible that your &quot;c://b.png&quot; file is a different size than &quot;frame&quot;?</description>
		<content:encoded><![CDATA[<p>Is it possible that your &#8220;c://b.png&#8221; file is a different size than &#8220;frame&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by zahiritpro</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1076</link>
		<dc:creator>zahiritpro</dc:creator>
		<pubDate>Fri, 17 Feb 2012 21:20:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1076</guid>
		<description>But this code works..
&quot;IplImage* img = cvLoadImage( &quot;c://a.png&quot;, CV_LOAD_IMAGE_COLOR );
IplImage* tpl = cvLoadImage( &quot;c://b.png&quot;, CV_LOAD_IMAGE_COLOR );
IplImage* res = cvCreateImage( cvSize( res_width, res_height ), IPL_DEPTH_32F, 1 );
cvMatchTemplate(img, tpl, res, CV_TM_SQDIFF );&quot;

while this doesn&#039;t..

&quot; IplImage* img = cvCreateImage(cvGetSize(frame), 8, 1);
IplImage* tpl = cvLoadImage( &quot;c://b.png&quot;, CV_LOAD_IMAGE_COLOR );
IplImage* res = cvCreateImage( cvSize( res_width, res_height ), IPL_DEPTH_32F, 1 );
cvMatchTemplate(img, tpl, res, CV_TM_SQDIFF ); &quot;

Not necessary for me to mind the const in 
&quot;void cvMatchTemplate(const CvArr* image, const CvArr* templ, CvArr* result, int method)&quot; ??</description>
		<content:encoded><![CDATA[<p>But this code works..<br />
&#8220;IplImage* img = cvLoadImage( &#8220;c://a.png&#8221;, CV_LOAD_IMAGE_COLOR );<br />
IplImage* tpl = cvLoadImage( &#8220;c://b.png&#8221;, CV_LOAD_IMAGE_COLOR );<br />
IplImage* res = cvCreateImage( cvSize( res_width, res_height ), IPL_DEPTH_32F, 1 );<br />
cvMatchTemplate(img, tpl, res, CV_TM_SQDIFF );&#8221;</p>
<p>while this doesn&#8217;t..</p>
<p>&#8221; IplImage* img = cvCreateImage(cvGetSize(frame), 8, 1);<br />
IplImage* tpl = cvLoadImage( &#8220;c://b.png&#8221;, CV_LOAD_IMAGE_COLOR );<br />
IplImage* res = cvCreateImage( cvSize( res_width, res_height ), IPL_DEPTH_32F, 1 );<br />
cvMatchTemplate(img, tpl, res, CV_TM_SQDIFF ); &#8221;</p>
<p>Not necessary for me to mind the const in<br />
&#8220;void cvMatchTemplate(const CvArr* image, const CvArr* templ, CvArr* result, int method)&#8221; ??</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Template Matching with OpenCV and C# by LuCuS</title>
		<link>http://www.prodigyproductionsllc.com/articles/programming/template-matching-with-opencv-and-c/#comment-1075</link>
		<dc:creator>LuCuS</dc:creator>
		<pubDate>Fri, 17 Feb 2012 21:10:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.prodigyproductionsllc.com/?p=1718#comment-1075</guid>
		<description>Passing your IplImage is the solution. CvArr is simply an array for OpenCV. The metatype CvArr is used only as a function parameter to specify that the function accepts arrays of multiple types, such as IplImage*, CvMat* or even CvSeq* sometimes. The particular array type is determined at runtime by analyzing the first 4 bytes of the header.</description>
		<content:encoded><![CDATA[<p>Passing your IplImage is the solution. CvArr is simply an array for OpenCV. The metatype CvArr is used only as a function parameter to specify that the function accepts arrays of multiple types, such as IplImage*, CvMat* or even CvSeq* sometimes. The particular array type is determined at runtime by analyzing the first 4 bytes of the header.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

