detect face aspect ratio - ios

I am working on a demo in ios where a user takes a photograph from camera or from photo gallery, and then some how determine whether the person is japenese, chinese, asian from the skin color, and shape of eyes. Is there any ios library that can help me to achieve this goal.
If there is no such library, can anyone guide if it is even physible or what approach should I follow ?

You're probably going to look into OpenCV for any kind of feature detection. From what I understand this framework allows you to detect specific colors shapes etc.. and should help you achieve your goal.
Then as far as any kind of basic face detection goes, you can use Apple's CIDetector.

Related

Reproduce the new scanning feature in iOS 11 Notes

Does anyone know how to reproduce the new Notes new scanning feature in iOS 11??
Is AVFoundation used for the camera?
How is the camera detecting the shape of the paper/document/card?
How do they place the overlay over in real time?
How does the camera know when to take the photo?
What's that animated overlay and how can we achieve this?
Does anyone know how to reproduce this?
Not exactly :P
Is AVFoundation used for the camera? Yes
How is the camera detecting the shape of the paper/document/card?
They are using the Vision Framework to do rectangle detection.
It's stated in this WWDC session by one of the demonstrators
How do they place the overlay over in real time?
You Should check out the above video for this as he talks about doing something similar in one of the demos
How does the camera know when to take the photo?
I'm not familiar with this app but it's surely triggered in the capture session, no?
Whats that animated overlay and how can we achieve this?
Not sure about this but I'd imagine it's some kind of CALayer with animation
Is Tesseract framework used for the image afterwards?
Isn't Tesseract OCR for text?
If you're looking for handwriting recognition, you might want to look for a MNIST model
Use Appleā€™s rectangle detection SDK, which provides an easy-to-use API that can identify rectangles in still images or video sequences in near-realtime. The algorithm works very well in simple scenes with a single prominent rectangle in a clean background, but is less accurate in more complicated scenes, such as capturing small receipts or business cards in cluttered backgrounds, which are essential use-cases for our scanning feature.
An image processor that identifies notable features (such as faces and barcodes) in a still image or video.
https://developer.apple.com/documentation/coreimage/cidetector

What is the difference between Face Detection and Face Recognition 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 Recognition" in iOS perspective? And in what case or which kind of situation should i use the two of them. I am new in iOS and have never any previous tinkle down experience about iOS face Detection/Recognition related thing. I am going to make an application, where i have to detect user face (by camera, not after taken photo) with database picture collection. Please give you response if any, and please don't misunderstand my question. O:)
-Thanks a lot in advanced.
In General:
Face Detection:
Detect the face in the image. It searches general human face like segment in the whole image. Output may be one or more than one. The output will be a rectangle or rectangles on the faces in the image.[Paul viola method]
Face Recognition:
Recognize input face from the already trained database with highest match score. A single face should be given as input, and the output will be a name, or class name or unknown face.
[PCA, LDA]
iOS has face detection, but no face recognition. It can tell you where the faces are in an image but can't tell you who they are.
If you want to use the face detection, start with AVMetadataFaceObject or a tutorial like this one.

Motion Sensing by Camera in iOS

I am working on an app in iOS that will occur an event if camera detects some changes in image or we can say motion in image. Here I am not asking about face recognition or a particular colored image motion, And I got all result for OpenCV when I searched, And I also found that we can achieve this by using gyroscope and accelerometer both , but how??
I am beginner in iOS.So my question is , Is there any framework or any easy way to detect motion or motion sensing by camera.And How to achieve?
For Example if I move my hand before camera then it will show some message or alert.
And plz give me some useful and easy to understand links about this.
Thanx
If all you want is some kind of crude motion detection, my open source GPUImage framework has a GPUImageMotionDetector within it.
This admittedly simple motion detector does frame-to-frame comparisons, based on a low-pass filter, and can identify the number of pixels that have changed between frames and the centroid of the changed area. It operates on live video and I know some people who've used it for motion activation of functions in their iOS applications.
Because it relies on pixel differences and not optical flow or feature matching, it can be prone to false positives and can't track discrete objects as they move in a frame. However, if all you need is basic motion sensing, this is pretty easy to drop into your application. Look at the FilterShowcase example to see how it works in practice.
I don't exactly understand what you mean here:
Here I am not asking about face recognition or a particular colored
image motion, because I got all result for OpenCV when I searched
But I would suggest to go for opencv as you can use opencv in IOS. Here is a good link which helps you to setup opencv in ios.
There are lot of opencv motion detection codes online and here is one among them, which you can make use of.
You need to convert the UIImage ( image type in IOS ) to cv::Mat or IplImage and pass it to the opencv algorithms. You can convert using this link or this.

Detect custom image marker in real time using OpenCV on iOS

I would like some hints, maybe more, on detecting a custom image marker in a real-time video feed. I'm using OpenCV, iPhone and the camera feed.
By custom image marker I'm referring to a predefined image, but it can be any kind of image (not a specific designed marker). For example, it can be a picture of some skyscrapers.
I've already worked with ARTags and understand how they are detected, but how would I detect this custom image and especially find out its position & orientation?
What makes a good custom image to be detected successfully?
Thanks
The most popular markers used in AR are
AR markers (a simple form of QR codes) - those detected by AR tookit & others
QR codes. There are plenty of examples on how to create/detect/read QR.
Dot grids. Similar with the chess grids used in calibration. It seems their detection can be more robust than the classical chess grid. OpenCV has codes related to dot grid detection in the calibration part. Also, the OpenCV codebase offers a good starting point to extract 3D position and orientation.
Chess grids. Similar to dot grids. They were the standard calibration pattern, and some people used them for marker detection of a long time. But they lost their position to dot grids recently, when some people discovered that dots can be detected with better accuracy.
Note:
Grids are symmetrical. I bet you already know that. But that means you will not be able to
recover full orientation data from them. You will get the plane where the grid lies, but nothing more.
Final note:
Code and examples for the first two are easily found on the Internet. They are considered the best by many people. If you decide to use the grid patterns, you have to enjoy some math and image processing work :) And it will take more.
This answer is valid no more since Vuforia is now a paid engine.
I think you should give Vuforia a try. It's a AR engine that can use any image you want as a marker. What makes a good marker for Vuforia is high frequency images.
http://www.qualcomm.com/solutions/augmented-reality
Vuforia is a free to use engine.

iRecognise eyes in a scanned image of a person

I want to develop an iPhone app which should recognise the eyes, face, and skin color of a person in an image which is scanned by QR Reader.
How can eyes be detected in an image?
Although it may be possible, I'm just warning you that it will have, regardless of the programming, a degree of inaccuracy. Any face/retina detection software is able to be tricked, and considering the quality of the iPhone's camera, it can't capture enough detail to accurately evaluate the geometric relevancy between two retinas. Also, about recognizing the face color, it might be problematic due to varying light conditions. Under florescent lights, the person's skin tone would appear more blue than under incandescent or natural lighting. Maybe there is another way to go about this?
For localizing the eyes I've used the algorithm described in "Accurate Eye Center Location and Tracking Using Isophote Curvature" by Roberto Valenti, Theo Gevers in my master thesis and achieved very good results with it:
http://www.science.uva.nl/research/publications/2008/ValentiCVPR2008/CVPR%2008.pdf
For face detection / localization, use the Viola-Jones algorithm, there is probably a objective-c implementation out there somewhere. (OpenCV has it, alternatively)

Resources