Braille is a system of raised dots that can be read by touch and is used by visually impaired people to read and write. Converting an image of Braille to text can be a time-consuming and error-prone task. However, a solution has been developed that can automate this process with high accuracy. This solution uses several image processing techniques, including Gaussian blur, thresholding, erosion, and connected component analysis (CCA), to detect and recognize individual Braille characters. A clustering algorithm is then applied to convert each character into a 6-character string, representing a Braille unit. Finally, post-processing steps, including key creation and enhancement, are used to ensure accurate translation. This solution has the potential to make digital information more accessible to visually impaired individuals and improve their quality of life.
The code takes an input image of Braille and converts it to text. It uses a series of image processing techniques such as Gaussian blur, thresholding, erosion, and CCA to identify individual Braille characters. Then, a clustering algorithm converts each character into a 6-character string representing a Braille unit. then its compaired with pre created key and the text is yeileded. Post-processing steps, including key creation and enhancement, ensure accurate translation. The final output is the converted Braille text.
The conversion key was also generated by using the same processing sequences.
Apply Gaussian blur to remove imperfections, black dots, and pixels from the input image.
Convert the 8-bit gray image to binary to improve connectivity analysis.
Erode the image to decrease the number of white pixels, causing black dots to spread out and join to form characters.
Apply CCA8 function to the eroded image to obtain the number of characters, their statistics, and an object map with labeled connected objects.
Convert each object into a 6-character string where each character represents a Braille unit.
Post-processing steps, including key creation and enhancement, are used to ensure accurate translation.
The final output is the converted Braille text.
Use statistics to find the distance between consecutive objects and mark them as spaces if the difference is greater than the threshold.
Add a bounding box around each object using its maximum length, width, and initial points to focus on one character at a time.
Apply clustering algorithm to each character as a vertical rectangle, crop it in a 3x2 dimension, and check each part to determine if it represents a Braille unit or is white.
The conversion table is a JSON file containing mappings between Braille characters and English letters. Each key is a 6-digit binary string representing a 3x2 Braille dot pattern, and each value is the corresponding English lowercase letter. The translate function uses this table to convert Braille characters in the chars array to text.
Each Braille character is represented by a 3x2 grid of dots, where a dot can either be raised (1) or flat (0). The 6-digit binary strings in the conversion table represent the arrangement of these dots, where the first three digits correspond to the left column of the grid, and the last three digits correspond to the right column.
I have converted a 640 char long string to of braille to text,
"Current affairs refer to events and incidents that are happening in the present time and have an impact on society politics the economy or other aspects of our daily lives There are always numerous ongoing events around the world that fall under this category Some of the major current affairs topics that have dominated headlines in recent times include the COVID-19 pandemic and its impact on health economies and societies worldwide Another significant event is the ongoing climate change crisis and the need to take urgent action to reduce greenhouse gas emissions and mitigate the effects of global warming Additionally political events"
Following are the conversion stages,
Input
Erode and apply CCA8
create bounding boxes to find the space
An implementation of the model has been coded in python which can be found on GITHUB