Skip to content

Commit

Permalink
sweeping again to make sure doc is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu committed Dec 21, 2014
1 parent b2fa33e commit adb7156
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 78 deletions.
78 changes: 61 additions & 17 deletions lib/ccv.h
Original file line number Diff line number Diff line change
Expand Up @@ -948,12 +948,12 @@ void ccv_solve(ccv_matrix_t* a, ccv_matrix_t* b, ccv_matrix_t** d, int type);
void ccv_eigen(ccv_dense_matrix_t* a, ccv_dense_matrix_t** vector, ccv_dense_matrix_t** lambda, int type, double epsilon);

typedef struct {
double interp;
double extrap;
int max_iter;
double ratio;
double rho;
double sig;
double interp; /**< Interpolate value. */
double extrap; /**< Extrapolate value. */
int max_iter; /**< Maximum iterations. */
double ratio; /**< Increase ratio. */
double rho; /**< Decrease ratio. */
double sig; /**< Sigma. */
} ccv_minimize_param_t;

extern const ccv_minimize_param_t ccv_minimize_default_params;
Expand Down Expand Up @@ -1342,28 +1342,44 @@ typedef struct {
int scale_invariant; /**< Enable scale invariant swt (to scale to different sizes and then combine the results) */
int direction; /**< SWT direction. (black to white or white to black). */
double same_word_thresh[2]; /**< Overlapping more than 0.1 of the bigger one (0), and 0.9 of the smaller one (1) */
/** Canny parameters */
/**
* @name Canny parameters
* @{
*/
int size; /**< Parameters for [Canny edge detector](/lib/ccv-classic). */
int low_thresh; /**< Parameters for [Canny edge detector](/lib/ccv-classic). */
int high_thresh; /**< Parameters for [Canny edge detector](/lib/ccv-classic). */
/** Geometry filtering parameters */
/** @} */
/**
* @name Geometry filtering parameters
* @{
*/
int max_height; /**< The maximum height for a letter. */
int min_height; /**< The minimum height for a letter. */
int min_area; /**< The minimum occupied area for a letter. */
int letter_occlude_thresh;
double aspect_ratio; /**< The maximum aspect ratio for a letter. */
double std_ratio; /**< The inner-class standard derivation when grouping letters. */
/** Grouping parameters */
/** @} */
/**
* @name Grouping parameters
* @{
*/
double thickness_ratio; /**< The allowable thickness variance when grouping letters. */
double height_ratio; /**< The allowable height variance when grouping letters. */
int intensity_thresh; /**< The allowable intensity variance when grouping letters. */
double distance_ratio; /**< The allowable distance variance when grouping letters. */
double intersect_ratio; /**< The allowable intersect variance when grouping letters. */
double elongate_ratio; /**< The allowable elongate variance when grouping letters. */
int letter_thresh; /**< The allowable letter threshold. */
/** Break textline into words */
/** @} */
/**
* @name Break textline into words
* @{
*/
int breakdown; /**< If breakdown text line into words. */
double breakdown_ratio; /**< Apply [OSTU](/lib/ccv-classic) and if inter-class variance above the threshold, it will be break down into words. */
/** @} */
} ccv_swt_param_t;

extern const ccv_swt_param_t ccv_swt_default_params;
Expand Down Expand Up @@ -1658,30 +1674,53 @@ void ccv_ferns_free(ccv_ferns_t* ferns);
*/

typedef struct {
/** Short-term lucas-kanade tracking parameters */
/**
* @name Short-term lucas-kanade tracking parameters
* @{
*/
ccv_size_t win_size; /**< The window size to compute optical flow. */
int level; /**< Level of image pyramids */
float min_eigen; /**< The minimal eigenvalue for a valid optical flow computation */
float min_forward_backward_error; /**< The minimal forward backward error */
/** Image pyramid generation parameters (for scale-invariant object detection) */
/** @} */
/**
* @name Image pyramid generation parameters (for scale-invariant object detection)
* @{
*/
int interval; /**< How many intermediate images in between each image pyramid level (from width => width / 2) */
float shift; /**< How much steps sliding window should move */
/** Samples generation parameters */
/** @} */
/**
* @name Samples generation parameters
* @{
*/
int min_win; /**< The minimal window size of patches for detection */
float include_overlap; /**< Above this threshold, a bounding box will be positively identified as overlapping with target */
float exclude_overlap; /**< Below this threshold, a bounding box will be positively identified as not overlapping with target */
/** Ferns classifier parameters */
/** @} */
/**
* @name Ferns classifier parameters
* @{
*/
int structs; /**< How many ferns in the classifier */
int features; /**< How many features for each fern */
/** Nearest neighbor classifier parameters */
/** @} */
/**
* @name Nearest neighbor classifier parameters
* @{
*/
float validate_set; /**< For the conservative confidence score will be only computed on a subset of all positive examples, this value gives how large that subset should be, 0.5 is a reasonable number */
float nnc_same; /**< Above this threshold, a given patch will be identified as the same */
float nnc_thres; /**< The initial threshold for positively recognize a patch */
float nnc_verify; /**< The threshold for a tracking result from short-term tracker be verified as a positive detection */
float nnc_beyond; /**< The upper bound threshold for adaptive computed threshold */
float nnc_collect; /**< The threshold that a negative patch above this will be collected as negative example */
int bad_patches; /**< How many patches should be evaluated in initialization to collect enough negative examples */
/** Deformation parameters to apply perspective transforms on patches for robustness */
/** @} */
/**
* @name Deformation parameters to apply perspective transforms on patches for robustness
* @{
*/
int new_deform; /**< Number of deformations should be applied at initialization */
int track_deform; /**< Number of deformations should be applied at running time */
float new_deform_angle; /**< The maximal angle for x, y and z axis rotation at initialization */
Expand All @@ -1690,12 +1729,17 @@ typedef struct {
float track_deform_scale; /**< The maximal scale for the deformation at running time */
float new_deform_shift; /**< The maximal shift for the deformation at initialization */
float track_deform_shift; /**< The maximal shift for the deformation at running time */
/** Speed up parameters */
/** @} */
/**
* @name Speed up parameters
* @{
*/
int top_n; /**< Only keep these much positive detections when applying ferns classifier */
/* speed up technique, instead of running slide window at
* every frame, we will rotate them, for example, slide window 1
* only gets examined at frame % rotation == 1 */
int rotation; /**< When >= 1, using "rotation" technique, which, only evaluate a subset of sliding windows for each frame, but after rotation + 1 frames, every sliding window will be evaluated in one of these frames. */
/** @} */
} ccv_tld_param_t;

extern const ccv_tld_param_t ccv_tld_default_params;
Expand Down
79 changes: 46 additions & 33 deletions site/_doxygen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,41 +63,54 @@ def output_struct file, structname, doc_group
structs = Set.new
compoundname = doc_group.at('./compoundname').content.strip
return structs unless compoundname == structname
variables = doc_group.xpath ".//memberdef[@kind='variable']"
available_desc = false
variables.each do |variable|
para = variable.at './detaileddescription/para'
available_desc = true if para != nil
break if available_desc
end
# return if no available desc anywhere
return structs if !available_desc
compoundname = markdown_safe compoundname
file << "\n" + compoundname + "\n" + ('-' * compoundname.length) + "\n\n"
vars = Hash.new
variables.each do |variable|
paras = variable.xpath './detaileddescription/para'
next if paras.length == 0
paras.each do |para|
desc = para.content.strip
alt_name = alt_name desc
desc = desc.sub('[' + alt_name + ']', '').strip if alt_name != nil
merge_structs structs, desc
name =
if alt_name != nil
markdown_safe alt_name.strip
else
markdown_safe variable.at('./name').content
end
desc = markdown_safe desc
vars[name] = desc if !vars.has_key?(name)
sections = doc_group.xpath './sectiondef'
first_struct = true
sections.each do |section|
variables = section.xpath "./memberdef[@kind='variable']"
available_desc = false
variables.each do |variable|
para = variable.at './detaileddescription/para'
available_desc = true if para != nil
break if available_desc
end
# next section if no available desc anywhere
next if !available_desc
if first_struct
# if we haven't print the name of the struct yet, print it now
compoundname = markdown_safe compoundname
file << "\n" + compoundname + "\n" + ('-' * compoundname.length) + "\n\n"
header = section.at './header'
file << header.content.strip + "\n\n" if header != nil
first_struct = false
else
header = section.at './header'
file << "\n" + header.content.strip + "\n\n" if header != nil
end
vars = Hash.new
variables.each do |variable|
paras = variable.xpath './detaileddescription/para'
next if paras.length == 0
paras.each do |para|
desc = para.content.strip
alt_name = alt_name desc
desc = desc.sub('[' + alt_name + ']', '').strip if alt_name != nil
merge_structs structs, desc
name =
if alt_name != nil
markdown_safe alt_name.strip
else
markdown_safe variable.at('./name').content
end
desc = markdown_safe desc
vars[name] = desc if !vars.has_key?(name)
end
end
vars_a = Array.new
vars.each do |name, desc|
vars_a << ' * **' + name + '**: ' + desc
end
file << vars_a.sort.join("\n") + "\n"
end
vars_a = Array.new
vars.each do |name, desc|
vars_a << ' * **' + name + '**: ' + desc
end
file << vars_a.sort.join("\n") + "\n"
return structs
end

Expand Down
10 changes: 10 additions & 0 deletions site/_posts/0000-01-01-ccv-numeric.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ Linear-search to minimize function with partial derivatives. It is formed after
* **params**: A **ccv\_minimize\_param\_t** structure that defines various aspect of the minimize function.
* **data**: Any extra user data.

ccv\_minimize\_param\_t
-----------------------

* **extrap**: Extrapolate value.
* **interp**: Interpolate value.
* **max\_iter**: Maximum iterations.
* **ratio**: Increase ratio.
* **rho**: Decrease ratio.
* **sig**: Sigma.

ccv\_filter
-----------

Expand Down
35 changes: 23 additions & 12 deletions site/_posts/0000-01-01-ccv-swt.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,39 @@ Compute the Stroke-Width-Transform image.
ccv\_swt\_param\_t
------------------

Canny parameters

* **high\_thresh**: Parameters for [Canny edge detector](/lib/ccv-classic).
* **low\_thresh**: Parameters for [Canny edge detector](/lib/ccv-classic).
* **size**: Parameters for [Canny edge detector](/lib/ccv-classic).

Geometry filtering parameters

* **aspect\_ratio**: The maximum aspect ratio for a letter.
* **breakdown**: Break textline into words If breakdown text line into words.
* **breakdown\_ratio**: Apply [OSTU](/lib/ccv-classic) and if inter-class variance above the threshold, it will be break down into words.
* **direction**: SWT direction. (black to white or white to black).
* **max\_height**: The maximum height for a letter.
* **min\_area**: The minimum occupied area for a letter.
* **min\_height**: The minimum height for a letter.
* **std\_ratio**: The inner-class standard derivation when grouping letters.

Grouping parameters

* **distance\_ratio**: The allowable distance variance when grouping letters.
* **elongate\_ratio**: The allowable elongate variance when grouping letters.
* **height\_ratio**: The allowable height variance when grouping letters.
* **high\_thresh**: Parameters for [Canny edge detector](/lib/ccv-classic).
* **intensity\_thresh**: The allowable intensity variance when grouping letters.
* **intersect\_ratio**: The allowable intersect variance when grouping letters.
* **interval**: Intervals for scale invariant option.
* **letter\_thresh**: The allowable letter threshold.
* **low\_thresh**: Parameters for [Canny edge detector](/lib/ccv-classic).
* **max\_height**: Geometry filtering parameters The maximum height for a letter.
* **min\_area**: The minimum occupied area for a letter.
* **min\_height**: The minimum height for a letter.
* **thickness\_ratio**: The allowable thickness variance when grouping letters.

Break textline into words

* **breakdown**: If breakdown text line into words.
* **breakdown\_ratio**: Apply [OSTU](/lib/ccv-classic) and if inter-class variance above the threshold, it will be break down into words.
* **direction**: SWT direction. (black to white or white to black).
* **interval**: Intervals for scale invariant option.
* **min\_neighbors**: Minimal neighbors to make a detection valid, this is for scale-invariant version.
* **same\_word\_thresh**: Overlapping more than 0.1 of the bigger one (0), and 0.9 of the smaller one (1)
* **scale\_invariant**: Enable scale invariant swt (to scale to different sizes and then combine the results)
* **size**: Canny parameters Parameters for [Canny edge detector](/lib/ccv-classic).
* **std\_ratio**: The inner-class standard derivation when grouping letters.
* **thickness\_ratio**: Grouping parameters The allowable thickness variance when grouping letters.

ccv\_swt\_detect\_words
-----------------------
Expand Down
52 changes: 36 additions & 16 deletions site/_posts/0000-01-01-ccv-tld.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,54 @@ Create a new TLD tracking instance from a given first frame image and the tracki
ccv\_tld\_param\_t
------------------

* **bad\_patches**: How many patches should be evaluated in initialization to collect enough negative examples
* **exclude\_overlap**: Below this threshold, a bounding box will be positively identified as not overlapping with target
* **features**: How many features for each fern
* **include\_overlap**: Above this threshold, a bounding box will be positively identified as overlapping with target
* **interval**: Image pyramid generation parameters (for scale-invariant object detection) How many intermediate images in between each image pyramid level (from width => width / 2)
Short-term lucas-kanade tracking parameters

* **level**: Level of image pyramids
* **min\_eigen**: The minimal eigenvalue for a valid optical flow computation
* **min\_forward\_backward\_error**: The minimal forward backward error
* **min\_win**: Samples generation parameters The minimal window size of patches for detection
* **new\_deform**: Deformation parameters to apply perspective transforms on patches for robustness Number of deformations should be applied at initialization
* **new\_deform\_angle**: The maximal angle for x, y and z axis rotation at initialization
* **new\_deform\_scale**: The maximal scale for the deformation at initialization
* **new\_deform\_shift**: The maximal shift for the deformation at initialization
* **win\_size**: The window size to compute optical flow.

Image pyramid generation parameters (for scale-invariant object detection)

* **interval**: How many intermediate images in between each image pyramid level (from width => width / 2)
* **shift**: How much steps sliding window should move

Samples generation parameters

* **exclude\_overlap**: Below this threshold, a bounding box will be positively identified as not overlapping with target
* **include\_overlap**: Above this threshold, a bounding box will be positively identified as overlapping with target
* **min\_win**: The minimal window size of patches for detection

Ferns classifier parameters

* **features**: How many features for each fern
* **structs**: How many ferns in the classifier

Nearest neighbor classifier parameters

* **bad\_patches**: How many patches should be evaluated in initialization to collect enough negative examples
* **nnc\_beyond**: The upper bound threshold for adaptive computed threshold
* **nnc\_collect**: The threshold that a negative patch above this will be collected as negative example
* **nnc\_same**: Above this threshold, a given patch will be identified as the same
* **nnc\_thres**: The initial threshold for positively recognize a patch
* **nnc\_verify**: The threshold for a tracking result from short-term tracker be verified as a positive detection
* **rotation**: When >= 1, using "rotation" technique, which, only evaluate a subset of sliding windows for each frame, but after rotation + 1 frames, every sliding window will be evaluated in one of these frames.
* **shift**: How much steps sliding window should move
* **structs**: Ferns classifier parameters How many ferns in the classifier
* **top\_n**: Speed up parameters Only keep these much positive detections when applying ferns classifier
* **validate\_set**: For the conservative confidence score will be only computed on a subset of all positive examples, this value gives how large that subset should be, 0.5 is a reasonable number

Deformation parameters to apply perspective transforms on patches for robustness

* **new\_deform**: Number of deformations should be applied at initialization
* **new\_deform\_angle**: The maximal angle for x, y and z axis rotation at initialization
* **new\_deform\_scale**: The maximal scale for the deformation at initialization
* **new\_deform\_shift**: The maximal shift for the deformation at initialization
* **track\_deform**: Number of deformations should be applied at running time
* **track\_deform\_angle**: The maximal angle for x, y and z axis rotation at running time
* **track\_deform\_scale**: The maximal scale for the deformation at running time
* **track\_deform\_shift**: The maximal shift for the deformation at running time
* **validate\_set**: Nearest neighbor classifier parameters For the conservative confidence score will be only computed on a subset of all positive examples, this value gives how large that subset should be, 0.5 is a reasonable number
* **win\_size**: Short-term lucas-kanade tracking parameters The window size to compute optical flow.

Speed up parameters

* **rotation**: When >= 1, using "rotation" technique, which, only evaluate a subset of sliding windows for each frame, but after rotation + 1 frames, every sliding window will be evaluated in one of these frames.
* **top\_n**: Only keep these much positive detections when applying ferns classifier

ccv\_tld\_track\_object
-----------------------
Expand Down

0 comments on commit adb7156

Please sign in to comment.