Image matching a simple image in opencv. Is haar cascading overkill? - ios

I am very new to CV, and I am trying to check for an image in a snapshot in an iphone app, something very simple (like an overly simple QR code -- I only need to really know if it is one of two images). The concept is to play "laser tag" with an iphone camera. If someone is wearing a badge, I want to know they badge is there, and which badge it is. This should be adjusted for lighting and affine transformations. It seems like scaling with template matching might not be strong enough (even though the image could be whatever I want it to be) due to affine transformations and lighting issues. Something like haar cascading seems like big overkill, but I am very new to CV, so I really don't know where to start, or if this process will be necessary. Any advice about the tradeoffs of the various ways to approach this problem would be helpful. What OpenCV methods are going to be helpful, and which ones will probably not work? What designs would be easiest to detect for to denote the two teams. Encoding more data than two teams would be great, but not necessary for now.
A much stronger version of what I need to do is implemented in the Plickers app, so insight on how you think that is done with opencv would be helpful.

Related

Image Recognition - Finding glowing object

Most game anti-cheat use heuristic approach such as detecting known binaries signature or preventing third party library injection. But, Valve software use deep learning to combat cheat. Valve feed its AI with view angle, fire rate, etc. And its quite working good.
My question is, how do i make such thing but with images instead of data?
Consider this example
Not - Cheat :
Cheating :
Is it possible to make a model like that?
Well images are also just data.
You can seperate each image and its pixels into f.e. its raw numbers for like rgb.
This way you could model a network based on converted inputs of pixels from your image.
In this example, the pattern would probably just recognize huge spikes of those vibrant colors since those value will differ alot from the usual environment.
If the question aims to archive some kind of "visual cheat detection" and is not all about deep-learning, you could simply check the images pixels manually, if you know the color of your "cheat"-overlay or simply detect differences, and flag them this way.

Blur people from 1000+ images

I need to anonymize people (and maybe later license plates) from thousand images automatic.
I search through the internet to make a solution on my own with openCV/emguCV, but so far the detection rate is rather bad.
Then I came across Amazon Rekognition, which also looks good but has a steep learning curve for me.
I am somewhat confused that there is no software out there to anonymize pictures without userinput, I though in the age of StreetView this would be easier.
Am I missing something out here?
One of the simplest face localisation API I'm aware of is this one (Python, but based on dlib, which is C++ library).
It's well documented and almost ridiculously easy to use from Python.
It will give you the coordinates of a bounding box which you can blur.
Note that two different detectors you can use. The "classic" one is quite fast but misses some faces, especially when not seen full frontal. The one based on a deep learning model is much better but is quite slow without a GPU.
If you want to be a bit more sophisticated, it can give you facial feature locations (but only with the "classic" detector) and you could place the center of a blurring circe on the nose or so, but for a large number of images, I would just go for the bounding box.

How to detect Facial Sideview Left ear, Sideview Nose, Sideview mouth in iOS Application using OpenCV?

I need help with face profiling through image in an iOS application.
I am trying to detect left ear, nose and mouth in a given image. So far I tried OpenCV, I found voila's haar classifiers but this haar classifier does not detect left ear.
I need to perform this detection without going to server/online.
Is OpenCV good choice for this? Any sample codes you can share to achieve this functionality would be great.
What can be other choices to achieve this functionality?
I think only using part templates (e.g., viola's haar-classifiers) will not work in your case. The parts you want to detect are very small and will be fully/partially occluded most of the time. My suggestion would be to use graphical models based methods, i.e., active appearance models, pictorial structures, etc. This will not only allow you to exploit spatial constraints (i.e, mouth should be always below nose, etc.), but also works when one or few of the parts are occluded. Probably you can start with following publicly available codes:
http://cmp.felk.cvut.cz/~uricamic/flandmark/index.php#structclass
http://www.iai.uni-bonn.de/~gall/projects/facialfeatures/facialfeatures.html
Both codes are in C++, and will allow you to detect facial body parts, but I think ears are not included in both. May be you can try adding additional parts by slightly modifying the source code, and also training your own part-templates for the missing parts.
PS. I am not an iOS developer, so I am not sure if iOS can afford such models, but on normal computers they are sufficiently real time for normal size images.

Recognising a drawn line using neural networks in a web app

Basically, I was weighing up some options for a software idea I had. The web app thing is a bit of a constraint on the project, so I'm assuming I would be writing this in js.
I need to create a drawable area for the user, which is okay, allow them to draw and then compare the input to a correct example. This is just an arrow, but the arrow can be double headed (normal point arrow) or single headed (half an arrowhead), so the minute details are fairly important, as is the location.
Now, I've read around for a few hours or so, and it seems to be that a good approach is to downsample the input so I am just comparing a couple of pixels. I am wondering though if there is a simpler way to achieve what I want here, and if there are good resources for learning what I feel is a very basic implementation of image recognition. Also having never implemented something like this, I'm a little worried about the little details of something like this, like speed; obviously feedback has to be fairly quick.
Thanks.
Use openCV. It already has the kind of use cases you want (location, style etc. of the image). There are many other open source libraries but not many as robust as this.
After that you have to decide all the possible images you want to make as the standard image, then get training examples for each of these standard images (each of these std images would be your one single class).
Now use the pixels as the features (openCV will do it for you with minimum help) and do your classification training. Not you have to provide these training images and have at least a good amount of training images for each class. Then use this trained classifier to classify the images that are drawn by your users. You can put GUI on top of it to adapt to your needs that you posted above.

How can I use computer vision to find a shape in an image?

I have a simple photograph that may or may not include a logo image. I'm trying to identify whether a picture includes the logo shape or not. The logo (rectangular shape with a few extra features) could be of various sizes and could have multiple occurrences. I'd like to use Computer Vision techniques to identify the location of these logo occurrences. Can someone point me in the right direction (algorithm, technique?) that can be used to achieve this goal?
I'm quite a novice to Computer Vision so any direction would be very appreciative.
Thanks!
Practical issues
Since you need a scale-invariant method (that's the proper jargon for "could be of various sizes") SIFT (as mentioned in Logo recognition in images, thanks overrider!) is a good first choice, it's very popular these days and is worth a try. You can find here some code to download. If you cannot use Matlab, you should probably go with OpenCV. Even if you end up discarding SIFT for some reason, trying to make it work will teach you a few important things about object recognition.
General description and lingo
This section is mostly here to introduce you to a few important buzzwords, by describing a broad class of object detection methods, so that you can go and look these things up. Important: there are many other methods that do not fall in this class. We'll call this class "feature-based detection".
So first you go and find features in your image. These are characteristic points of the image (corners and line crossings are good examples) that have a lot of invariances: whatever reasonable processing you do to to your image (scaling, rotation, brightness change, adding a bit of noise, etc) it will not change the fact that there is a corner in a certain point. "Pixel value" or "vertical lines" are bad features. Sometimes a feature will include some numbers (e.g. the prominence of a corner) in addition to a position.
Then you do some clean-up, like remove features that are not strong enough.
Then you go to your database. That's something you've built in advance, usually by taking several nice and clean images of whatever you are trying to find, running you feature detection on them, cleaning things up, and arrange them in some data structure for your next stage —
Look-up. You have to take a bunch of features form your image and try to match them against your database: do they correspond to an object you are looking for? This is pretty non-trivial, since on the face of it you have to consider all subsets of the bunch of features you've found, which is exponential. So there are all kinds of smart hashing techniques to do it, like Hough transform and Geometric hashing.
Now you should do some verification. You have found some places in the image which are suspect: it's probable that they contain your object. Usually, you know what is the presumed size, orientation, and position of your object, and you can use something simple (like a convolution) to check if it's really there.
You end up with a bunch of probabilities, basically: for a few locations, how probable it is that your object is there. Here you do some outlier detection. If you expect only 1-2 occurrences of your object, you'll look for the largest probabilities that stand out, and take only these points. If you expect many occurrences (like face detection on a photo of a bunch of people), you'll look for very low probabilities and discard them.
That's it, you are done!

Resources