This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to convert a bufferedImage into a string  RSS feed

 
Punit Jain
Ranch Hand
Posts: 1059
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




Can Anyone tell me how to convert an BufferedImage into a String, i tried it using the code which in in 'green' text., bt it's an error in the getPixel().
so how can i convert a bufferedImage into a String here???

again here is the code, which i used to convert, that i also have mentioned earlier in the program:

for(int y=0; y<image.getHeight(); y++){
for(int x=0; x<image.getWidth(); x++){
str1+=(String)image.getPixel(x,y);
}
}
 
Stephan van Hulst
Saloon Keeper
Posts: 7707
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you possibly convert an image to a String?
 
Punit Jain
Ranch Hand
Posts: 1059
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:Why would you possibly convert an image to a String?


I have a label in my other class, and that label is converting into image, i want to print the text/string of that label, therefore i need to convert, is it possible to convert??
 
Tim Moores
Saloon Keeper
Posts: 3828
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the realm of Optical character recognition; Tesseract is a well-known library for this.
 
Punit Jain
Ranch Hand
Posts: 1059
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:That's the realm of Optical character recognition; Tesseract is a well-known library for this.


I have not used this type of library ever, can you please tell me how can i implement it here??
Here is two other classes i used:



one i have added earlier in this thread.
if is there any other way to get the text of the label, than please let me know.
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you even looked for the Tesseract library? Also, have you tried searching for java ocr?
 
Punit Jain
Ranch Hand
Posts: 1059
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Have you even looked for the Tesseract library? Also, have you tried searching for java ocr?


i have not been looked it earlier, is there any other way to get my requirements, i added two classes also, if there is any other way, please tell me..
 
Tim Moores
Saloon Keeper
Posts: 3828
79
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not a trivial problem, and it cannot be explained in a short forum posting. You will need to spend a significant amount of time learning about OCR and any OCR library like Tesseract you intend to use. You should not expect to have a solution up and running today or tomorrow, and possibly some time after that. And if you have it running, it may not work, or not work well, for the particular type of image you're using.
 
Punit Jain
Ranch Hand
Posts: 1059
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:This is not a trivial problem, and it cannot be explained in a short forum posting. You will need to spend a significant amount of time learning about OCR and any OCR library like Tesseract you intend to use. You should not expect to have a solution up and running today or tomorrow, and possibly some time after that. And if you have it running, it may not work, or not work well, for the particular type of image you're using.


Thanks for your helpful advice..
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!