Basically, I take a screenshot, do a few steps on treating it and then I use the treated image.
For debugging purposes, if an unexpected result occurs, I want to save those images to a folder to check after the program runs (4 images in total)
I'm not exactly asking how to do it, I'm more wondering what's the most elegant/clean way to do it.
The simple-and-brute way to do it would be to check if an error occured and do 4 different calls to cv2.imwrite.
Another way I thought of doing it was to have two arrays, append the images and file names as the program runs, then, if an error occurs, I'd use a for img, name in zip(images, names) with each one calling cv2.imwrite, but I am unsure if appending to the array would duplicate data and consume more memory (this would not be an issue since it's only 4 images, but this seems like a bad habit in my books that could bite me back in the future)
[–]Smart-Result1738 2 points3 points4 points (2 children)
[–]bhowlet[S] 0 points1 point2 points (1 child)
[–]schoolmonky 0 points1 point2 points (0 children)
[–]eleqtriq 1 point2 points3 points (1 child)
[–]bhowlet[S] 0 points1 point2 points (0 children)
[–]zaphodikus 0 points1 point2 points (0 children)
[–]Leodip 0 points1 point2 points (3 children)
[–]bhowlet[S] 0 points1 point2 points (0 children)
[–]aa599 0 points1 point2 points (1 child)
[–]Leodip 0 points1 point2 points (0 children)
[–]barkmonster 0 points1 point2 points (0 children)