PPaste!

Descriptor

Home - All the pastes - Authored by Thooms

Raw version

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
desc_names = open('./VOC2007/ImageSets/Main/train.txt', 'r')
name_list = np.array(list(csv.reader(desc_names, delimiter=' ')), dtype = str) 

name_list = name_list[:1000]
descriptor_list = np.zeros((1000,500,200))


inc = 0
for i in name_list:
    filename = os.path.join('./VOC2007/JPEGImages/', str(i).strip("['").strip("']")+'.jpg')
    image = io.imread(filename)
    imageGrey = color.rgb2gray(image)
    
    featureImage = feature.daisy(imageGrey, visualize=False, step=15)
    featureImage = featureImage.reshape((featureImage.shape[0]*featureImage.shape[1], featureImage.shape[2]))
    n = min(featureImage.shape[0], 500)
    descriptor_list[inc,:n] = featureImage[:n,:]

    inc+=1
    if(inc%20==0):
         print inc


descriptor_list = np.save('descriptor_list')