Not able to create separate image for each input image.
I'm able to achieve the desired result of converting every image into black & green but output is over writing the same file instead of creating a separate file for each corresponding image
from glob import glob
for fn in glob('camera/*.jpg'):
img = cv2.imread(fn)
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
mask = cv2.inRange(hsv, (50, 50, 50), (70, 255,255))
imask = mask>0
green = np.zeros_like(img, np.uint8)
green[imask] = img[imask]
cv2.imwrite("*.jpg", green)
ch = cv2.waitKey()
if ch == 100:
break
cv2.destroyAllWindows()
I don't understand :
*.jpg is forbidden on windows and linux?
cv2.waitKey() without an imshow does not work
You must process string fn to give a good name for your file :