title: advanced usage of matlab roipoly command
body: <p>I am new to matlab and am working on Image processing. I am using the roipoly function to create a mask. As I understand I can use it like this : </p>
  
  <pre><code>I = imread('eight.tif');
  c = [222 272 300 270 221 194];
  r = [21 21 75 121 121 75];
  BW = roipoly(I,c,r);
  figure, imshow(I)
  figure, imshow(BW)
  </code></pre>
  
  <p>The image is shown below : 
  <img src="https://i.imgur.com/QY1CZpD.gif" alt="image1"></p>
  
  <p>One observation I had was that the interpolation between the adjacent points as specified by the c &amp; r matrix is done by 'Linear Interpolation', in other sense always a straight line is drawn between the points. Can it be possible that somehow other types of interpolation are incorporated , like quadratic or cubic spline interpolation ? </p>
  
  <p>Suppose what I really wanted was to do this as shown in the picture below. [Pardon my drawing, its not very good].</p>
  
  <p><img src="https://i.imgur.com/peaYW4U.gif" alt="image2"></p>
  
  <p>Here the circles show the points on the contour. I wanted the figure that is extracted or created to be in the shape as shown by the lines. As you can see it is possible only if we do interpolation by using splines or quadratic equations and not by linear interpolation which is done by roipoly.</p>
  
  <p>How can I do this ? Can you guys help me ? </p>