All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Public Member Functions | Public Attributes | Private Member Functions
face_contour_detector.image_information.sql_database.SQLImageDatabase Class Reference

class that is used to interact with a sqlite database that stores image information. More...

List of all members.

Public Member Functions

def __init__
def add_image
 add information about a new image to the database
def get_images
 returns a list of image information from the database
def load_file
 try to load the sqlite database with the given file name.

Public Attributes

 bridge
 cv_bridge that is used to convert images
 connection
 a sqlite Connection object - the connection to the image database.

Private Member Functions

def _apply_filter
 apply the filters on image and return the result image
def _create_tables
 Create on self.connection the two tables.

Detailed Description

class that is used to interact with a sqlite database that stores image information.

The image information are stored in a sqlite database with two tables: one holding the images itself. For an image we save its brightness, the standard deviation of the brightness and the user raiting. There's also an id field used as primary key. The second tables hold information about image areas. For each area we save the image id this area belongs to, the name of the area and parameter values for the blur and canny filter. The ER-diagram looks like this (not with the exact names as used in the tables):

image_er.png

Definition at line 24 of file sql_database.py.


Constructor & Destructor Documentation

Definition at line 25 of file sql_database.py.


Member Function Documentation

apply the filters on image and return the result image

Definition at line 152 of file sql_database.py.

Create on self.connection the two tables.

Parameters:
selfthe object pointer

Definition at line 72 of file sql_database.py.

add information about a new image to the database

Parameters:
selfthe object pointer
image,:a cvMat (RGB color) the image to store information about
raitingthe raiting of the image (between 1 and 6)
areasthe image areas with their settings

Definition at line 99 of file sql_database.py.

returns a list of image information from the database

Parameters:
selfthe object pointer

The return value is a list of dictionaries. Each dictionary stores data about an image. The keys of the dictionary are: "AveragePixelBrightness" : float, "StandardBrightnessDeviation" : float, "Raiting" : int between 1 and 6, "Areas" : a new dictionary. "Areas" is a dictionary that stores the areas. Each entry of this dictionary is again a dictionary with the filter settings of this area. It's values are: "blurwidth", "blurheight", "threshold1", "threshold2"

Definition at line 165 of file sql_database.py.

try to load the sqlite database with the given file name.

Parameters:
selfthe object pointer
file_namethe file name of the database. If the file_name is None a default path is used as file name. The path is package_dir/data/image_information.db

If file_name does not exists a new database is created on that location. May throw an exception if something went wrong.

Definition at line 43 of file sql_database.py.


Member Data Documentation

cv_bridge that is used to convert images

Definition at line 25 of file sql_database.py.

a sqlite Connection object - the connection to the image database.

Is initially set to None

Definition at line 25 of file sql_database.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


face_contour_detector
Author(s): Fabian Wenzelmann and Julian Schmid
autogenerated on Wed Dec 26 2012 16:18:18