OpenCV - C ++ - Raspberry Pi

0

I want the function to check all the time if there is a fingerprint. If there is, I want it to start the sequential capture scheme (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.

    
asked by anonymous 16.07.2018 / 14:34

0 answers