Research Article
Anchor-Free Braille Character Detection Based on Edge Feature in Natural Scene Images
Algorithm 1
The process of predicting Braille character rectangles.
| Input: edge region matrix M (H × W), the corresponding predict distance D (4 × H × W) | | Output: the list of Braille character rectangles R | (1) | R = [] iNum = 0 Rcol = [] #Initial | (2) | for each x in range (W) | (3) | Rcol (x) = [] | (4) | for each y in range (H) | (5) | if M (x,y) ≥ 0.8 then | (6) | d1 = D (x,y)[1] d2 = D (x,y) [2] d3 = D (x,y) [3] d4 = D (x,y) [4] | (7) | x1 = x–d1 x2 = x + d2 y1 = y–d3 y2 = y + d4 | (8) | Rtemp = (x1, y1, x2, y2) | (9) | Rcol (x) = NMS (Rcol (x), Rtemp) #run the NMS algorithm by column | (10) | endif | (11) | endfor | (12) | endfor | (13) | R = NMS (Rcol) #run the NMS algorithm | (14) | return R |
|