I have got a code that does motion detection. It takes video as an input and then when an object comes to the scene, background changes and code publishes "object is seen" as text on that detected frame.
My question is that how do I save frames "when objects are seen" into folders( both for colorful and gray images)? I understand that I can write that frames using " cv2.imwrite("frame%d.jpg" % count, resizedFrame)" but unfortunately it does not work.
How do I save those detected frames to "colorful" and "gray" folders?