You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def add_to_index(self,imname,descr):
""" Take an image with feature descriptors,
project on vocabulary and add to database. """
if self.is_indexed(imname): return print ’indexing’, imname
self.con.execute("insert into imwords(imid,wordid,vocname)")
In the imwords table, we want to see for a given visual word, which of the images are related to the visual word, so we should insert the (imid,word index) if its word number is non-zero, why do we insert the word number itself? the word number can be the index for one word??
The text was updated successfully, but these errors were encountered:
def add_to_index(self,imname,descr):
""" Take an image with feature descriptors,
project on vocabulary and add to database. """
if self.is_indexed(imname): return print ’indexing’, imname
get the imid
imid = self.get_id(imname)
get the words
imwords = self.voc.project(descr)
nbr_words = imwords.shape[0]
link each word to image
for i in range(nbr_words):
word = imwords[i]
wordid is the word number itself self.con.execute("insert into imwords(imid,wordid,vocname)
store word histogram for image
use pickle to encode NumPy arrays as strings self.con.execute("insert into imhistograms(imid,histogram,vocname)
values (?,?,?)", (imid,pickle.dumps(imwords),self.voc.name))
For the following code:
wordid is the word number itself
self.con.execute("insert into imwords(imid,wordid,vocname)")
In the imwords table, we want to see for a given visual word, which of the images are related to the visual word, so we should insert the (imid,word index) if its word number is non-zero, why do we insert the word number itself? the word number can be the index for one word??
The text was updated successfully, but these errors were encountered: