Распознавание лиц OpenCV с использованием fisherfaces

Я работаю над проектом по распознаванию лиц и использую Open cv fisherfaces. Сначала я намереваюсь сохранить лица людей в каталоге и прочитать из этого каталога, чтобы обучить объект лица fisher, но при обучении Windows показывает ошибку. Я использую Qt для создания GUI:

Problem signature:
Problem Event Name: APPCRASH
Application Name:   QtTracker3.exe
Application Version:    0.0.0.0
Application Timestamp:  5100b46b
Fault Module Name:  libopencv_core242.dll
Fault Module Version:   0.0.0.0
Fault Module Timestamp: 50da6896
Exception Code: c0000005
Exception Offset:   000a38f0
OS Version: 6.1.7600.2.3.0.256.1
Locale ID:  1033
Additional Information 1:   0a9e
Additional Information 2:   0a9e372d3b4ad19135b953a78882e789
Additional Information 3:   0a9e
Additional Information 4:   0a9e372d3b4ad19135b953a78882e789

Кодовая строка с ошибкой:

void Dialog::on_btnAdd_2_clicked()
{
tmrTimer->stop();
ui->boxConsole->appendPlainText("Training Started....!!");

cv::Ptr<cv::FaceRecognizer> model = cv::createFisherFaceRecognizer();

dir=QDir(directory);
QFileInfoList files;
QFileInfo file;
QString filen;dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
files=dir.entryInfoList();
int nofiles;
nofiles=files.size();
for(int i=0;i<nofiles;i++)
{
file=files.at(i);
filen=file.absoluteFilePath();
char* path;
std::string fname = filen.toStdString();
path = new char [fname.size()+1];
strcpy( path, fname.c_str() );

ui->boxConsole->appendPlainText(path);
newImages.push_back(cv::imread(path,0)); //std::vector<cv::Mat> newImages; std::vector<int> newLabels; defined in the header
newLabels.push_back(i);
}

model->train(newImages,newLabels);  //this wen commented relieves the error but needs it....
strcat(home,"\\data.xml");model->save(home);ui->boxConsole->appendPlainText("Training Completed!!");
tmrTimer->start();
}

1

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector