<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ippiCanny does not work? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917316#M15286</link>
    <description>Um, are you talking about an executable? Or do you need some values for the parameters I use, such as frameSizeDec etc?&lt;BR /&gt;&lt;BR /&gt;Andreas.&lt;BR /&gt;&lt;BR /&gt;P.S. I forgot to mention in my original post that the values of lowThresh and highThresh that I give to ippiCanny don't seem to have any effect (which I think they should), except for when lowThresh &amp;gt; highThresh (in which case I get no edges, and rightfully so).&lt;BR /&gt;</description>
    <pubDate>Tue, 11 Jul 2006 23:39:51 GMT</pubDate>
    <dc:creator>eren</dc:creator>
    <dc:date>2006-07-11T23:39:51Z</dc:date>
    <item>
      <title>ippiCanny does not work?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917314#M15284</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I am using the IPP 5.0 for Linux on a 32-bit Dual-Xeon @ 2.8 GHz with 2
GB of RAM running SuSe 9.3. I am trying to perform edge detection
inside a function called from my main(), but the outcome of ippiCanny
is pretty much rubbish. The code segment I use is the following:&lt;BR /&gt;
&lt;BR /&gt;






&lt;PRE&gt;&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Perform Canny edge detection on the grayscale frame&lt;/I&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Step 1: Get the buffer sizes for the Sobel operations and setup the corresponding buffers&lt;/I&gt;&lt;/SPAN&gt;
ippiFilterSobelHorizGetBufferSize_32f_C1R(frameSizeDec, ippMskSize5x5, &amp;amp;horizBufferSize);
Ipp8u *horizBuffer = ippsMalloc_8u(horizBufferSize);
ippiFilterSobelVertGetBufferSize_32f_C1R(frameSizeDec, ippMskSize5x5, &amp;amp;vertBufferSize);
Ipp8u *vertBuffer = ippsMalloc_8u(vertBufferSize);
	
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Step 2: Perform the Sobel filtering in the horizontal and vertical dimensions&lt;/I&gt;&lt;/SPAN&gt;
Ipp32f *horizSobel = ippiMalloc_32f_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_32f);
ippiFilterSobelHorizBorder_32f_C1R(grayFrameFloat, step1_32f, horizSobel, step1_32f, frameSizeDec, ippMskSize5x5, ippBorderRepl, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;, horizBuffer);
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// 	ippiMulC_16s_C1IRSfs(-1, horizSobel, step1_16s, frameSizeDec, 0);&lt;/I&gt;&lt;/SPAN&gt;
Ipp32f *vertSobel = ippiMalloc_32f_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_32f);
ippiFilterSobelVertBorder_32f_C1R(grayFrameFloat, step1_32f, vertSobel, step1_32f, frameSizeDec, ippMskSize5x5, ippBorderRepl, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;, vertBuffer);
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// 	ippiMulC_16s_C1IRSfs(-1, vertSobel, step1_16s, frameSizeDec, 0);&lt;/I&gt;&lt;/SPAN&gt;
	
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Step 3: Before running the actual edge detector, create a color histogram of the image to decide on Canny's thresholds&lt;/I&gt;&lt;/SPAN&gt;
Ipp32f *magnitude = ippiMalloc_32f_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_32f);
ippsMagnitude_32f(horizSobel, vertSobel, magnitude, step1_8u * frameSizeDec.height);
	
ippiMax_32f_C1R(magnitude, step1_32f, frameSizeDec, &amp;amp;max);
&lt;B&gt;if&lt;/B&gt; (max) ippiDivC_32f_C1IR(max, magnitude, step1_32f, frameSizeDec);
	
Ipp32s *histogram = ippsMalloc_32s(HIST_BINS);
ippsSet_32s(&lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;, histogram, HIST_BINS);
Ipp32f *binEdges = ippsMalloc_32f(HIST_BINS + &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;);
ippsVectorRamp_32f(binEdges, HIST_BINS + &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(128, 0, 128);"&gt;0.0&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(128, 0, 128);"&gt;1.0&lt;/SPAN&gt; / (Ipp32f)HIST_BINS);
ippiHistogramRange_32f_C1R(magnitude, step1_32f, frameSizeDec, histogram, binEdges, HIST_BINS + &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;);
cumSum = &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;;
	
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;/SPAN&gt;
&lt;B&gt;for&lt;/B&gt; (i = &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;; i &amp;lt; HIST_BINS; i++)
{
	cumSum += (*(histogram + i));
	&lt;B&gt;if&lt;/B&gt; (cumSum &amp;gt; (Ipp32s)(&lt;SPAN style="color: rgb(128, 0, 128);"&gt;0.7&lt;/SPAN&gt; * frameSizeDec.width * frameSizeDec.height)) &lt;B&gt;break&lt;/B&gt;;
}
	
highThresh = (Ipp32f)(i + &lt;SPAN style="color: rgb(0, 0, 255);"&gt;2&lt;/SPAN&gt;) / (Ipp32f)HIST_BINS;
lowThresh = &lt;SPAN style="color: rgb(128, 0, 128);"&gt;0.7&lt;/SPAN&gt; * highThresh;
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;&lt;/I&gt;&lt;/SPAN&gt;cout &amp;lt;&amp;lt; &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Canny: lowThresh = "&lt;/SPAN&gt; &amp;lt;&amp;lt; lowThresh &amp;lt;&amp;lt; &lt;SPAN style="color: rgb(221, 0, 0);"&gt;", highThresh = "&lt;/SPAN&gt; &amp;lt;&amp;lt; highThresh &amp;lt;&amp;lt; endl;
	
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Step 4: Now call the actual Canny function&lt;/I&gt;&lt;/SPAN&gt;
ippiCannyGetSize(frameSizeDec, &amp;amp;cannyBufferSize);
Ipp8u *cannyBuffer = ippsMalloc_8u(cannyBufferSize);
Ipp8u *buff = ippiMalloc_8u_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_8u);&lt;BR /&gt;ippiCanny_32f8u_C1R(horizSobel, step1_32f, vertSobel, step1_32f, edges, step1_8u, frameSizeDec, lowThresh, highThresh, cannyBuffer);&lt;FONT color="#000000"&gt;&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;My input is the grayFrameFloat buffer and the edges buffer is globally defined outside of this function. I
have tried using the ippiCanny_32f8u and the ippiCanny_16s8u versions
(with corresponding changes in the code of course) and I get the same
result, which is a whole lot of edges where there should be none.
Specifically, I get edges in the areas where the magnitude of
horizSobel and vertSobel (viewed together as a complex buffer) is more
than highThresh (as I should), but also many many more edges where the
magnitude is less than lowThresh (which is ridiculous as the Canny
algorithm should discard such regions immediately). I would like to
show you an example outcome of the above code to further illustrate my
problem but I don't know how to post an image (if that's even possible
in this forum).&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;Can anybody help me?&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;Andreas.&lt;BR /&gt;
&lt;/P&gt;
&lt;PRE&gt;&lt;BR /&gt;&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 22:16:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917314#M15284</guid>
      <dc:creator>eren</dc:creator>
      <dc:date>2006-07-11T22:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: ippiCanny does not work?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917315#M15285</link>
      <description>&lt;P&gt;&lt;FONT face="Arial"&gt;Hi Andreas,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;Could you provide one runnable test code for us? That will help us to investigate the problem more quickly.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;Chao&lt;/FONT&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2006 23:17:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917315#M15285</guid>
      <dc:creator>Chao_Y_Intel</dc:creator>
      <dc:date>2006-07-11T23:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: ippiCanny does not work?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917316#M15286</link>
      <description>Um, are you talking about an executable? Or do you need some values for the parameters I use, such as frameSizeDec etc?&lt;BR /&gt;&lt;BR /&gt;Andreas.&lt;BR /&gt;&lt;BR /&gt;P.S. I forgot to mention in my original post that the values of lowThresh and highThresh that I give to ippiCanny don't seem to have any effect (which I think they should), except for when lowThresh &amp;gt; highThresh (in which case I get no edges, and rightfully so).&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 23:39:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917316#M15286</guid>
      <dc:creator>eren</dc:creator>
      <dc:date>2006-07-11T23:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: ippiCanny does not work?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917317#M15287</link>
      <description>I have written a simple program that reads an image from file, resizes
it by a given factor (default is 2), converts it to grayscale and then
feeds it to the Canny edge detector (after computing the Sobel
horizontal and vertical derivatives of course). I am using an image
size of 640x480 (prior to resizing) because that is what the camera I
am working with here returns, but I don't think changing it will affect
things. Apart from IPP functions, I am also using OpenCV 0.96 for
loading and displaying images (using the auxilliary functions
openWindow_8u and openWindow_32f). Here is the code:&lt;BR /&gt;
&lt;BR /&gt;






&lt;PRE&gt;&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#ifdef HAVE_CONFIG_H&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#include &lt;CONFIG.H&gt;&lt;/CONFIG.H&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#endif&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#include "ipp.h"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#include "cv.h"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#include "highgui.h"&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#include &lt;IOSTREAM&gt;&lt;/IOSTREAM&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#include &lt;CSTDLIB&gt;&lt;/CSTDLIB&gt;&lt;/SPAN&gt;

&lt;B&gt;using&lt;/B&gt; &lt;B&gt;namespace&lt;/B&gt; std;

&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Frame decimation factor&lt;/I&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#define FRAME_DEC 2&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Number of histogram bins&lt;/I&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(0, 128, 0);"&gt;#define HIST_BINS 64&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Default and decinated camera frame size&lt;/I&gt;&lt;/SPAN&gt;
IppiSize frameSize = {&lt;SPAN style="color: rgb(0, 0, 255);"&gt;640&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;480&lt;/SPAN&gt;};
IppiSize frameSizeDec = {&lt;SPAN style="color: rgb(0, 0, 255);"&gt;640&lt;/SPAN&gt; / FRAME_DEC, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;480&lt;/SPAN&gt; / FRAME_DEC};

&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Global memory structures&lt;/I&gt;&lt;/SPAN&gt;
Ipp8u *grayFrame;
Ipp8u *edges;

&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Auxilliary functions&lt;/I&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;void&lt;/SPAN&gt; openWindow_8u(Ipp8u *img, IppiSize *size, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; nChannels, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;char&lt;/SPAN&gt; *name, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; wait);
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;void&lt;/SPAN&gt; openWindow_32f(Ipp32f *img, IppiSize *size, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; nChannels, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;char&lt;/SPAN&gt; *name, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; wait);

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; main(&lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; argc, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;char&lt;/SPAN&gt; *argv[])
{
	&lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; step1_8u, step1_8u_dec, step3_8u, step3_8u_dec, step1_32f_dec, horizBufferSize, vertBufferSize, i, cannyBufferSize;
	Ipp32s cumSum;
	Ipp32f max, highThresh, lowThresh;
	
	IplImage *cvImg = cvLoadImage(&lt;SPAN style="color: rgb(221, 0, 0);"&gt;"seq_000000.jpg"&lt;/SPAN&gt;, -&lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;);
	
	Ipp8u *frame = ippiMalloc_8u_C3(frameSize.width, frameSize.height, &amp;amp;step3_8u);
	Ipp8u *frameDec = ippiMalloc_8u_C3(frameSizeDec.width, frameSizeDec.height, &amp;amp;step3_8u_dec);
	grayFrame = ippiMalloc_8u_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_8u_dec);
	edges = ippiMalloc_8u_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_8u_dec);
	
	
IppiRect ROI = {&lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;, frameSize.width, frameSize.height};
	step1_8u = step3_8u / &lt;SPAN style="color: rgb(0, 0, 255);"&gt;3&lt;/SPAN&gt;;
	ippiCopy_8u_C3R((Ipp8u *)(cvImg -&amp;gt; imageData), step3_8u, frame, step3_8u, frameSize);
	ippiResize_8u_C3R(frame, frameSize, step3_8u, ROI, frameDec, step3_8u_dec, frameSizeDec, &lt;SPAN style="color: rgb(128, 0, 128);"&gt;1.0F&lt;/SPAN&gt; / (Ipp32f)FRAME_DEC, &lt;SPAN style="color: rgb(128, 0, 128);"&gt;1.0F&lt;/SPAN&gt; / (Ipp32f)FRAME_DEC, IPPI_INTER_NN);
	ippiRGBToGray_8u_C3C1R(frameDec, step3_8u_dec, grayFrame, step1_8u_dec, frameSizeDec);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Perform Canny edge detection on the grayscale frame&lt;/I&gt;&lt;/SPAN&gt;
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Step 1: Get the buffer sizes for the Sobel operations and setup the corresponding buffers&lt;/I&gt;&lt;/SPAN&gt;
	ippiFilterSobelHorizGetBufferSize_32f_C1R(frameSizeDec, ippMskSize5x5, &amp;amp;horizBufferSize);
	Ipp8u *horizBuffer = ippsMalloc_8u(horizBufferSize);
	ippiFilterSobelVertGetBufferSize_32f_C1R(frameSizeDec, ippMskSize5x5, &amp;amp;vertBufferSize);
	Ipp8u *vertBuffer = ippsMalloc_8u(vertBufferSize);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Step 2: Perform the Sobel filtering in the horizontal and vertical dimensions&lt;/I&gt;&lt;/SPAN&gt;
	Ipp32f *grayFrameFloat = ippiMalloc_32f_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_32f_dec);
	ippiConvert_8u32f_C1R(grayFrame, step1_8u_dec, grayFrameFloat, step1_32f_dec, frameSizeDec);
	ippiDivC_32f_C1IR((Ipp32f)IPP_MAX_8U, grayFrameFloat, step1_32f_dec, frameSizeDec);
	Ipp32f *horizSobel = ippiMalloc_32f_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_32f_dec);
	ippiFilterSobelHorizBorder_32f_C1R(grayFrameFloat, step1_32f_dec, horizSobel, step1_32f_dec, frameSizeDec, ippMskSize5x5, ippBorderRepl, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;, horizBuffer);
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// 	ippiMulC_32f_C1IR(-1.0, horizSobel, step1_32f, frameSizeDec);&lt;/I&gt;&lt;/SPAN&gt;
	Ipp32f *vertSobel = ippiMalloc_32f_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_32f_dec);
	ippiFilterSobelVertBorder_32f_C1R(grayFrameFloat, step1_32f_dec, vertSobel, step1_32f_dec, frameSizeDec, ippMskSize5x5, ippBorderRepl, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;, vertBuffer);
&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// 	ippiMulC_32f_C1IR(-1.0, vertSobel, step1_32f, frameSizeDec);&lt;/I&gt;&lt;/SPAN&gt;
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Step 3: Before running the actual edge detector, create a color histogram of the image to decide on Canny's thresholds&lt;/I&gt;&lt;/SPAN&gt;
	Ipp32f *magnitude = ippiMalloc_32f_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_32f_dec);
	ippsMagnitude_32f(horizSobel, vertSobel, magnitude, step1_8u_dec * frameSizeDec.height);
	
	ippiMax_32f_C1R(magnitude, step1_32f_dec, frameSizeDec, &amp;amp;max);
	&lt;B&gt;if&lt;/B&gt; (max) ippiDivC_32f_C1IR(max, magnitude, step1_32f_dec, frameSizeDec);
	
	Ipp32s *histogram = ippsMalloc_32s(HIST_BINS);
	ippsSet_32s(&lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;, histogram, HIST_BINS);
	Ipp32f *binEdges = ippsMalloc_32f(HIST_BINS + &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;);
	ippsVectorRamp_32f(binEdges, HIST_BINS + &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(128, 0, 128);"&gt;0.0&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(128, 0, 128);"&gt;1.0&lt;/SPAN&gt; / (Ipp32f)HIST_BINS);
	ippiHistogramRange_32f_C1R(magnitude, s
tep1_32f_dec, frameSizeDec, histogram, binEdges, HIST_BINS + &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;);
	cumSum = &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;;
	
	&lt;B&gt;for&lt;/B&gt; (i = &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;; i &amp;lt; HIST_BINS; i++)
	{
		cumSum += (*(histogram + i));
		&lt;B&gt;if&lt;/B&gt; (cumSum &amp;gt; (Ipp32s)(&lt;SPAN style="color: rgb(128, 0, 128);"&gt;0.7&lt;/SPAN&gt; * frameSizeDec.width * frameSizeDec.height)) &lt;B&gt;break&lt;/B&gt;;
	}
	
	highThresh = (Ipp32f)(i + &lt;SPAN style="color: rgb(0, 0, 255);"&gt;2&lt;/SPAN&gt;) / (Ipp32f)HIST_BINS;
	lowThresh = &lt;SPAN style="color: rgb(128, 0, 128);"&gt;0.7&lt;/SPAN&gt; * highThresh;
	cout &amp;lt;&amp;lt; &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Canny: lowThresh = "&lt;/SPAN&gt; &amp;lt;&amp;lt; lowThresh &amp;lt;&amp;lt; &lt;SPAN style="color: rgb(221, 0, 0);"&gt;", highThresh = "&lt;/SPAN&gt; &amp;lt;&amp;lt; highThresh &amp;lt;&amp;lt; endl;
	openWindow_8u(grayFrame, &amp;amp;frameSizeDec, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Grayscale Frame"&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;10&lt;/SPAN&gt;);
	openWindow_32f(grayFrameFloat, &amp;amp;frameSizeDec, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Grayscale Frame (Float)"&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;10&lt;/SPAN&gt;);
	openWindow_32f(magnitude, &amp;amp;frameSizeDec, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Magnitude"&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;10&lt;/SPAN&gt;);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// Step 4: Now call the actual Canny function&lt;/I&gt;&lt;/SPAN&gt;
	ippiCannyGetSize(frameSizeDec, &amp;amp;cannyBufferSize);
	Ipp8u *cannyBuffer = ippsMalloc_8u(cannyBufferSize);
	
	Ipp8u *buff = ippiMalloc_8u_C1(frameSizeDec.width, frameSizeDec.height, &amp;amp;step1_8u_dec);
	ippiCompareC_32f_C1R(magnitude, step1_32f_dec, highThresh, edges, step1_8u_dec, frameSizeDec, ippCmpGreater);
	openWindow_8u(edges, &amp;amp;frameSizeDec, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Magnitude more than highThresh"&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;10&lt;/SPAN&gt;);
	ippiNot_8u_C1R(edges, step1_8u_dec, buff, step1_8u_dec, frameSizeDec);
	
	ippiCompareC_32f_C1R(magnitude, step1_32f_dec, lowThresh, edges, step1_8u_dec, frameSizeDec, ippCmpLess);
	openWindow_8u(edges, &amp;amp;frameSizeDec, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Magnitude less than lowThresh"&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;10&lt;/SPAN&gt;);
	ippiNot_8u_C1IR(edges, step1_8u_dec, frameSizeDec);
	
	ippiAnd_8u_C1IR(edges, step1_8u_dec, buff, step1_8u_dec, frameSizeDec);
	openWindow_8u(buff, &amp;amp;frameSizeDec, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Magnitude between lowThresh and highThresh"&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;10&lt;/SPAN&gt;);
	
	IppStatus status = ippiCanny_32f8u_C1R(vertSobel, step1_32f_dec, horizSobel, step1_32f_dec, edges, step1_8u_dec, frameSizeDec, lowThresh, highThresh, cannyBuffer);
	cout &amp;lt;&amp;lt; &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"Canny status: "&lt;/SPAN&gt; &amp;lt;&amp;lt; status &amp;lt;&amp;lt; endl;
	openWindow_8u(edges, &amp;amp;frameSizeDec, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(221, 0, 0);"&gt;"IPP Canny Edge Detector"&lt;/SPAN&gt;, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;0&lt;/SPAN&gt;);
	
	ippiFree(frame);
	ippiFree(frameDec);
	ippiFree(grayFrame);
	ippiFree(edges);
	ippiFree(grayFrameFloat);
	ippiFree(horizSobel);
	ippiFree(vertSobel);
	ip
piFree(magnitude);
	ippiFree(buff);
	
	ippsFree(horizBuffer);
	ippsFree(vertBuffer);
	ippsFree(histogram);
	ippsFree(binEdges);
	ippsFree(cannyBuffer);
	
	cvReleaseImage(&amp;amp;cvImg);&lt;BR /&gt;	&lt;BR /&gt;	return 0;&lt;BR /&gt;}

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;void&lt;/SPAN&gt; openWindow_8u(Ipp8u *img, IppiSize *size, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; nChannels, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;char&lt;/SPAN&gt; *name, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; wait)
{

	IplImage *cvImg; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// cv image used to display&lt;/I&gt;&lt;/SPAN&gt;
	CvSize sizeCv; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// cv size structure&lt;/I&gt;&lt;/SPAN&gt;
	Ipp8u *tmp; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// IPP temporary image&lt;/I&gt;&lt;/SPAN&gt;
	sizeCv.width = size-&amp;gt;width; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// define size&lt;/I&gt;&lt;/SPAN&gt;
	sizeCv.height = size-&amp;gt;height; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// of the displayed image&lt;/I&gt;&lt;/SPAN&gt;
	&lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; tmpStep;
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// create a cv image to be displayed&lt;/I&gt;&lt;/SPAN&gt;
	cvImg = cvCreateImage(sizeCv, IPL_DEPTH_8U, nChannels);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// create temporary image so that img is unchanged&lt;/I&gt;&lt;/SPAN&gt;
	&lt;B&gt;if&lt;/B&gt; (nChannels == &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;) tmp = ippiMalloc_8u_C1(size -&amp;gt; width, size -&amp;gt; height, &amp;amp;tmpStep);
	&lt;B&gt;else&lt;/B&gt; &lt;B&gt;if&lt;/B&gt; (nChannels == &lt;SPAN style="color: rgb(0, 0, 255);"&gt;3&lt;/SPAN&gt;) tmp = ippiMalloc_8u_C3(size -&amp;gt; width, size -&amp;gt; height, &amp;amp;tmpStep);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// copy img into tmp&lt;/I&gt;&lt;/SPAN&gt;
	&lt;B&gt;if&lt;/B&gt; (nChannels == &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;) ippiCopy_8u_C1R(img, tmpStep, tmp, tmpStep, *size);
	&lt;B&gt;else&lt;/B&gt; &lt;B&gt;if&lt;/B&gt; (nChannels == &lt;SPAN style="color: rgb(0, 0, 255);"&gt;3&lt;/SPAN&gt;) ippiCopy_8u_C3R(img, tmpStep, tmp, tmpStep, *size);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// set cv image to contain tmp&lt;/I&gt;&lt;/SPAN&gt;
	cvSetData(cvImg, (&lt;SPAN style="color: rgb(128, 0, 0);"&gt;void&lt;/SPAN&gt; *)tmp, tmpStep);
	cvNamedWindow(name, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;); &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// create window&lt;/I&gt;&lt;/SPAN&gt;
	cvShowImage(name, cvImg); &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// displays cv image&lt;/I&gt;&lt;/SPAN&gt;
	cvWaitKey(wait); &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// wait for key (==0) or wait milliseconds&lt;/I&gt;&lt;/SPAN&gt;
	
	ippiFree(tmp);
	cvReleaseImageHeader(&amp;amp;cvImg);
}

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;void&lt;/SPAN&gt; openWindow_32f(Ipp32f *img, IppiSize *size, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; nChannels, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;char&lt;/SPAN&gt; *name, &lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; wait)
{

	IplImage *cvImg; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// cv image used to display&lt;/I&gt;&lt;/SPAN&gt;
	CvSize sizeCv; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// cv size structure&lt;/I&gt;&lt;/SPAN&gt;
	Ipp32f *tmp; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// IPP temporary image&lt;/I&gt;&lt;/SPAN&gt;
	sizeCv.width = size-&amp;gt;width; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// define size&lt;/I&gt;&lt;/SPAN&gt;
	sizeCv.height = size-&amp;gt;height; &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// of the displayed image&lt;/I&gt;&lt;/SPAN&gt;
	&lt;SPAN style="color: rgb(128, 0, 0);"&gt;int&lt;/SPAN&gt; tmpStep;
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// create a cv image to be displayed&lt;/I&gt;
	cvImg = cvCreateImage(sizeCv, IPL_DEPTH_32F, nChannels);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// create temporary image so that img is unchanged&lt;/I&gt;&lt;/SPAN&gt;
	&lt;B&gt;if&lt;/B&gt; (nChannels == &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;) tmp = ippiMalloc_32f_C1(size -&amp;gt; width, size -&amp;gt; height, &amp;amp;tmpStep);
	&lt;B&gt;else&lt;/B&gt; &lt;B&gt;if&lt;/B&gt; (nChannels == &lt;SPAN style="color: rgb(0, 0, 255);"&gt;3&lt;/SPAN&gt;) tmp = ippiMalloc_32f_C3(size -&amp;gt; width, size -&amp;gt; height, &amp;amp;tmpStep);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// copy img into tmp&lt;/I&gt;&lt;/SPAN&gt;
	&lt;B&gt;if&lt;/B&gt; (nChannels == &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;) ippiCopy_32f_C1R(img, tmpStep, tmp, tmpStep, *size);
	&lt;B&gt;else&lt;/B&gt; &lt;B&gt;if&lt;/B&gt; (nChannels == &lt;SPAN style="color: rgb(0, 0, 255);"&gt;3&lt;/SPAN&gt;) ippiCopy_32f_C3R(img, tmpStep, tmp, tmpStep, *size);
	
	&lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// set cv image to contain tmp&lt;/I&gt;&lt;/SPAN&gt;
	cvSetData(cvImg, (&lt;SPAN style="color: rgb(128, 0, 0);"&gt;void&lt;/SPAN&gt; *)tmp, tmpStep);
	cvNamedWindow(name, &lt;SPAN style="color: rgb(0, 0, 255);"&gt;1&lt;/SPAN&gt;); &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// create window&lt;/I&gt;&lt;/SPAN&gt;
	cvShowImage(name, cvImg); &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// displays cv image&lt;/I&gt;&lt;/SPAN&gt;
	cvWaitKey(wait); &lt;SPAN style="color: rgb(128, 128, 128);"&gt;&lt;I&gt;// wait for key (==0) or wait milliseconds&lt;/I&gt;&lt;/SPAN&gt;
	
	ippiFree(tmp);
	cvReleaseImageHeader(&amp;amp;cvImg);
}
&lt;/SPAN&gt;&lt;/PRE&gt;I guess this code can run as is by just linking with the
appropriate IPP and OpenCV libraries (you will need ippi, ipps, ippcv,
ippcc, cv, cvaux, cxcore and highgui). Just replace "seq_000000.jpg"
with an image of your own and you should be set...&lt;BR /&gt;
&lt;BR /&gt;
Apart from the final output of ippiCanny, I also display the pixels
whose magnitude is higher than highThresh (which Canny should
immediately accept as edges and as you can see are indeed such), the
pixels whose magnitude is less than lowThresh (which Canny should
immediately reject as edges and as you can see are not edges) and also
those between the two thresholds (which Canny should accept as edges
only if they are connected to a strong edge, i.e. of the first set of
pixels). The end result however considers as edges many of the pixels
whose magnitude is less than lowThresh, and that gives me problems.&lt;BR /&gt;
&lt;BR /&gt;
So, any ideas?&lt;BR /&gt;
&lt;BR /&gt;
Andreas.&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Jul 2006 15:39:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917317#M15287</guid>
      <dc:creator>eren</dc:creator>
      <dc:date>2006-07-12T15:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: ippiCanny does not work?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917318#M15288</link>
      <description>&lt;P&gt;Hi Andreas, &lt;/P&gt;
&lt;P&gt;in this sample is betterto use ippiFilterSobelNegVertBorder_32f_C1R instead of ippiFilterSobelVertBorder_32f_C1R.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2006 20:29:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917318#M15288</guid>
      <dc:creator>mlotkov</dc:creator>
      <dc:date>2006-08-02T20:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: ippiCanny does not work?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917319#M15289</link>
      <description>Hi Michael,&lt;BR /&gt;&lt;BR /&gt;I tried out your suggestion, as well as mupltiplied the output of the Sobel filtering by -1, as was pointed out in another thread, both to no avail. So I am now using a Laplacian of Gaussian (LoG) filter for the edge detector based on MATLAB's correspondning function, and everything works out fine. I will try it out again when I install IPP 5.1 in case there was some kind of bug in version 5.0.&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply anyways,&lt;BR /&gt;Andreas.&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Aug 2006 15:39:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917319#M15289</guid>
      <dc:creator>eren</dc:creator>
      <dc:date>2006-08-04T15:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: ippiCanny does not work?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917320#M15290</link>
      <description>&lt;P&gt;Hi, Andreas,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Have you negated Vert Sobel only or both Sobels? May be the reason is in thresholds. Could you send the final example with the image where Canny does not work? It could help us to enhance the description of this function and provide some recommendations.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Alexander&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2006 16:19:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiCanny-does-not-work/m-p/917320#M15290</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2006-08-22T16:19:20Z</dc:date>
    </item>
  </channel>
</rss>

