Emotion Recognition using Google Cloud Vision API? - computer-vision

I wish to use Google Cloud Vision API to generate features from images, that I will further use to train my SVM for emotion recognition problem. Please provide a detailed procedure for how to write a script in python that can use Google Cloud Vision API to generate features that I can directly feed into SVM.

I would go with following steps:
Training
Create a dataset(training + testing) for whichever emotions you want(such as anger, happy, etc.). This dataset must be diverse but balanced in terms of gender and age.
Extract the features of each face.
Normalize the whole dataset. Get the bounding box around faces and cut them from images. Also, normalize the sizes of each face.
Align the faces by using Roll and Eye coordinates which can be acquired from Google API.
Train an SVM(validate it, etc).
Testing
Acquire an image.
Extract the features.
Normalize and align the face.
Use SVM.
Library that I suggest:
scikit-learn - SVM
OpenCV - Image Manipulations

Related

Does Google Cloud Vision API support face recognition or face identification?

I am looking for a Google Cloud API that can do both face recognition and identification. My understanding is that the Google Cloud Vision API will support only face detection, but not recognition.
Is there any Google Cloud API that can do face recognition?
According to Google Vision API documentation. It doesn't support Face Recognition, only Face Detection and other attributes detection such as lable, landmark, web, label.
Face Detection : detect multiple faces within an image, along with the associated key facial attributes like emotional state or wearing headwear. Facial Recognition is not supported.
Label Detection : Detect broad sets of categories within an image, ranging from modes of transportation to animals.
Explicit Content Detection : Detect explicit content like adult content or violent content within an image.
Logo Detection : Detect popular product logos within an image.
Landmark Detection : Detect popular natural and man-made structures within an image.
Image Attributes : Detect general attributes of the image, such as dominant colors and appropriate crop hints.
Web Detection : Search the Internet for similar images.
Optical Character Recognition : Detect and extract text within an image, with support for a broad range of languages, along with support for automatic language identification.
Check out more details : https://cloud.google.com/vision/
Hope it can help you and more ideas and concepts
Cloud Vision currently supports face detection, but not face recognition.
That is, it can tell you whether or not there are faces in an image (and where they all are), but it cannot tell you which faces are in the image.
Google Cloud Vision Api doesn't offer Face Recognition, only Face Detection and 4 emotions in the face detected, and 3 properties like blurred, underexposed and with hat.
You can use the OpenCv library (not Google product) to create your custom application with pretrained machine learning model.

How to get a position of custom object on image using vision recognition api

I know there is a lot of vision recognition APIs such as Clarifai, Watson, Google Cloud Vision, Microsoft Cognitive Services which provide recognition of image content. The response of these services is simple json that contains different tags, for example
{
man: 0.9969295263290405,
portrait: 0.9949591159820557,
face: 0.9261120557785034
}
The problem is that I need to know not only what is on the image but also the position of that object. Some of those APIs have such feature but only for face detection.
So does anyone know if there is such API or I need to train own haar cascades on OpenCV for every object.
I will be very greatful for sharing some info.
You could take a look at Wolfram Cloud/Mathematica.
It has the ability to detect object locations in a picture.
Some examples.
Detecting road signs.
Finding Waldo.
Object tracking in video.

Real-time object tracking in OpenCV

I have written an object classification program using BoW clustering and SVM classification algorithms. The program runs successfully. Now that I can classify the objects, I want to track them in real time by drawing a bounding rectangle/circle around them. I have researched and came with the following ideas.
1) Use homography by using the train set images from the train data directory. But the problem with this approach is, the train image should be exactly same as the test image. Since I'm not detecting specific objects, the test images are closely related to the train images but not essentially an exact match. In homography we find a known object in a test scene. Please correct me if I am wrong about homography.
2) Use feature tracking. Im planning to extract the features computed by SIFT in the test images which are similar to the train images and then track them by drawing a bounding rectangle/circle. But the issue here is how do I know which features are from the object and which features are from the environment? Is there any member function in SVM class which can return the key points or region of interest used to classify the object?
Thank you

How to extract LBP features from a hand contour using opencv c++

I am currently working on a hand recognition system. I have been able to detect the hand and draw a contour for it. Now, I have to extract features from the hand region. What is the best feature extraction method that i can use?
I was thinking to use Local Binary Pattern, but since i am new to computer vision i don't know how to use it.
Perhaps you must look at histogram of gradients (HOG), which can be considered as a more general version of LBP. You can have multiple images of hands; by extracting HOG features from each image and using an SVM or neural network classifier, you can learn a statistical model of hand poses. This will help in recognizing an unseen hand. Look also at the current literature on deep learning.
A C++ implementation of HOG is available from vlfeat library [1], which can be called from OpenCV. HOG can be computer from OpenCV also [2].
[1] http://www.vlfeat.org/overview/hog.html
[2] http://goo.gl/8jTetR

Classification of Lightning type in Images

I need to write an application that uses image processing functionality to identify the type of lightning in an image. The lightning types that it has to identify are the cloud to ground and the intracloud lightning which are shown in the pictures below. The cloud to ground lightning has these features: it hits the ground and has flashes branching downwards and the features of the intracloud lightning are that: it has no contact with the ground. Are there any image processing algorithms that you guys know which i can use to identify these features in the image such that the application will be able to identify the lightning type? I want to implement this in C++ using the CImg library.
Thanking you in advance
!!Since I cant upload photos because am a new user, i posted the links to the images!!
http://wvlightning.com/types.shtml
Wow, this seems like a fun algorithm. If you had a large set of images for each type you might be able to use HAAR training (http://note.sonots.com/SciSoftware/haartraining.html) but I'm not sure that would work because of the form of lightning. Maybe HAAR in combination with your own algorithm. For instance it should be very straightforward to know whether the lightning goes to the ground. You could use some OpenCV image analysis to do that - http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/