title: Can the OpenCv circle function be used to draw a circle with an odd diameter?
body: <p>I would like to draw a circle with a diameter of 15 into a matrix of 15 by 15.
  For this I tried the OpenCv circle function and the shift function.</p>
  
  <p>I am not sure whether I use the function in a correct way or wheather it is not possible what I would like to do.</p>
  
  <p>The best I achieve is the following unsymmetric circle with a size of 16 pixels:</p>
  
  <p><a href="https://i.stack.imgur.com/Uk1KV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uk1KV.png" alt="Unsymmetric circle"></a></p>
  
  <p>How can I get a symmetric circle with a diameter of 15 pixels?</p>
  
  <p>The code I used:</p>
  
  <pre><code>    import cv2
      import numpy as np  
  
      circle_diameter = 15
      circular_mask = np.zeros((circle_diameter, circle_diameter, 1), dtype='uint8')
      #Draw circle with subpixel accuracy
      shift = 4
      factor = (1 &lt;&lt; shift)
      cv2.circle(circular_mask, (int(round((circle_diameter/2) * factor)), int(round((circle_diameter/2) * factor))), int(round((circle_diameter/2) * factor)), (255), -1, shift=shift)
  
      circular_mask = cv2.resize(circular_mask,None,fx=5,fy=5)
      cv2.imshow("mask", circular_mask)
  </code></pre>
  
  <p>Thanx</p>