face-recognition

Unresolved external symbol error in openCV

旧时模样 提交于 2019-12-06 15:22:24
I am a beginner in openCV. I have been trying out face detection and recognition in Windows platform. I have integrated different pieces of codes. I am also using PCA method to recognize the faces.I am getting an error like below, Error 1 error LNK1120: 2 unresolved externals Error 2 error LNK2019: unresolved external symbol _cvCalcEigenObjects referenced in function "void __cdecl doPCA(void)" (?doPCA@@YAXXZ) Error 3 error LNK2019: unresolved external symbol _cvEigenDecomposite referenced in function "void __cdecl learn(char *)" (?learn@@YAXPAD@Z) can someone please resolve.,.. Abhishek kumar

How to extract face from an image?

故事扮演 提交于 2019-12-06 14:09:52
问题 I have successfully detected a face out of an image having other things in background using OpenCv . Now I need to extract just the detected part (i.e. face) and convert it into some image format like jpeg or gif to make a face database to use for my neural net training. How can I do this? 回答1: Once you detect the faces, you get opposite corners of a rectangle, which is used to draw rectangles around the face. Now you can set image ROI ( Region of Interest) , crop the ROI and save it as

PCA in OpenCV using the new C++ interface

时光总嘲笑我的痴心妄想 提交于 2019-12-06 09:45:13
问题 As an aside: Apologies if I'm flooding SO with OpenCV questions :p I'm currently trying to port over my old C code to use the new C++ interface and I've got to the point where I'm rebuilidng my Eigenfaces face recogniser class. Mat img = imread("1.jpg"); Mat img2 = imread("2.jpg"); FaceDetector* detect = new HaarDetector("haarcascade_frontalface_alt2.xml"); // convert to grey scale Mat g_img, g_img2; cvtColor(img, g_img, CV_BGR2GRAY); cvtColor(img2, g_img2, CV_BGR2GRAY); // find the faces in

What is the alternative of getMat() of Facerecognizer class in opencv3.00?

*爱你&永不变心* 提交于 2019-12-06 01:51:56
I want to follow the tutorials of the face recognition with opencv. But in the tutorial source code example getMat() method is used, which shows an error : class cv::face::FaceRecognizer has no member "getMat". After some searching I found out that opencv3.00 has deprecated that method. What can I use instead of getMat() now in opencv3.0? This is the tutorial I am trying to follow. See the new API here . Replace model->getMat("eigenvalues") with model->getEigenValues() , model->getMat("mean") with model->getMean() , etc... 来源: https://stackoverflow.com/questions/33262738/what-is-the

Face Recognition (2D Array) Confidence Formula Derivation

爷,独闯天下 提交于 2019-12-05 21:21:50
confidence = 1.0f - sqrt( distSq / (float)(nTrainFaces * nEigens) ) / 255.0f Why it is divided by (nTrainFaces*nEigens)? Why it is divided by (nTrainFaces*nEigens)? Well, if you're just trying to find the confidence value for the 'test face eigenvectors (or values?)' with just 1 and only trained face, then you'd do something like confidence = 1.0f - (sqrt( least_squared_distance / no_of_eigens ) / 255.0) However, since you're finding nearest neighbour within trained face database, you want the confidence to reflect that your nearest neighbour gives a high confidence value for one of the faces

Face recognition - Python

為{幸葍}努か 提交于 2019-12-05 18:20:43
I am trying to make face recognition by Principal Component Analysis (PCA) using python. Now I am able to get the minimum euclidean distance between the training images images and the input image input_image . Here is my code: import os from PIL import Image import numpy as np import glob import numpy.linalg as linalg #Step1: put database images into a 2D array filenames = glob.glob('C:\\Users\\me\\Downloads\\/*.pgm') filenames.sort() img = [Image.open(fn).convert('L').resize((90, 90)) for fn in filenames] images = np.asarray([np.array(im).flatten() for im in img]) #Step 2: find the mean image

CIDetector give wrong position on facial features

烈酒焚心 提交于 2019-12-05 16:46:04
Now i know that the coordinate system is messed up. I have tried reversing the view and imageView, nothing. I then tried to reverse the coordinates on the features and i still get the same problem. I know it detects the faces, eyes and mouth, but when i try to place the overlaying boxes from the samples codes, they are out of position (to be exact, they are on the right off-screen). Im stumped as to why this is happening. Ill post some code because i know some of you guys like the specificity: -(void)faceDetector { // Load the picture for face detection // UIImageView* image = [[UIImageView

Face Recognition in Video using OpenCV gives unhandled exception

ⅰ亾dé卋堺 提交于 2019-12-05 04:46:25
I am trying to use the Face Recognition in video sample provided with OpenCV. The only modification I've done is: Instead of using command line arguments to provide CSV and Cascade classifier paths, I have given them directly in the code. This is the code: #include "stdafx.h" #include "opencv2/core/core.hpp" #include "opencv2/contrib/contrib.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/objdetect/objdetect.hpp" #include <iostream> #include <fstream> #include <sstream> using namespace cv; using namespace std; static void read_csv(const

Face unlock code in Android open source project?

∥☆過路亽.° 提交于 2019-12-05 02:07:08
Does anyone know the location of the face unlock code in the android source tree? I'm looking to include some face recognition in my app and would love to use the code that google has already created. I've already looked at the alternatives such as opencv and some other third party APIs, but I'd really just like to see the way that google did it. Thanks! Unfortunately: Face unlock is closed-source google proprietary code, so we have no opportunity to modify it. Source: http://forum.xda-developers.com/showthread.php?t=1367610 来源: https://stackoverflow.com/questions/8632541/face-unlock-code-in

Compare two faces (and their likeness)

时光毁灭记忆、已成空白 提交于 2019-12-04 20:43:15
问题 Is there is a way to compare two faces (perhaps with OpenCv) and get a score of their likeness? I mean to apply a facial recognition algorithm, but only between 2 faces , not on an entire dataset. The problem is that, for example, Eigenfaces requires at least 2 training images. 回答1: Yes, you can absolutely use eigenfaces. The training faces have nothing to do, with the two faces you are comparing for facial recognition. Have a training face gallery of say 100 faces. Then to compare your two