1
I want the function to check all the time if there is a fingerprint. If there is, I want you to start the capture scheme in sequence (the for
nested), but the function I created is not working that way...
void Leitor::iniciarLeitura()
{
Mat frame;
string cmd = "raspistill -n -q 100 -o verifica.jpeg";
system(cmd.c_str());
delay(1000);
frame = imread("verifica.jpeg");
if (haDigital(frame)) {
string lado = "D";
string caminhoImagem = "/home/pi/digitais/";
stringstream ss;
ss << (buscaNumeroVoluntario() + 1);
const char* numero = ss.str().c_str();
string cmd = "mkdir " + caminhoImagem + numero;
for (int mao = 0; mao < 2; mao++) {
system(cmd.c_str());
for (int dedo = 1; dedo < 6; dedo++) {
for (int rep = 0; rep < 5; rep++) {
string caminho = caminhoImagem + numero + "/" + lado + "/" + to_string(mao) + "_" + to_string(dedo) + "_" + to_string(rep) + ".jpeg";
try
{
capturaDigitais(caminho);
delay(1000);
}
catch (...)
{
cout << "erro";
}
}
}
lado = "E";
}
}
else
{
sched_yield();
}
}
I’m using: Raspberry Pi 2; Visual Studio 2017; C++; Opencv.
And what you call this function?
– Woss
pthread_create(&t_leitor, NULL, Leitor::iniciarLeitura_wrapper, &leitor);
– user9190011
Link to the project, if it helps.
– user9190011