0

I am new to tesseract. Example Image

The image provided is just an example, the actual image is an Identity Card.

I have a question. I would like to change the background colors to a specific color. Let's say 'black' but the text color remains the same. Is it even possible? I am not sure what exactly I am supposed to be learning in order to achieve it.

The purpose of converting the image color is because when I run my tesseract on my ID, It displays some weird symbols. This is because the ID consists of background designs. Any guides will really be helpful ! Thank you !

UPDATE Okay, I found this image from google search. enter image description here

This will be the image that I will be loading into my application under ImageView. Is there any way that I can only keep the black text on the Identity Card and remove every other colors from the image to white, pixel by pixel? Can it be done ?

*Sorry for not providing a proper explanation previously! *

Community
  • 1
  • 1
topacoBoy
  • 197
  • 2
  • 4
  • 17
  • Before I represent a coded solution just to clarify the question, you want to the change the color of the background behind the text while keeping the color of the text constant? – JBJ May 18 '17 at 11:40
  • @BilalQ : Yes Sir, the color of the background behing the text. – topacoBoy May 18 '17 at 11:41
  • I do not think you can achieve that unless you create your image dynamically. What I understand from your question is you are loading the image in the ImageView. That said, changing the background of the ImageView does not affect the image you loaded in the ImageView... unless I am missing something... – Vincy May 18 '17 at 16:22

1 Answers1

0
RelativeLayout background;
background = (RelativeLayout) findViewById(R.id.background);

background.setBackgroundColor(
          ContextCompat.getColor(MainActivity.this,R.color.black));
Satan Pandeya
  • 3,747
  • 4
  • 27
  • 53
Ritesh
  • 876
  • 9
  • 14
  • Hey Sir, thanks for your time, but that is not what i was trying to achieve. I have updated my question again. If there's any advice, please drop some. Thanks again @Ritesh – topacoBoy May 18 '17 at 12:01
  • No this is not possible. – Ritesh May 19 '17 at 06:26