Posted By:
dipankar_datta
Posted On:
Monday, March 13, 2006 04:41 PM
hi all I am working on a project where I have to crawl through millions of images in hard disc & classify them basing on some algoritms. Lets say directory structure where images are kept are as follows : -root - dirA | dirB-dirD | dirE of course, in reality there can be n number of subdirectories from root. Each of these subdirectories stores thousands of images. Given root folder my code tries to extract the directory structure (requirement for classification algo). Problem is, to find all directories, it actually calls isDirectory() on each of the files (image+subdi
More>>
hi all
I am working on a project where I have to crawl through millions of images in hard disc & classify them basing on some algoritms.
Lets say directory structure where images are kept are as follows :
-root - dirA
|
dirB-dirD
|
dirE
of course, in reality there can be n number of subdirectories from root.
Each of these subdirectories stores thousands of images. Given root folder my code tries to extract the directory structure (requirement for classification algo).
Problem is, to find all directories, it actually calls isDirectory() on each of the files (image+subdirectories). Given huge no of files present, even to get 15-20 subdirectories it's taking excessive time.
I was actually using Apache FileUtils & IOUtils to do this.. but internally they calls isDirectory() on each file anyway. I discarded them & want to go ahead with my optimized code ...but I can't think of any solution.
If anybody has a better idea, plz help.
<<Less