File size: 1,306 Bytes
ac1c6ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# # import the necessary packages
# from colordescriptor import ColorDescriptor
# import glob
# import cv2


# class Indexer:
#         def __init__(self, indexPath):
#                 # store our index path
#                 self.indexPath = indexPath

#         def index(self):
#                 # initialize the color descriptor
#                 cd = ColorDescriptor((8, 12, 3))

#                 # open the output index file for writing
#                 output = open(self.indexPath, "w")

#                 # use glob to grab the image paths and loop over them
#                 for imagePath in glob.glob("../static/images/" + "/*.png"):
#                         # extract the image ID (i.e. the unique filename) from the image
#                         # path and load the image itself
#                         imageID = imagePath[imagePath.rfind("/") + 1:]
#                         image = cv2.imread(imagePath)
#                         # describe the image
#                         features = cd.describe(image)
#                         # write the features to file
#                         features = [str(f) for f in features]
#                         output.write("%s,%s\n" % (imageID, ",".join(features)))

#                 # close the index file
#                 output.close()