I have this code which show me all the .tif files in a folder I give.
timestr = datetime.now().strftime('%Y%m%d-%H%M%S%f')
ex_area_files = []
tif_files = glob.glob('C:\\Users\\Bob\\Desktop\\Folder\\' + str(timestr) + '\\EXTRACTED\\*.tif')
ex_area_files = [tif_files]
print(ex_area_files)
How can I move some specified ones (to another folder) ? I mean, I want to move all the .tif files which result of width*height is less/more than a certain value.
What I tried was to loop through the array and, after set the codition, move the files. All the result was a loop fail which blocked all the system :)
It follows...
image = cv2.imread('image.jpg')
height = np.size(image, 0)
width = np.size(image, 1)
condition = (height*width) > 9600
How can I also set ex_area_files
(my .tif array) as directory of files from which cv2 can read ? And, more imporant, how to set a file at once ?
The files which satisfy the condition (images with values of 320*30px) should be moved to another directory. How to do it after the program decided that the file is ok to be moved ?
Thanks
Tip: this is a next step after this other piece of code: Exclude images of certain dimensions from process (OpenCV, Python)
In this case, take a look at ex_area14.png
. I want to move a series of files like that (but in .tif format..)