Development of face recognition using opencv [closed]

asked 2018-02-22 05:36:04 -0600

shive gravatar image

updated 2018-02-22 05:53:19 -0600

Hiii...I am new to C++ and opencv .Actually i am in my btech final year project in which am working on facerecognition application using LDA algorithm.I dont have knowledge regarding the subject . At present am to trying to write the code in which a CSV file is uploaded ,calculate the mean of the file and extract the features using LDA and compare the training image with test image.But the main problem is am unable to understand the concept.Someone help me to write the application code, it will be a great help for me. This is the code which am trying now...

   #include "opencv2/core/core.hpp"
   #include "opencv2/highgui.hpp"
   #include "opencv2/face.hpp"
   #include "opencv2/imgproc.hpp" 
   #include <iostream>
   #include <fstream>
   #include <sstream>
   using namespace std;
   using namespace cv;
   using namespace cv::face;

 int main(int argc, const char *argv[])
 {
        string line;
    ifstream myfile("1_seq40.csv");
    vector< vector<Mat> >images;
    while(getline(myfile,line))
     {
       vector<int>labels;
       stringstream stream(line);
       string classlabel;
       while(getline(stream,classlabel,','))
            {
             labels.push_back(atoi(classlabel.c_str()));
        }
       images.push_back(labels);
      }

Mat vect = Mat::zeros((int)images.size(), (int)images[0].size(),CV_8UC1);
for(int rows = 0; rows<(int)images.size(); rows++)
{
 for(int cols = 0; cols<(int)images.size();cols++)
 {
  vector<uchar>(rows,cols) = images[rows][cols];
 }
}

   return 0;
   }
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-08-30 03:15:18.160508

Comments

  • https://docs.opencv.org/master/da/d60...
  • an LDA alone won't work here. since the feature dimensions must be smaller than the number of samples, you need something in front of it to compress the features, like a PCA
berak gravatar imageberak ( 2018-02-22 07:05:09 -0600 )edit

is there any chance, you can re-negotiate that project ?

if both the theory is over your head, and your coding skills are non-existing, you can only fail.

(e.g. if it's about face-recognition, using opencv's pretrained dnn with a live webcam would work much better, and would be easier to implement)

berak gravatar imageberak ( 2018-02-22 09:17:37 -0600 )edit

I dont have any other option regarding the project ....can you help me how to implement the code by pca and lda...

shive gravatar imageshive ( 2018-02-22 22:56:05 -0600 )edit