def locateFiles(sigset,imdir):
    image_map = {}
    file_map = {}
    rec_map = {}

    
    for each in sigset:
        rec_id = each[1][0]['name']
        basename = parseBasename(each[1][0]['file-name'])
        image_map[rec_id] = None
        file_map[basename] = rec_id
        rec_map[rec_id] = basename
        
            
    n_images = 0
    
    for rootdir,_,files in os.walk(imdir):
        for filename in files:
            basename,ext = os.path.splitext(filename)
            if ext.upper() not in IMAGE_EXTENSIONS:
                continue
            print filename
            if file_map.has_key(basename) and image_map[file_map[basename]] == None:
                image_map[file_map[basename]] = os.path.join(rootdir,filename)
                n_images += 1
            elif file_map.has_key(basename) and image_map[file_map[basename]] != None:
                raise ValueError("Multiple images found matching recording id %s:\n   First instance:  %s\n   Second instance: %s"%(file_map[basename],image_map[file_map[basename]],os.path.join(rootdir,filename)))
            if rec_map.has_key(basename) and rec_map[file_map[basename]] == None:
                image_map[file_map[basename]] = os.path.join(rootdir,filename)
                n_images += 1
            elif rec_map.has_key(basename) and image_map[file_map[basename]] != None:
                raise ValueError("Multiple images found matching recording id %s:\n   First instance:  %s\n   Second instance: %s"%(file_map[basename],image_map[file_map[basename]],os.path.join(rootdir,filename)))
                    
                    
    if True: print "Found %d of %d images."%(n_images,len(image_map))
    
    missing = []
    found = []
    for item in sigset:
        rec_id = item[1][0]['name']
        filename = image_map[rec_id]
        if filename == None:
            missing.append(item)
        else:
            found.append(item)
            
    
    return found,missing
This function scans the image directories for the files listed in the
dataset/ETHPy150Open bolme/pyvision/src/pyvision/tools/sigset_remove_missing.py/locateFiles