First time here? Check out the FAQ!

Ask Your Question
-3

How can I classify people into different categories?

asked Jul 15 '15

mayooran gravatar image

I have the need to classify people into different categories such as military man,doctor,student etc based on the images captured from a webcam. I have written the code to capture the images and I now have image/frame. How can I categorize people using Opencv. I am new to this. Please provide with some code samples if possible.

Preview: (hide)

Comments

you have the entire man or just a part of it in the frame?

thdrksdfthmn gravatar imagethdrksdfthmn (Jul 15 '15)edit

1 answer

Sort by » oldest newest most voted
3

answered Jul 15 '15

chr0x gravatar image

This question is kind generic, but basically what you should do to accomplish that task is:

1 - Define your dataset, i.e. the folder that contains all images that you will use. Presuming that you will use supervised learning classification, this dataset should contain a considerable number of examples for your machine learning algorithm, i.e. pictures already classified with the information you are looking for.

2 - Extract the features that you will use in classification from the image. You should decide at this moment which approach you will use to distinguish the subjects, it can be by the clothes for example, if in your input the person is wearing a uniform, you can use this information to distinguish that person.

3 - Normalize the rest of the data: after you decided which information you will use for step 2, you should now "standardize" the rest of the information so the irrelevant features in the image will not be consider (for instance, the image size / scale is not important in this definition, so you must put all the images in the same size / scale).

4 - Choose and implement a Machine Learning algorithm to classify the real time data (webcam as you said) based on the dataset examples defined in step 1. There are a vast number of algorithms to choose (a big number of those was already implemented in the OpenCV lib), like: Random Forest, Support Vector Machine (SVM), Neural Networks. You can read more about this here: http://docs.opencv.org/modules/ml/doc....

Hope it can be useful.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Jul 15 '15

Seen: 584 times

Last updated: Jul 15 '15