Package isnLib :: Package img :: Module Img_DB :: Class ImgDB
[show private | hide private]
[frames | no frames]

Class ImgDB

Known Subclasses:
ShelfDB

this is the generic class for image db implementations
Method Summary
  __init__(self, env)
  addDir(self, dirn, recurse, callback)
this function should be called by UI to add files.
  addFiles(self, files, status, callback)
this function is called recusively through reactor.callLater status is a list of values to be passed through calls: [number_of_added, number_of_rejected] files is the list of files that still has to be added
  addImg(self, newid, fname)
add image to database.
  calcSig(self, img)
  delDir(self, dirId)
  delImg(self, id)
  generateImageID(self)
need to return something unique
  getImgCount(self)
  getImgData(self, fname)
returns image data Currently called by subclassed getImgData and getThumbImgData
  getImgDBStatus(self)
  getSig(self, id)
  getThumbName(self, fname)
return the thumbnail full path for the image given by fname (fname is full path)
  open(self)
init c++ module db
  queryId(self, id, numres)
list querySig(self, sig, numres, thres)
query for similar images.
  shutdown(self)
  sync(self, reopen, noisy)
reopen parm is currently ignored

Method Details

addDir(self, dirn, recurse=0, callback=[])

this function should be called by UI to add files.

addFiles(self, files, status, callback)

this function is called recusively through reactor.callLater status is a list of values to be passed through calls: [number_of_added, number_of_rejected] files is the list of files that still has to be added

status parm format: [0-error sum 1-added id list]

addImg(self, newid, fname)

add image to database. This will basically involve a call to the C++ module

returns thumbnail path on success, None on error

generateImageID(self)

need to return something unique

getImgData(self, fname)

returns image data Currently called by subclassed getImgData and getThumbImgData

getThumbName(self, fname)

return the thumbnail full path for the image given by fname (fname is full path)

open(self)

init c++ module db

querySig(self, sig, numres=20, thres=999999)

query for similar images. Source is a db image
Parameters:
numres - maximum number of results
Returns:
list of similar images. List of pairs [result id,result score] Score is 0-100
           (type=list)

sync(self, reopen=1, noisy=1)

reopen parm is currently ignored

Generated by Epydoc 2.0 on Thu Dec 25 10:59:57 2003 http://epydoc.sf.net