Is it possible to verify the content of an image? - android

In what language(s) is it (if at all possible) to check the content of an image?
Ideally, I am looking for web / mobile languages, but whatever is possible.
As a comparative example, I wish to make the first image of a castle 'valid' and the second image of the wall 'invalid', due to there been no substantial content in the second image. Meaning, the second image, which is the wall, has too much similarity across the image and therefore doesn't contain valid content.
Please do not provide a 'how to do it', as I am a student and will be working out solutions for myself as much as possible, I just need to know that what I want to achieve is possible in the first place and a starting point for language(s).
**EDIT2: What Javier has suggested about computer vision is on the right track to what I mean. Image analysis to break it down a little more. I wish to visually analyse an image and determine how the range of varied the colours across an image are to determine if there is actually a proper image present on not just a picture of a wall

Related

Android - Encode info in image pixels

I have an image processing app, and I have to remember which photos have already been processed. In order to do so, I store an EXIF metadata in the image file, but if the user decides to send the image over WhatsApp, etc, the metadata is lost, so I can't rely on this.
So I though a solution would be to use some pixels in the image to remember if the photo was processed or not, something like if that pixel has that color and that other that other color, then it was processed.
I have tried to do so, but if the image gets scaled down, then my approach won't work.
Any ideas on how to do it?
Thank you.
This is a quite complicated topic and there's no silver bullet that'll help you. One pitfall is the fact that most image compression algorithms try to throw away data our eyes cannot see, and your watermarking algorithm would then have to make modifications that are visible to the human eye, which is probably not what you want.
Another thing to note is whatever you do, if you go with the route of storing data using pixels, you're going to have false positives.
What you could do, since your app already does image processing, is to embed your application's logo as a watermark into the image somewhere. Then you can attempt to find distinct features of your logo in the image, which is admittedly not very easy, but neither is the problem.
Again, this problem is already quite complicated so I'm sorry if this answer isn't adequate.

Rendering large images in WebView

I'm a newcomer in development of android apps. But, I'm undertaking what feels like a large project and I'm looking for information on whether it will work or not, before I get to far in.
As I've read, when trying to display very large images in android, it is most useful to use the "webview".
So, I took that advice, split my image into 1024 smaller images, and laid them out in an html table (not quite finished yet). Now, I'm noticing as the table gets larger my phone begins to lag upon scrolling.
My question is, is webview trying to render every single picture at once upon loading? If so, is there a way to make webview only render a set of images at one time? Let's say I'm at 14,000X x 24,000Y on the image, can I set webview to render the next 5,000px in each direction only, or is this necessary at all?
I can't seem to find the information I'm looking for, but will continue to search. Otherwise, any and all help is appreciated. Thanks!
i have exactly same problem and i found use full this library:
https://github.com/nostra13/Android-Universal-Image-Loader
you can configure a lot of parameters and using cache..

Placing an draggable image onto PDF in Android

Here is my problem:
I need to create an interface, where a user could see a low-quality version of a PDF page, and choose a place to drop a small image onto. After that, I need to get the page number and the coordinates of the top-left corner and the bottom-right corner. I also need to make sure, that there is no way to move the image outside of the PDF.
What I could come up on my own, was to somehow convert the PDF to a bunch of images, which I could then show, and change pages, by just loading the image for the next page. And I could then create some sort of draggable on top of that, and read the coordinates.
So could anyone tell me how to get this done?
As a bonus, could someone help me with some tutorials, links and the sort, to resources that could help me with this?
From where I stand, this could be VERY interesting, but also very resource intensive, since the PDF's should be converted on the fly. Can it be done page by page?
Some technical specs:
Max file size - 4Mb, so the PDF wouldn't be awfully big
Min API - 8. I need it to work on Android 2.2
Ok, I've tried this out, and it all comes grinding to a halt on the PDF to image conversion, which with Open-source libraries takes about 10s for each page, making this a Non-option. A hat tip to Adobe for making it so fast with their app.

Android efficient storage of two images which are similar

Application size on a phone needs to be as small as possible. If I have an image of a sword and then a very similar image of that same sword except that I've changed the color or added flames or changed the picture of the jewel or whatever, how do store things as efficiently as possible?
One possibility is to store the differences graphically. I'd store just the image differences and then combine the two images at runtime. I've already asked a question on the graphic design stackexchange site about how to do that.
Another possibility would be that there is that apk already does this or that there is already a file format or method people use to store similar images in android.
Any suggestions? Are there tools that I could use to take two pngs and generate a difference file or a file format for storing similar images or something?
I'd solve this problem at a higher level. For example, do the color change at run-time (maybe store the image with a very specific color like some ugly shade of green that you know is the color to be fixed at run-time with white or red or blue or whatever actual color you want). Then you could generate several image buffers at load-time.
For compositing the two images, just store the 'jewel' image separately, and draw it over the basic sword. Again, you could create a new image at load-time, or just do the overdraw at run-time.
This will help reduce your application's footprint on flash, but will not reduce the memory footprint when the app is active.
I believe your idea of storing the delta between 2 images to be quite good.
You would then compress the resulting delta file with a simple entropy coder, such as Huffman, and you are pretty likely to achieve a strong compression ratio if similarities with base image are important.
If the similarity are really very strong, you could even try a Range Coder, to achieve less-than-one-bit-per-pixel performance. The difference however might be noticeable only for larger images (i.e higher definition than a 12x12 sprite).
These ideas however will require you or someone to write for you such function's code. This should be quite straightforward.
An very easy approach to do this is to use an ImagePack ( one image containing many ) - so you can easy leverage the PNG or JPG compression algorithms for your purpose. You then split the images before drawing.

Library to identifying the similarity between 2 image in android

Suggestions on the best (preferably easiest way) to compare two images in android.
The first image is in my SD Card.
The second image was taken using Camera in android.
How to measure percentage similarity between those 2 images??
Thanks a lot.
Android does not provide any picture comparison algorithms for you.
Therefore, you will need to write one yourself - one that fits your needs, since not all image comparison algorithms/techniques are the same, and some work better in some cases than others.
You might want to start by looking at the SIFT technique, and find an image matching algorithm that suits your requirements.

Categories

Resources