Taking a snippet of a photo and comparing the colour? - android

So, I wanted to do this in preferably Ionic / Android. I want to take a picture of something using the Camera. On the preview four boxes will appear (as an example) you then take the image and the colours within the boxes are then compared against say an array I’ve fetched from an API.
Basically in short a way to select colours within a specific area/s defined and compare them against a set of colours

I figured out a solution using Canvas HTML. You can use a click event on the canvas to grab the pixel colour using the getImageData() method. Android also has a canvas (although will attempt it in Ionic before looking at Android)

Related

How to make typography on image

I want to make application like this in android . I had made applications using Canvas but how to make application like this ?
https://play.google.com/store/apps/details?id=photo.text.typography
Thats not very specific.
You do exactly that just by using a canvas.
The Processing is done in the background, and then they just display the image on the canvas.
And this app looks like they are just overlaying the original image with a preset alpha image. Not even really processing much.

How to make image coloring in Android

I'm new to Android Graphics and would appreciate if you can advise an algorithm to color particular part of image with outlines. I would like to create similar to this application.
I should be able to fill in parts of the image with colors, or use freehand tool to paint, but it should not go outside the outlines.
Should I use any image recognition tools to track black pixels for example?
I can also use predefined images only. I know I can convert each part of it into vector format. Will it be helpful?
Any tutorial references or example code would be highly appreciated.
You could look for connected-component-labeling. It basically assigns a label to each pixel where the label depends on the color of the neighbour. A description and implementation (though not in Java) can be found here: http://www.codeproject.com/Articles/336915/Connected-Component-Labeling-Algorithm. An implementation in java might be found here (https://github.com/klonikar/connected-components-labeling). I didn't check it though.
When you selected the pixels that you need, you can color them as described here: how to change the color of certain pixels in bitmap android

Options for building a Android clock widget. Custom images as numbers or creating a font?

I want to build a digital clock widget for Android, and I have written the numbers from 1 to 10 on paper and scanned them, so that I now have the numbers as per images with transparent background. I may have missed it but I can't really see if in the documentation anything about using images as numbers. Would i be better off creating a font even though it would only consist of the numbers?
First off: add each image separately to the res/drawable directory and reference them from there.
An Opengl surface could render them or, more easily I think, an ImageView with programmatic image flipping.
I'm working on the same thing. Any idea how to run an onTick()-like function for currentTimeMillis()? That would be the path to victory on when to render the next second on your clock face.

Android, how to display scores and other texts to look like any other game?

I'm a beginner in android development and i started to code a game few days ago.
I've almost finished it and now i want to have some nice texts in my canvas. I want to display the scores, the bonuses that the player has and some other stuff.
The problem is i have no idea how to make them look nice. I dont want a normal text to be displayed, and i want to make it pop on the screen when an action is done.
Can anybody give me some advice?
I want to make it look like this http://static.appgamer.net/images/articles/screen568x568_2.jpeg
What you're looking for is called bitmap fonts. Here you can find a pretty good article about the technique: http://obviam.net/index.php/using-bitmap-fonts-in-android/
Basically you have to prepare your font as a bitmap composed of separate glyphs. Then load the bitmap and create a description of each glyph (name, position, size). Then you have to just walk through a string you want to draw and draw parts of the font bitmap instead.

Why Tesseract Tool for Android does not work in many cases

I am trying to implement Tesseract library to get text from the image, it works in some cases but in mostly it fails.
I am using this library in my Android project: https://github.com/rmtheis/tess-two
I am trying with this image
Actual Result
Expected Result
Wikipedia
The free Encyclopedia
Any suggestions as to why it's not working?
It's not working because of:
The uneven illumination in the image
The presence of part of the globe graphic at the top of the captured image.
By taking a picture of the screen, you're introducing some darker areas on the image that's captured. To fix it, you could use the image directly instead of taking a picture, or you could add code to your app to adjust for the uneven illumination.
With different illumination, and cropping around the text area, I get a better result:

Categories

Resources