How do I get the color of the text? - text

I've been using the Microsoft OCR API and I'm getting the text from the images but I would like to know if the text is in an specific color or has an specific background color.
For example I have the following image and I would like to know if there is text in red
i.e. image
I thought that this line:
string requestParameters = "language=unk&detectOrientation=true";
would help me to establish the parameters I'd like to recieve from the image so if I wanted to know the color in a line of words. So I added a visual feature like this:
string requestParameters = "visualFeatures=Color,language=unk&detectOrientation=true";
But this did not solve the problem.
Also: Can I mix the uriBase link from the image analysis and the one from the OCR?

There is currently no way to retrieve the color information and OCR results in a single call.
You could try using the bounding boxes returned from OCR to crop the original image, and then send the crop it to the analyze endpoint with visualFeatures=color to get the color information for the detected text.

According to documentation, the possible request parameters of this api are:
language, detectOrientation
and the returned metadata has these entities:
orientation, language, regions, lines, words, boundingBox, text
It will be possible to combine the OCR algorithm with another one of the computer vision algorithms to detect the dominating colors in the text regions that the OCR identified.

Related

How do I get the bounding boxes from individual letters using Azure OCR result?

I am using the Azure OCR to analyze some images. For my purposes I would need to know the location of each letter. I have managed to get the bounding boxes around each line so this works perfectly, but now I need to 'zoom in' more, such that I get the bounding box around each letter. The lowest I see in the API is the bounding box property of each Word. Does anyone know how to do this?

Image to text conversion python

i am trying to extract only the highlighted text from an image using pytesseract module in python.
Issue is that i am unable to extract the highlighted part and the whole image is getting converted to text, and i have no idea how to extract specific part based on the background colour.
The best way to achieve it is by crop and send just the part you need from the image, it will also improve the performance.
There is a related discussion that may help -> Select part of text that was extracted using the Tesseract OCR

Replace real world text using ARKit and Vision(?)

I'm trying to build a translator app which would be able to replace foreign text in the real-time, but after exploring possible approaches got a bit cornered.
Even though I was able to extract words images using Vision, I couldn't replace them in place in ARKit scene. Then I tried using ARReferenceImage and image tracking, but it needs to know the physical width of the target image which I can not guarantee, as the text could be on any surface from a book to a billboard.
Am I missing something? What would you guys suggest?

AForge.net Crop Car Photo

I have just started using AForge.net and would like to know if there is a way to crop an photo containing a car to remove most of the background and leave only the car.
The car photo would be taken using a mobile device, which means that it could be any type of car, colour, background.
I have tried a few things including using blob count to try and detect car shape, however this only detects the wheels.
I need the solution to be c# and be capable of running on mono (xamarin).
Thanks in advance for any assistance.
I have attached a photo, illustrating input and expected image.
the key here is to get the car color by searching for the dominating color in the middle of the picture (assuming that the car body paint will be their) make a copy for processing then try HSL filtering for the found color which will keep only the car color and remove the background
AForge HSL Filtering
after that grayscale > blob search and get the biggest blob rectangle then crop that rectangle from the original image ,, DONE! :)
i would support you with some code if you want to

Custom FeedCount. Acording to which rule FeedBurner converts colors?

I am traying to prepare own dynamicly generated FeedCount for my own subscription service. I think this will be a good idea to support convention for setting colors via URL which is well known from FeedBurner,
http://feeds.feedburner.com/~fc/Ekundelekpl?bg=99CCFF&fg=000000&anim=0
this URLs produce such image.
fg is means a text color, bg means here a dark blue color. However light blue (ccffff) is here generated according to some rule.
Is this a some kind popular convert color convention, which is well known in webdeveloper/designers world?
I checked few other pairs of color, but I count figure out what the rule is. I don't want to hardcode all colors supported by FeedBurner.
[EDIT]
There is 216 available colors. Here is twelve pairs which I have extracted:
000000,7e7e7e
000033,8a8a8a
000066,909090
000099,9999CC
0000CC,9999FF
0000FF,9999FF
006600,909090
006633,99CC99
006666,A2A2A2
006699,99CCCC
0066CC,99CCFF
0066FF,99CCFF
I did it in another way.
I decided to use feedburner as template. I download proper image and override parts which interest me.
https://github.com/noisy/eGazeciarzFeedCount

Resources