title: OpenCV Edge/Border detection based on color
body: <p>I'm fairly new to OpenCV, and very excited to learn more. I've been toying with the idea of outlining edges, shapes.</p>
  
  <p>I've come across this code (running on an iOS device), which uses Canny. I'd like to be able to render this in color, and circle each shape. Can someone point me in the right direction?</p>
  
  <p>Thanks!</p>
  
  <pre><code>IplImage *grayImage = cvCreateImage(cvGetSize(iplImage), IPL_DEPTH_8U, 1);
  cvCvtColor(iplImage, grayImage, CV_BGRA2GRAY);
  cvReleaseImage(&amp;iplImage);
  
  IplImage* img_blur = cvCreateImage( cvGetSize( grayImage ), grayImage-&gt;depth, 1);
  cvSmooth(grayImage, img_blur, CV_BLUR, 3, 0, 0, 0);
  cvReleaseImage(&amp;grayImage);
  
  IplImage* img_canny = cvCreateImage( cvGetSize( img_blur ), img_blur-&gt;depth, 1);
  cvCanny( img_blur, img_canny, 10, 100, 3 );
  cvReleaseImage(&amp;img_blur);
  
  cvNot(img_canny, img_canny);
  </code></pre>
  
  <p>And example might be these burger patties. OpenCV would detect the patty, and outline it.<img src="https://i.stack.imgur.com/PTGmU.jpg" alt="enter image description here"></p>
  
  <p>Original Image:</p>
  
  <p><img src="https://i.stack.imgur.com/hnGQR.jpg" alt="enter image description here"></p>