Identify Photos vs. Graphics - graphics

Is there a way to write a program that can identify photos vs. graphic images in a folder of jpg files?
sample photo
http://dansdemos.info/clips/samples/photo.jpg
sample graphic image
http://dansdemos.info/clips/samples/graphic.jpg
I was thinking ImageMagic compare could do it, if it was provided a set of samples it could use to calculate differences between images. I was thinking coming up with that might be tricky, so I was hoping there might be a simpler approach. Maybe something as simple as a Google search I have not thought of. Any help or comment would be much appreciated. Thank you.

You could have the program check for Exif data of various kinds, like the camera manufacturer.
It wouldn't be foolproof, but it would probably work in most cases, as long as the Exif data hasn't been removed from photos by some postprocessing step.
It worked just fine on your two sample images. E.g. your photo of guinea fowl has Exif data for camera maker, camera model, f-stop, exposure, etc. The graphic.jpg appears to have none of those.

Related

API to retrieve images from within an image or pdf

I am looking for a way to extract images from within another image. For example:
Here is a picture taken of a paper. It includes text, an image of a camera, and an image of a qr code. Is there an API that can possibly extract those two(camera and qr code) from this larger image and separate them into their own individual images. I know this is doable with the text(OCR), but I need to find some way to do Image Recognition if that even exists. For now, I cant find any reference to doing this besides extracting images from pdf's, which none of those softwares have the capability to extract them from a non-perfect pdf.
Price for the API(node.js prefered, but i can adapt to use any language) is not a big concern, I'm just not sure this is even possible to due without programming a legitable artificial intelligence using machine learning, which I would no doubt cause a global internet shutdown from breaking everything if I attempted to do so.
Anyway, any suggestions would be great and much appreciated. Thanks!
EDIT: the images aren't always those, it can be an image of anything, from potatoes to flags
For the QR code, you can simply use a QR code scanner library and convert the output back into a QR code. As for the camera, you are going to need an image recognition service like Google Cloud Vision or train your own neural network with something like TensorFlow to recognize pictures of cameras.
QR detectors abound around the web and some are on github but for single objects you could try hotpot API https://hotpot.ai/docs/api
your code example linked into https://hotpot.ai/remove-background
for striping back you may need a secondary autocrop task

find an altered image from the original image data set

Here is my problem:
I must match two images. One image from the project folder and this folder have over 20.000 images. The other one is from a camera.
What I have done?
I can compare images with basic OpenCV example codes that I found in the documentation. OpenCV Doc I can also compare and find an image by using the hash of my image data set. It is so fast and it is only suitable for 2 exact images. One for query the other one is the target. But they are the same exact image.
So, I need something as reliable as feature matching and as fast as hash methods. But I can't use machine learning or anything on that level. It should be basic. Plus, I'm new to these stuff. So, my term project is on risk.
Example scenario:
If I ever take a picture of an image in my image data set from my computer's screen. This would change many features of the original image. In the case of defining what's in that image, a human won't struggle much but a comparison algorithm will struggle. Such a case leaves lot's of basic comparison algorithm out of the game. But, a machine-learning algorithm could solve the problem but it's forbidden to use in my project.
Needs:
It must be fast.
It must be accurate.
It must be easy to understand.
Any help is okay. A piece of code, maybe an article or a tutorial. Even an advice or a topic title might be really helpful to me.
Once saw this camera model identification challenge on kaggle. This notebook discusses about noise pattern changes with changing devices. May be you should look in to this and other notebooks in that challenge. Thanks!

Cropping audio files?

I was wondering if there was a tool similar to jCrop, with the exception that instead of an image I'd allow the user to crop an audio file? Google didn't give me any useful results sadly :(
The reason why I'm asking is that I'm making a tool to convert audio files to popular ringtone formats, and only letting the user specify the offsets in numbers is somewhat inconvenient. Obviously the tool doesn't have to be in javascript - anything that fits into a website is ok.
Here's a browser-based audio editor written in Flash that you could probably adapt (it supports cropping):
http://www.hisschemoller.com/2010/audio-editor-1-0/
One thing I found a bit confusing is that you have to hold down the play button on the editor to play the full sound.

Graphics/Vision Interesting Topics

I would like to do an interesting project for a computer graphics course. I know that there is a lot of literature out there (i.e. SIGGRAPH conference papers). I have a very large range of interest with regard to computer graphics (i.e. image processing, 3D modeling, rendering, animation). However, I've only taken computer vision/graphics for 2 semesters and thus don't have too much background experience, except for the class projects that I had to do.
I've been looking through SIGGRAPH papers trying to see if there is anything that will be of interest to me but the literature is extremely vast. I was wondering if anyone has any topic suggestions, anything interesting that you ran across that you could recommend. I would prefer to do something fun yet slightly challenging (not really interested in making a shooter game).
If this question does not belong here, I apologize and please let me know where I should move it.
Thanks!
Image Drawing animator. (the name is kind of misleading, but I didn't care much about it)
Anyway, the software does the following:
Takes an image say a JPEG or BMP as input.
Extract the lines from the image. (I used Matlab and Laplace transformations)
Convert the static lines to Vector paths.
Simulate drawing the image using the extracted paths.
In summary, you should give an image, for example a city scape, the program extract all lines and start drawing the buildings, streets and sunset lines, then finally add the colors one by one, until the full image is done.
Real time hand(s) detector.
You'll have plenty of interesting and fun applications with this.

Parse a png image into many png images in J2ME

Can anyone tell me how i can parse a png image into many png images in J2ME ? I want to write a code that take a image and give many images that have equal pixels.
You mean you want to cut it into smaller images?
Load the image.
Convert to a bitmap.
Encode arbitrary rectangles as PNG.
Save the PNGs.
Unfortunately, I don't know anything about image processing usinf J2ME libraries.
Here's what I googled as far as loading a PNG in J2ME.
Using that, you'll be able to see the API calls used, and following the import list, you'll get to the classes used. Look at those class's methods, and yu'll probably come up with what you need.
I did this mostly because you're having an emergency, but frankly, you could have googled this yourself, or composed a question that was clearer, which would have led to someone more knowledgeable about J2ME image processing helping you.
Just don't panic, take a breath, google for what you need, you'll be fine.

Resources