bazar
1.3.1
|
An affine image generator. More...
#include <affine_image_generator.h>
Public Member Functions | |
affine_image_generator (void) | |
virtual | ~affine_image_generator (void) |
void | set_original_image (IplImage *original_image, int _u_corner1=-1, int _v_corner1=-1, int _u_corner2=-1, int _v_corner2=-1, int _u_corner3=-1, int _v_corner3=-1, int _u_corner4=-1, int _v_corner4=-1, int affine_image_width=-1, int affine_image_height=-1) |
void | set_preprocessed_image (IplImage *preprocessed) |
void | set_object_keypoints (object_keypoint *keypoint_array, int point_number) |
void | reset_keypoints (void) |
void | add_keypoint (float u, float v, int scale, int class_index) |
void | generate_affine_image (void) |
void | generate_object_view (void) |
void | set_noise_level (int p_noise_level) |
Default = 20. | |
void | set_level_number (int p_level_number) |
Default = 3. | |
void | set_patch_size (int p_patch_size) |
Default = 32. | |
void | set_use_random_background (bool p_use_random_background) |
Default = false;. | |
void | set_range_variation_for_theta (float min_theta, float max_theta) |
Global rotation. Default = [0 : 2Pi]. | |
void | set_range_variation_for_phi (float min_phi, float max_phi) |
Skew. Default = [0 : Pi]. | |
void | independent_scaling (float min_lambda1, float max_lambda1, float min_lambda2, float max_lambda2) |
Default method. Between 0.5 : 1.5 for both. | |
void | constrained_scaling (float min_lambda1, float max_lambda1, float min_lambda2, float max_lambda2, float min_l1_l2, float max_l1_l2) |
Constrained scaling. Adds a constraint on the range of the product of l1 and l2. | |
void | set_use_orientation_correction (bool p_use_orientation_correction) |
Default true. | |
void | set_add_gaussian_smoothing (bool p_add_gaussian_smoothing) |
Default false. | |
void | set_change_intensities (bool p_change_intensities) |
Default false. | |
void | set_gaussian_smoothing_kernel_size (int p_gaussian_smoothing_kernel_size) |
void | generate_random_affine_transformation (void) |
void | generate_Id_affine_transformation (void) |
void | set_roi (int _u_corner1, int _v_corner1, int _u_corner2, int _v_corner2, int _u_corner3, int _v_corner3, int _u_corner4, int _v_corner4) |
bool | inside_roi (int u, int v) |
void | set_default_values (void) |
vector< image_class_example * > * | generate_random_examples (void) |
void | release_examples (void) |
void | affine_transformation (float u, float v, float &nu, float &nv) |
void | inverse_affine_transformation (float u, float v, float &nu, float &nv) |
void | preprocess_point_view (image_class_example *pv, object_view *ov) |
void | add_white_noise (IplImage *image) |
void | replace_by_noise (IplImage *image, int value) |
Public Member Functions inherited from example_generator | |
example_generator (void) | |
virtual | ~example_generator () |
Static Public Member Functions | |
static void | affine_transformation (float a[6], int width, int height, float u, float v, float &nu, float &nv) |
static void | inverse_affine_transformation (float a[6], int width, int height, float u, float v, float &nu, float &nv) |
Public Attributes | |
char * | white_noise |
char * | limited_white_noise |
int | index_white_noise |
IplImage * | original_image |
IplImage * | processed_original_image |
IplImage * | affine_image |
float | a [6] |
object_view * | smoothed_generated_object_view |
vector< object_view * > | generated_object_views_for_learning |
vector< image_class_example * > | point_views |
object_keypoint * | used_keypoint_array |
object_keypoint * | local_keypoint_array |
int | point_number |
keypoint_orientation_corrector * | orientation_corrector |
bool | use_orientation_correction |
bool | use_random_background |
bool | add_gaussian_smoothing |
bool | change_intensities |
int | noise_level |
int | gaussian_smoothing_kernel_size |
int | patch_size |
int | level_number |
float | localization_noise |
float | min_theta |
float | max_theta |
float | min_phi |
float | max_phi |
int | scaling_method |
float | min_lambda1 |
float | max_lambda1 |
float | min_lambda2 |
float | max_lambda2 |
float | min_l1_l2 |
float | max_l1_l2 |
int | u_corner1 |
int | v_corner1 |
int | u_corner2 |
int | v_corner2 |
int | u_corner3 |
int | v_corner3 |
int | u_corner4 |
int | v_corner4 |
An affine image generator.
Definition at line 32 of file affine_image_generator.h.
affine_image_generator::affine_image_generator | ( | void | ) |
Definition at line 33 of file affine_image_generator.cpp.
References prime.
|
virtual |
Definition at line 49 of file affine_image_generator.cpp.
void affine_image_generator::add_keypoint | ( | float | u, |
float | v, | ||
int | scale, | ||
int | class_index | ||
) |
Definition at line 179 of file affine_image_generator.cpp.
void affine_image_generator::add_white_noise | ( | IplImage * | image | ) |
Definition at line 452 of file affine_image_generator.cpp.
void affine_image_generator::affine_transformation | ( | float | u, |
float | v, | ||
float & | nu, | ||
float & | nv | ||
) |
Definition at line 415 of file affine_image_generator.cpp.
|
static |
Definition at line 397 of file affine_image_generator.cpp.
void affine_image_generator::constrained_scaling | ( | float | min_lambda1, |
float | max_lambda1, | ||
float | min_lambda2, | ||
float | max_lambda2, | ||
float | min_l1_l2, | ||
float | max_l1_l2 | ||
) |
Constrained scaling. Adds a constraint on the range of the product of l1 and l2.
Definition at line 315 of file affine_image_generator.cpp.
void affine_image_generator::generate_affine_image | ( | void | ) |
Definition at line 493 of file affine_image_generator.cpp.
References mcvReplace(), mcvSaveImage(), and rand().
void affine_image_generator::generate_Id_affine_transformation | ( | void | ) |
Definition at line 385 of file affine_image_generator.cpp.
References mcvComputeAffineTransfo().
void affine_image_generator::generate_object_view | ( | void | ) |
Definition at line 540 of file affine_image_generator.cpp.
void affine_image_generator::generate_random_affine_transformation | ( | void | ) |
Definition at line 332 of file affine_image_generator.cpp.
References max4(), mcvComputeAffineTransfo(), min4(), rand(), and rand_01().
|
virtual |
Reimplemented from example_generator.
Definition at line 547 of file affine_image_generator.cpp.
References object_keypoint::class_index, PyrImage::convCoordf(), object_keypoint::M, image_class_example::orig_u, image_class_example::orig_v, rand_m1p1(), and object_keypoint::scale.
void affine_image_generator::independent_scaling | ( | float | min_lambda1, |
float | max_lambda1, | ||
float | min_lambda2, | ||
float | max_lambda2 | ||
) |
Default method. Between 0.5 : 1.5 for both.
Definition at line 302 of file affine_image_generator.cpp.
bool affine_image_generator::inside_roi | ( | int | u, |
int | v | ||
) |
Definition at line 274 of file affine_image_generator.cpp.
void affine_image_generator::inverse_affine_transformation | ( | float | u, |
float | v, | ||
float & | nu, | ||
float & | nv | ||
) |
Definition at line 420 of file affine_image_generator.cpp.
|
static |
Definition at line 407 of file affine_image_generator.cpp.
void affine_image_generator::preprocess_point_view | ( | image_class_example * | pv, |
object_view * | ov | ||
) |
Definition at line 425 of file affine_image_generator.cpp.
References object_view::gradX, object_view::gradY, object_view::image, mcvGetPatch(), keypoint::orientation_in_radians, image_class_example::point2d, image_class_example::preprocessed, keypoint::scale, keypoint::u, and keypoint::v.
|
virtual |
Reimplemented from example_generator.
Definition at line 588 of file affine_image_generator.cpp.
void affine_image_generator::replace_by_noise | ( | IplImage * | image, |
int | value | ||
) |
Definition at line 477 of file affine_image_generator.cpp.
void affine_image_generator::reset_keypoints | ( | void | ) |
Definition at line 173 of file affine_image_generator.cpp.
|
inline |
Default false.
Definition at line 76 of file affine_image_generator.h.
References add_gaussian_smoothing.
|
inline |
Default false.
Definition at line 79 of file affine_image_generator.h.
References change_intensities.
void affine_image_generator::set_default_values | ( | void | ) |
Definition at line 67 of file affine_image_generator.cpp.
|
inline |
Definition at line 82 of file affine_image_generator.h.
References gaussian_smoothing_kernel_size.
void affine_image_generator::set_level_number | ( | int | p_level_number | ) |
Default = 3.
Definition at line 190 of file affine_image_generator.cpp.
void affine_image_generator::set_noise_level | ( | int | p_noise_level | ) |
Default = 20.
Definition at line 90 of file affine_image_generator.cpp.
void affine_image_generator::set_object_keypoints | ( | object_keypoint * | keypoint_array, |
int | point_number | ||
) |
Definition at line 167 of file affine_image_generator.cpp.
void affine_image_generator::set_original_image | ( | IplImage * | original_image, |
int | _u_corner1 = -1 , |
||
int | _v_corner1 = -1 , |
||
int | _u_corner2 = -1 , |
||
int | _v_corner2 = -1 , |
||
int | _u_corner3 = -1 , |
||
int | _v_corner3 = -1 , |
||
int | _u_corner4 = -1 , |
||
int | _v_corner4 = -1 , |
||
int | affine_image_width = -1 , |
||
int | affine_image_height = -1 |
||
) |
Definition at line 102 of file affine_image_generator.cpp.
void affine_image_generator::set_patch_size | ( | int | p_patch_size | ) |
Default = 32.
Definition at line 207 of file affine_image_generator.cpp.
void affine_image_generator::set_preprocessed_image | ( | IplImage * | preprocessed | ) |
Definition at line 137 of file affine_image_generator.cpp.
void affine_image_generator::set_range_variation_for_phi | ( | float | min_phi, |
float | max_phi | ||
) |
Skew. Default = [0 : Pi].
Definition at line 295 of file affine_image_generator.cpp.
void affine_image_generator::set_range_variation_for_theta | ( | float | min_theta, |
float | max_theta | ||
) |
Global rotation. Default = [0 : 2Pi].
Definition at line 288 of file affine_image_generator.cpp.
void affine_image_generator::set_roi | ( | int | _u_corner1, |
int | _v_corner1, | ||
int | _u_corner2, | ||
int | _v_corner2, | ||
int | _u_corner3, | ||
int | _v_corner3, | ||
int | _u_corner4, | ||
int | _v_corner4 | ||
) |
Definition at line 221 of file affine_image_generator.cpp.
References mcvRow.
|
inline |
Default true.
Definition at line 73 of file affine_image_generator.h.
References use_orientation_correction.
|
inline |
Default = false;.
Definition at line 61 of file affine_image_generator.h.
References use_random_background.
float affine_image_generator::a[6] |
Definition at line 113 of file affine_image_generator.h.
bool affine_image_generator::add_gaussian_smoothing |
Definition at line 127 of file affine_image_generator.h.
Referenced by set_add_gaussian_smoothing().
IplImage* affine_image_generator::affine_image |
Definition at line 112 of file affine_image_generator.h.
bool affine_image_generator::change_intensities |
Definition at line 128 of file affine_image_generator.h.
Referenced by set_change_intensities().
int affine_image_generator::gaussian_smoothing_kernel_size |
Definition at line 131 of file affine_image_generator.h.
Referenced by set_gaussian_smoothing_kernel_size().
vector<object_view *> affine_image_generator::generated_object_views_for_learning |
Definition at line 116 of file affine_image_generator.h.
int affine_image_generator::index_white_noise |
Definition at line 109 of file affine_image_generator.h.
int affine_image_generator::level_number |
Definition at line 132 of file affine_image_generator.h.
char * affine_image_generator::limited_white_noise |
Definition at line 108 of file affine_image_generator.h.
object_keypoint* affine_image_generator::local_keypoint_array |
Definition at line 120 of file affine_image_generator.h.
float affine_image_generator::localization_noise |
Definition at line 133 of file affine_image_generator.h.
float affine_image_generator::max_l1_l2 |
Definition at line 140 of file affine_image_generator.h.
float affine_image_generator::max_lambda1 |
Definition at line 138 of file affine_image_generator.h.
float affine_image_generator::max_lambda2 |
Definition at line 139 of file affine_image_generator.h.
float affine_image_generator::max_phi |
Definition at line 136 of file affine_image_generator.h.
float affine_image_generator::max_theta |
Definition at line 135 of file affine_image_generator.h.
float affine_image_generator::min_l1_l2 |
Definition at line 140 of file affine_image_generator.h.
float affine_image_generator::min_lambda1 |
Definition at line 138 of file affine_image_generator.h.
float affine_image_generator::min_lambda2 |
Definition at line 139 of file affine_image_generator.h.
float affine_image_generator::min_phi |
Definition at line 136 of file affine_image_generator.h.
float affine_image_generator::min_theta |
Definition at line 135 of file affine_image_generator.h.
int affine_image_generator::noise_level |
Definition at line 130 of file affine_image_generator.h.
keypoint_orientation_corrector* affine_image_generator::orientation_corrector |
Definition at line 123 of file affine_image_generator.h.
IplImage* affine_image_generator::original_image |
Definition at line 111 of file affine_image_generator.h.
int affine_image_generator::patch_size |
Definition at line 132 of file affine_image_generator.h.
int affine_image_generator::point_number |
Definition at line 121 of file affine_image_generator.h.
vector<image_class_example *> affine_image_generator::point_views |
Definition at line 117 of file affine_image_generator.h.
IplImage * affine_image_generator::processed_original_image |
Definition at line 111 of file affine_image_generator.h.
int affine_image_generator::scaling_method |
Definition at line 137 of file affine_image_generator.h.
object_view* affine_image_generator::smoothed_generated_object_view |
Definition at line 115 of file affine_image_generator.h.
int affine_image_generator::u_corner1 |
Definition at line 142 of file affine_image_generator.h.
Referenced by CalibModel::buildCached().
int affine_image_generator::u_corner2 |
Definition at line 142 of file affine_image_generator.h.
Referenced by CalibModel::buildCached().
int affine_image_generator::u_corner3 |
Definition at line 142 of file affine_image_generator.h.
Referenced by CalibModel::buildCached().
int affine_image_generator::u_corner4 |
Definition at line 142 of file affine_image_generator.h.
Referenced by CalibModel::buildCached().
bool affine_image_generator::use_orientation_correction |
Definition at line 125 of file affine_image_generator.h.
Referenced by set_use_orientation_correction().
bool affine_image_generator::use_random_background |
Definition at line 126 of file affine_image_generator.h.
Referenced by set_use_random_background().
object_keypoint* affine_image_generator::used_keypoint_array |
Definition at line 119 of file affine_image_generator.h.
int affine_image_generator::v_corner1 |
Definition at line 142 of file affine_image_generator.h.
Referenced by CalibModel::buildCached().
int affine_image_generator::v_corner2 |
Definition at line 142 of file affine_image_generator.h.
Referenced by CalibModel::buildCached().
int affine_image_generator::v_corner3 |
Definition at line 142 of file affine_image_generator.h.
Referenced by CalibModel::buildCached().
int affine_image_generator::v_corner4 |
Definition at line 142 of file affine_image_generator.h.
Referenced by CalibModel::buildCached().
char* affine_image_generator::white_noise |
Definition at line 108 of file affine_image_generator.h.