Recognise Faces using opencv - opencv

I'm using CascadeClassifier to detect faces from an image.
Here is how the iOS simulator detect faces.
I want to improve this by adding some more features. How can I improve this to recognise similar faces. For example if I use one person in a photo & again use another photo with the same person, how the application identify both of them are same?
Is there a method in opencv to do it? or can you please give me some tips to start learning?

You can use OpenCV's face recognition module:
http://docs.opencv.org/trunk/modules/contrib/doc/facerec/

Object detection, and object recognition are two different games. You are wanting to do object recognition, therefore look at features in opencv. SIFT, SURF etc

Related

Apple Vision Framework Identify face

Is it possible in the Apple Vision Framework to compare faces and recognise if that person is in a picture compared to a reference image of that person?
Something like Facebook Face recognition.
Thomas
From the Vision Framework Documentation:
The Vision framework performs face and face landmark detection, text
detection, barcode recognition, image registration, and general
feature tracking. Vision also allows the use of custom Core ML models
for tasks like classification or object detection.
So, no, the Vision Framework does not provide face recognition, only face detection.
There are approaches out there to recognize faces. Here is an example of face recognition in an AR app:
https://github.com/NovatecConsulting/FaceRecognition-in-ARKit
They trained a model that can detect like 100 persons, but you have to retrain it for every new person you want to recognize. Unfortunately, you can not just give two images in and have the faces compared.
According to Face Detection vs Face Recognition article:
Face detection just means that a system is able to identify that there is a human face present in an image or video. For example, Face Detection can be used to auto focus functionality for cameras.
Face recognition describes a biometric technology that goes far beyond a way when just a human face is detected. It actually attempts to establish whose face it is.
But...
In a case you need an Augmented Reality app, like Facebook's FaceApp, the answer is:
Yes, you can create an app similar to FaceApp using ARKit.
Because you need just a simple form of Face Recognition what is accessible via ARKit or RealityKit framework. You do not even need to create a .mlmodel like you do using Vision and CoreML frameworks.
All you need is a device with a front camera, allowing you detect up to three faces at a time using ARKit 3.0 or RealityKit 1.0. Look at the following Swift code how you can do it to get ARFaceAnchor when a face has detected.
And additionally, if you wanna use reference images for simple face detection – you need to put several reference images in Xcode's .arresourcegroup folder and use the following Swift code as additional condition to get a ARImageAnchor (in the center of a detected image).

What is the difference between Face Detection and Face Tracking in iOS perspective

May be this sounds like a stupid one, but i really curious to know that, what is the difference between "Face Detection and Face Tracking" in iOS perspective? And in what case or which kind of situation should i use the two of them.
First of all you known about Vision Framework!!
Following this link:- https://developer.apple.com/documentation/vision
Vision — a framework to apply high-performance image analysis and computer vision techniques to identify faces, detect features, and classify scenes in images and video.
Face detection. Detects all faces on selected photo.
Face landmarks. An image analysis that finds facial features (such as
the eyes and mouth) in an image.
Object tracking. Track any object using camera.
Among a lot of new APIs there is the Vision Framework which helps with detection of faces, face features, object tracking and others.
Hope will helpful to you!!
The Face Detection is done by the Apple Framework CoreImage Framework. Available since iOS 5+, (besides the Vision Framework).
You can use the https://developer.apple.com/documentation/coreimage/cidetector
CIDetector to detect faces.
Face detection will return face landmarks such as eyes, lips, nose. This frames can be used to modify the faces with image processing.
You can also use the faces found, and use it with a third party Face Recognitions API's to recognize faces (Microsoft face API) .
Face Tracking
Can be used to track the real time location of face features, and possible apply filters to it (snapchat, etc).

choosing best opencv facial detector

I am very new to opencv and able to install it so far. I want to compare a face with other different faces available in library and to find out the closest match. I have tried different features but couldn't find the closer answer.
Any suggestion to choose a detector.
dimensions of input image and images in library are same.
thanks in advance
i think, you want face recognition (who is it?), not detection (is it a face?).
look here for what opencv has to offer there

opencv - is facial recognition used to detect non face objects?

Can (or maybe should) I use facial recognition software to detect non-faces? For example, let's say I'm trying to find a can of soda in a picture of a bedroom. If I use the haartraining algorithms on many pictures of cans of soda, will the facial recognition feature then find the can of soda in a picture of a bedroom?
Yes you can. Those algorithms are based on extracting features from training sets. If you pass them faces the will be good at detecting features from faces. If you pass them cans they will be good at detecting cans.
A different idea is when you specialize an algorithm on a specific object by restricting the search, but haar are not the case.
I think you are referring to face-detection not face-recognition.
In general, face detection works on discriminating appearance or textures within the face area. They also implicitly assume a mostly planar object.
You can use the same classifiers to detect other mostly-flat objects which are discriminated by appearance, for example, facial features like eyes and mouth, book covers etc.
Soda cans are cylindrical, so you may have to use multiple overlapping rotated view of each can to get it to work.

How to detect an object after the sobel detection in OpenCV

Is there anyway to detect a car (object) after a sobel detction in opencv?
This is my current's work as shown as the image below:
Advanced thanks for any guidelines or solutions!
Object detection task need quite a bit of effort.
First, extract relevant features from object you want to detect: histogram of oriented gradient should be fine for car detection. So, you need to get database of car images. Second, you need to learn models using machine learning algorithm. Boosting or support vector machine should do the work. You will find the implementation in opencv.

Resources