title: Python - Rotate Image without using the built-in methods for rotation
body: <p>How can I rotate an image in Python with the help of the OpenCV library, and by changing the value of height and width of the image (without using the built-in methods for rotation in OpenCV). It has to implement with two nested loops.</p>
  <pre><code>img=cv2.imread('Images/Screenshot.png',cv2.IMREAD_GRAYSCALE)
  
  height, width = img.shape
  
  # for i in range(0,height):
  #     for j in range(0,width):
  #         img[i][j]=
  
  # show rotated image
  cv2.imshow(&quot;image&quot;,img)
  </code></pre>
  <p>Thanks for your attention!</p>