This class is used to generate proposals for filter settings. More...
Public Member Functions | |
def | __init__ |
constructor method | |
def | choose_parameters |
Choose the parameters where self.images is used as information database. | |
def | load_file |
Load the image information database form it's default path. | |
Public Attributes | |
bridge | |
cv_bridge used to convert images | |
images | |
a list of images - type is similar to the return value of face_contour_detector.image_information.sql_database.SQLImageDatabase.get_images() | |
Private Member Functions | |
def | _entry_key_func |
Internal method that is not really important to understand. | |
def | _img_parameter_key |
Internal method that is not really important to understand. | |
def | _parameter_key |
Internal method that is not really important to understand. |
This class is used to generate proposals for filter settings.
A face_contour_detector.image_information.sql_database.SQLImageDatabase is used to store information about some images. From this values proposals are calculated using the users raiting.
Definition at line 25 of file auto_selector.py.
def face_contour_detector.learing.auto_selector.AutoSelector.__init__ | ( | self, | |
bridge = None |
|||
) |
constructor method
self | the object pointe |
bridge | a cv_bridge. If you already have a bridge this bridge will be used here. Otherwise a new cv_bridge is created |
Definition at line 29 of file auto_selector.py.
def face_contour_detector.learing.auto_selector.AutoSelector._entry_key_func | ( | self, | |
entry | |||
) | [private] |
Internal method that is not really important to understand.
Definition at line 156 of file auto_selector.py.
def face_contour_detector.learing.auto_selector.AutoSelector._img_parameter_key | ( | self, | |
area_name | |||
) | [private] |
Internal method that is not really important to understand.
Definition at line 144 of file auto_selector.py.
def face_contour_detector.learing.auto_selector.AutoSelector._parameter_key | ( | self, | |
params | |||
) | [private] |
Internal method that is not really important to understand.
Definition at line 148 of file auto_selector.py.
def face_contour_detector.learing.auto_selector.AutoSelector.choose_parameters | ( | self, | |
img, | |||
mask | |||
) |
Choose the parameters where self.images is used as information database.
self | the object pointer |
img | sensor_msgs/Image the image to choose the parameter for. The image must be an colored face image (RGB) where all pixels that are not on the mask are set to white. |
mask | sensor_msgs/Image the mask to calculate the face areas from. |
The database stores the average brightness of images and the standard deviation of the brightness. We assume that these values correlate with the filter settings. We think that these values are the most important for the parameter settings. We first just find images in the database that are "similar" to img. Brightness and standard deviation of the brightness are used as distance measure. We have a fixed set of possible value combinations (returned by the function face_contour_detector.learing.auto_selector._get_parameter_combinations()). Now we find for each of the face areas the best under those combinations. To do this we check all combinations for this area: Now we find under the similar images those that have "similar" filter settings for this area, according to the curren combination. We then calculate the average raiting of that images. After everything is done we choose the combination with the best average raiting. This image gives an overview:
If the database is empty an exception is thrown.
Definition at line 73 of file auto_selector.py.
Load the image information database form it's default path.
self the object pointer
Try to load the database from its default path. The images
field is set to the value returned by face_contour_detector.image_information.sql_database.SQLImageDatabase.get_images(). If opening the database fails images is set to an empty list.
Definition at line 48 of file auto_selector.py.
cv_bridge used to convert images
Definition at line 29 of file auto_selector.py.
a list of images - type is similar to the return value of face_contour_detector.image_information.sql_database.SQLImageDatabase.get_images()
Definition at line 29 of file auto_selector.py.