Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys i have three images of three arabic characters . I need a method in C# to extract small part of the whole image, this part known as the punctuation of the character as shown below.
the tree characters are :
ج ظ ك
extract the secondary component (.) of the character from the main body of the character (ح).
ج ------> . ح
where this character is image saved in (.jpg,... etc ).
Posted
Updated 4-Jul-12 8:38am
v3
Comments
Sergey Alexandrovich Kryukov 4-Jul-12 14:43pm    
This is called OCR, Optical Character Recognition. Do you have any idea how difficult is it? How come you end up with the images instead of text in first place? Maybe you can find some ready-to-use OCR capable of working with Arabic...
--SA

1 solution

You can resort to connected components labeling.

This means that you detect sets of black pixels that touch each other by a side (optionally by a corner). The size of the set (number of pixels) will tell characters from punctuation.

You should find suitable connected components labeling algorithms on the web (http://en.wikipedia.org/wiki/Connected-component_labeling[^]). You can also search for a ready made image processing library in C# that features it.

I can also recommend a less classical approach based on flood filling: scan the image top-down and left-right until you hit a black pixel; from this pixel, use a flood filling algorithm to paint it white (http://en.wikipedia.org/wiki/Flood_fill[^]). While you are filling, count the pixels. Continue the scan from the pixel hit. In the end, you'll get a wholly white image but you'll have seen every connected component once.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900