Research Article
A New Dataset Size Reduction Approach for PCA-Based Classification in OCR Application
Algorithm 1
The proposed procedure to connect the broken image segments.
while (there is another secondary component in input image) do | { | find outer contour of the main part M; | save the pixels coordinate of M in array MAIN; | repeat | { | find outer contour of an image secondary part S; | save the pixels coordinate of S in array SEC; | } until (there is not another secondary parts in image); | for (each pixel A in array MAIN) | { | for (each pixel B in array SEC) | { | compute the distance d between pixels A and B; | save (d, coordinate of pixel A, coordinate of pixel B) in array D; | } | } | d_min = smallest value d in array D; | A_min = coordinate of pixel A, corresponding to d_min; | B_min = coordinate of pixel B, corresponding to d_min; | draw (a straight line with pen_width thickness from A_min to B_min); | } |
|