OpenCV FaceRecognizer - facial recognition. Does anyone know of a link - image

With the class FaceRecognizer of OpenCV anybody has a link to somewhere explaining with available source code how to use it to save a model from images (say cropped tags of the same person in photos) and then with any other image that wasn't used to make the model load the model saved of the person(s) (possibly previously stored in db) and find a match on a photo from the stored model therefore calling it facial recognition? This would be a breakthrough for a small social network I have that already uses facial detection to tag people now I need the facial recognition to be able to implement automatically tagging in photos recognizing the users in the images.
Been looking but can't find source code, it's been over a year since the class has been released, for facial detection there's source code as to detect nose, ears, eyes, eyebrows, mouth, etc but not for facial recognition.
Have tried from the official opencv site with the documentation they have, they do post source code in chunks making you think how to put the code in order but haven't been able to compile what I had created to save the model "trained" from an array of photos.

I am afraid you are more than mistaken. There are lots and lots of face
recognition documentation.
Just a quick search on google, http://docs.opencv.org/modules/contrib/doc/facerec/facerec_tutorial.html
Is this the documentation you are talking about? There are many examples, pretty clear cut and straight forward with source code. Which part are you having problems from the documentation? The codes are not in chunks, and it's the whole code by itself. Do comment on my answer so I can help you.
If this is not the documentation you talking about, then have a look at it. Example source code all included inside. Cheers.
Last but not least, when you say trained, you are talking about classifier? If you already have trained it, there's no need to compile it, just insert the path of the classifier into the program.

Related

Generic Universal UI Format?

I'm not sure StackOverflow is the best StackExchange site for this but I can't find a general standards/architecture one, if StackOverflow isn't the best place for a question in this form please point me in the correct direction.
I'm trying to find a universal UI format, due to business constraints I can't get too far into the specific use case, but am looking for something which would function as a minimal UI format for calling API functions, displaying tabular or descriptive data, ideally with images and other binary formats included, and displaying regardless of unforeseeable future changes in tech.
Is vanilla HTML the best solution here, or is there a more base-level option around already?

find similar image in library to photo

I work at a printer where we generate thumbnails of artwork for orders and store them in a folder before printing.
I'm looking for a code library that will allow us to take a photo of a printed item and look through the library of thumbnails for the design.
Just wondered if anyone knows of a library or api that could do this?
Thanks
David
pHash is one solution.
There are others but that mainly depends on your requirements: do you only want to identify identical images, if not, what types of transformations do you want to be able to capture etc.
In general you should look for near duplicate image search.
#david-jennings there are numerous methods to look for similar images in libraries. Remember that google already does this in google images.
Your problem falls under the scope of Content Based Image Retrieval (CBIR), which aims at looking for images with similarities in their content. MPEG-7 is a standard established many years ago to address these issues and the research field is very active with new techniques being developed constantly.
The main idea in CBIR is to extract some kind of a signature from an image and try to match it with all previously extracted signatures of all images in your database. Which method to use depends upon the specifics of your problem... According to your initial post I suppose that probably the use of SHIFT is going to do the work for you...
You may implement such a system using OpenCV with C/C++/Java/etc., or something more "scientific" using MATLAB.

separating text and image regions from an image code

Separating image and text regions from an image is a very old problem and many papers have been written about it. One of the recent ones can be found here.
But I didn't find any existing code for this. Before implementing one, I thought it might be a good idea to ask SO community if anyone knows of an existing one.
Please point me to an existing code (preferably Java) if you know.
I haven't read your PDF completely but from what I saw you can find a similar algorithm implemented in C# in AForge.Net. Converting the code to Java shouldn't be a big deal.
See HorizontalRunLengthSmoothing Class and VerticalRunLengthSmoothing Class

image analysis/openCV object detection

I'm attempting to experiment and get started with image analysis and OpenCV
My aim is to detect certain objects in random pictures, which are easy to detect, for example: symbols and brand logos. I'd also like to be able to detect more variable features like facial features, porn features. usecase: autotagging, autofiltering
My questions:
Where should I start learning applied image-analysis in the context of my aims?
What are important existing concepts/approches that I should introduce myself to?
What are good existing solutions/components of OpenCV which i can feed with training-datasets of example pictures showing the objects of interest and then make a human manually outline the shapes of interest in order to make it learn to detect the features.

How would you generate default user profile pictures?

I've been admiring StackOverflow's default quilt-like profile pictures (which I notice are also on the Fail Blog) and am curious what program both are using to generate them.
But what I really want to know is: If you were to design the system to create default profile pictures, how would you do it?
I'm looking for ideas on what algorithm you'd use, as well as things like how you would related the image to the user, be it related to their username, or some portrayal of their progress (ie the image gets more complex, or larger, as they gain reputation).
FWIW, the default pictures are generated by gravatar, which is why you'll see them on more than this site.
It's called an Identicon. On Stackoverflow it Gravatar uses your IP address to generate the image.
This is an editorial, not necessarily an answer.
Those auto-generated avatars on this site come from a service (Gravatar) that focuses exclusively on providing avatars and is therefore the core of their business. For apps that aren't specifically intended to generate and display avatars, I would just go with an empty placeholder (like Facebook). It's a neat feature, but is it worth your development time when a simple placeholder would be just as effective?
A very good source of images would be flame fractals. They are rather computationally expensive, so simply sourcing them from a project like electric sheep or having them be rendered by the user's computer should be considered to offload the work.
Who wouldn't want default profile pictures like these?
alt text http://sheepserver.net/v2d6/gen/202/124809/icon.jpg alt text http://sheepserver.net/v2d6/gen/202/124805/icon.jpg alt text http://sheepserver.net/v2d6/gen/202/125373/i77.jpg alt text http://sheepserver.net/v2d6/gen/202/125431/i116.jpg
Use a Julia set or something like that and set the initial conditions to a hash of the user's email address.
I'd use a jpeg server tool (aspjpg or similar) to manipulate the image on load so it displays their badges within their profile pic.
In fact, using any tool to dynamically generate images is pretty cool. Applying some sort of 3d or flash technology to dynamically create images using random variables for eye spacing or facial structure would be pretty wicked as well.
But ya this is a weird question. hah!
I did something similar years back, I used POV-Ray to generate little 3D scenes with torusses (torii ?) and spheres. There were lots of parameters to tweak such as the position, size and colour of each object.
POV-Ray is a scriptable 3D render engine, you can find it here.
Unfortunately my images all looked too similar to each other. I love Gravatar's identicons as uses on this site. I think the symmetry helps and the shapes are unique enough that you can identify users fairly clearly.
In ruby there have a library http://github.com/swdyh/quilt to generate it!

Resources