image scaling in loop using python OpenCV
<p>I am new to Python and I am having a really hard time figuring out how to transform what I got here into a loop. As you can see here I am doing a basic image scaling to 3 different images (from mask_0001.png to mask_0003.png), but I will have more than 100 to go later on, so I will have to do it in a loop I guess. (from 0004.png to 0150.png )</p>

<p>Here is the code I just wrote:</p>

<pre><code>import cv2
import numpy as np

img = cv2.imread("C://Users//user//Desktop//research//images//Mask//set1//set1_mask_0001.png")
res = cv2.resize(img,None,fx=0.5, fy=0.5, interpolation = cv2.INTER_CUBIC)
cv2.imwrite('0.25_mask_set1_0001.png', res)


img = cv2.imread("C://Users//user//Desktop//research//images//Mask//set1//set1_mask_0002.png")
res = cv2.resize(img,None,fx=0.5, fy=0.5, interpolation = cv2.INTER_CUBIC)
cv2.imwrite('0.25_mask_set1_0002.png', res)


img = cv2.imread("C://Users//user//Desktop//research//images//Mask//set1//set1_mask_0003.png")
res = cv2.resize(img,None,fx=0.5, fy=0.5, interpolation = cv2.INTER_CUBIC)
cv2.imwrite('0.25_mask_set1_0003.png', res) 
</code></pre>

<p>Thanks!</p>