Forums Register Login

ocr in image processing

+Pie Number of slices to send: Send

class pp
{
public static void main(String[] args) throws IOException {


File newFile=new File("asdhjsadb.png");
byte[] fileData = new byte[ (int)newFile.length()];
InputStream inStream = new FileInputStream( newFile);
inStream.read(fileData);
inStream.close();
String tempFileData = new String(fileData);
String imageString=new BASE64Encoder().encode(fileData);


}
i am working on final year project please tell me which package or which jar i will include in that code .
in this above code error"BASE64Encoder cannot be resolved to a type" what i can i do for removing that
error please tell me thanks in advance
}
+Pie Number of slices to send: Send
Here is a base-64 encoder/decoder you can use. Its API is a bit different from what you're using, but I'm sure you can figure it out. Alternatively, use the Apache Commons Codec library.
+Pie Number of slices to send: Send
So you don't want to tell us about the cross posting here http://www.codeproject.com/Questions/664546/image-processing-in-java?
Please read BeForthrightWhenCrossPostingToOtherSites (<=link; click)

Out of curiosity, where did you get this code in the first place?
+Pie Number of slices to send: Send
Assuming that the goal is still to do OCR -as the subject of this topic suggest it is- I'm curious what you think this will achieve, though.

Also, this: "String tempFileData = new String(fileData)" is wrong. Image data is binary, you can't store it in a string unless you base-64 encode it first.
You can thank my dental hygienist for my untimely aliveness. So tiny:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 616 times.
Similar Threads
How can I read a text from an image file ?
Copying File
jButton Does not do all tasks
.xlsx file not uploading properly
Saving/opening a PDF file from the JSP Page
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:24:29.