I have matrix 7x7 which consist of 1 and 0 only. How I can detect some letter from this matrix? For example:
0000000
0100010
0100010
0111110
0100010
0100010
0000000
This must be converted as H character. Thank you.
On
Are you trying to accomplish some form of OCR or Image Recognition? A non-scalable solution, since you mentioned a 7x7 matrix, and there are finite characters, would be to code in all possible values you want to capture and perform a comparison against your input.
An easy way to accomplish the above is to transform the 7x7 matrix into a byte array of length 47 (which would be hashable) and store those values in a Map which would relate the byte array to a character.
If however, your input is varied in size, then you may want to either convert the input into the 7x7 example, or look into OCR libraries that handle this better.
You have to define a "matrix/letter dictionnary". For example, the string
0000000010001001000100111110010001001000100000000(your matrix put on one line) corresponds toH.Then, you can search this matrix string in your dictionnary and return the letter it corresponds to.