lib/ccv_swt.c
ccv_swt
void ccv_swt(ccv_dense_matrix_t *a, ccv_dense_matrix_t **b, int type, ccv_swt_param_t params)
Compute the Stroke-Width-Transform image.
- a: The input matrix.
- b: The output matrix.
- type: The type of the output matrix, if 0, ccv will default to CCV_32S | CCV_C1.
- params: A ccv_swt_param_t structure that defines various aspect of the SWT function.
ccv_swt_param_t
Canny parameters
Geometry filtering parameters
- aspect_ratio: The maximum aspect ratio for a letter.
- 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.
- intensity_thresh: The allowable intensity variance when grouping letters.
- intersect_ratio: The allowable intersect variance when grouping letters.
- letter_thresh: The allowable letter threshold.
- thickness_ratio: The allowable thickness variance when grouping letters.
Break textline into words
- breakdown: If breakdown text line into words.
- breakdown_ratio: Apply OSTU 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)
ccv_swt_detect_words
ccv_swt_detect_words(ccv_dense_matrix_t *a, ccv_swt_param_t params)
Return array of regions that are potentially text area.
- a: The input matrix.
- params: A ccv_swt_param_t structure that defines various aspect of the SWT function.
return: A ccv_array_t of ccv_comp_t with detection results.
comments powered by