Read text from image

XverhelstX

Well-Known Member
Licensed User
Longtime User
Hello,

Is there a way to read text from a picture you have taken?

B4X:
Sub Camera1_PictureTaken (Data() As Byte)
   camera1.StartPreview
   out = File.OpenOutput(File.DirRootExternal, "Example.jpg", False)
   out.WriteBytes(data, 0, data.Length)
   
   readLength = data.Length
   readData = BConverter.CharsFromBytes(Data)
   
   ToastMessageShow("Image saved: " & File.Combine(File.DirRootExternal, "Examplek.jpg"), True)
   btnTakePicture.Enabled = True
End Sub

Sub btnTakePicture_Click
   btnTakePicture.Enabled = False
   camera1.TakePicture
End Sub

Sub btnReadPicture_Click
   
   Dim Reader As TextReader
    Reader.Initialize(File.OpenInput(File.DirRootExternal, "Example.jpg"))
    Dim line As Int
    line = Reader.Readall
   Msgbox(line,"")
   out.Close

End Sub

This is my try, but I don't know how to work on this further.
any help? :sign0163:

XverhelstX
 
Last edited:

XverhelstX

Well-Known Member
Licensed User
Longtime User

Attachments

  • OCR.zip
    30.8 KB · Views: 416
Last edited:
Upvote 0

CidTek

Active Member
Licensed User
Longtime User
Can anyone take a look at this library please?
I edited it a bit to make it work with Basic4android, but I still have some problems.

It has a scanner, Trainingimages and more
Please?:sign0085:

Java OCR | Ron Cemer's Blog

XverhelstX

I have played with Ron's OCR engine before and it is useless with photos. Works somewhat OK with text on pure white plus you have to train it for each image you want to process. I too am looking for a decent OCR solution.
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Expense is not the problem, the issue is the effectiveness of the app or library.

I've dealt in the past with OCR apps and they are a royal pain in the neck, now you want to read text off a picture, well, good luck with that, unless the text is on a high contrast area and at a certain angle (and in some instances the right color) you might be able to get a letter or 2.

Just my 2 cents.
 
Upvote 0
Top