visual_database Class Reference
[Visual objects retrieval]

A database of visual objects. More...

#include <visual_database.h>

Inheritance diagram for visual_database:

Inheritance graph
[legend]
Collaboration diagram for visual_database:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 visual_database (id_cluster_collection::query_flags flags)
virtual ~visual_database ()
bool open (const char *fn)
 Reads or create a sqlite3 database file for visual objects.
bool connect_to_db (sqlite3 *sql3db)
 Connects to an already opened sqlite3 database.
visual_objectcreate_object (const char *comment=0, int flags=0)
 Creates a new visual_object.
void add_to_index (visual_object *o)
bool remove_object (visual_object *o)
img_id add_image (IplImage *im)
 Stores an image in the database.
IplImage * get_image (img_id im_id)
 Fetches an image from the database.
visual_objectquery_frame (pyr_frame *frame, float *score=0)
incremental_querycreate_incremental_query ()
void start_update ()
void finish_update ()
sqlite3 * get_sqlite3_db ()

Protected Types

typedef std::map< img_id,
IplImage * > 
image_cache_map
typedef std::map< const char
*, sqlite3_stmt * > 
stmt_cache_map

Protected Member Functions

sqlite3_stmt * get_cached_stmt (const char *query, bool verbose=true)
bool exec_sql (const char *query)

Protected Attributes

sqlite3 * db
image_cache_map image_cache
stmt_cache_map stmt_cache

Friends

class visual_object


Detailed Description

A database of visual objects.

The database must

Definition at line 139 of file visual_database.h.


Member Typedef Documentation

typedef std::map<img_id, IplImage *> visual_database::image_cache_map [protected]

Definition at line 190 of file visual_database.h.

typedef std::map<const char *, sqlite3_stmt *> visual_database::stmt_cache_map [protected]

Definition at line 193 of file visual_database.h.


Constructor & Destructor Documentation

visual_database::visual_database ( id_cluster_collection::query_flags  flags  ) 

Definition at line 176 of file visual_database.cpp.

visual_database::~visual_database (  )  [virtual]

Definition at line 180 of file visual_database.cpp.

References db, image_cache, and stmt_cache.


Member Function Documentation

img_id visual_database::add_image ( IplImage *  im  ) 

Stores an image in the database.

Definition at line 305 of file visual_database.cpp.

References db, get_cached_stmt(), and image_cache.

Referenced by visual_object::add_frame().

void visual_database::add_to_index ( visual_object o  )  [inline]

Definition at line 163 of file visual_database.h.

References id_cluster_collection::add_cluster().

Referenced by connect_to_db().

bool visual_database::connect_to_db ( sqlite3 *  sql3db  ) 

incremental_query* visual_database::create_incremental_query (  )  [inline]

visual_object * visual_database::create_object ( const char *  comment = 0,
int  flags = 0 
)

Creates a new visual_object.

The object is in the database, but not in the index. No query will find it until add_to_index() is called.

Definition at line 375 of file visual_database.cpp.

References db, get_cached_stmt(), id_cluster_collection::version, and visual_object.

bool visual_database::exec_sql ( const char *  query  )  [protected]

Definition at line 466 of file visual_database.cpp.

References db, and get_cached_stmt().

Referenced by visual_object::add_frame(), finish_update(), remove_object(), and start_update().

void visual_database::finish_update (  )  [inline]

Definition at line 181 of file visual_database.h.

References exec_sql().

Referenced by vobj_tracker::incremental_learning().

sqlite3_stmt * visual_database::get_cached_stmt ( const char *  query,
bool  verbose = true 
) [protected]

IplImage * visual_database::get_image ( img_id  im_id  ) 

Fetches an image from the database.

It also caches the image, so that subsequent fetching of the same image is very fast.

Definition at line 333 of file visual_database.cpp.

References db, get_cached_stmt(), and image_cache.

sqlite3* visual_database::get_sqlite3_db (  )  [inline]

Definition at line 183 of file visual_database.h.

References db.

bool visual_database::open ( const char *  fn  ) 

Reads or create a sqlite3 database file for visual objects.

Calling this method is required. If the file does not exists, it is created. If the file exists, the method indexes every entry in it. After a successfull call to open(), query_frame or create_incremental_query() are ready to be called.

Definition at line 191 of file visual_database.cpp.

References connect_to_db().

visual_object* visual_database::query_frame ( pyr_frame frame,
float *  score = 0 
)

bool visual_database::remove_object ( visual_object o  ) 

void visual_database::start_update (  )  [inline]

Definition at line 180 of file visual_database.h.

References exec_sql().

Referenced by vobj_tracker::incremental_learning().


Friends And Related Function Documentation

friend class visual_object [friend]

Definition at line 196 of file visual_database.h.

Referenced by connect_to_db(), and create_object().


Member Data Documentation

sqlite3* visual_database::db [protected]

Definition at line 191 of file visual_database.h.

Referenced by add_image(), get_image(), and ~visual_database().

Definition at line 194 of file visual_database.h.

Referenced by get_cached_stmt(), and ~visual_database().


The documentation for this class was generated from the following files:

Generated on Tue Mar 30 15:53:26 2010 for Polyora by  doxygen 1.5.9