[Python] Extract face rectangle from ID card

Discussão em 'Python' iniciado por Stack, Maio 4, 2025.

  1. Stack

    Stack Membro Participativo

    I’m researching the subject of extracting the information from ID cards and have found a suitable algorithm to locate the face on the front. As it is, OpenCV has Haar cascades for that, but I’m unsure what can be used to extract the full rectangle that person is in instead of just the face (as is done in https://github.com/deepc94/photo-id-ocr). The few ideas that I’m yet to test are:

    1. Find second largest rectangle that’s inside the card containing the face rect
    2. Do “explode” of the face rectangle until it hits the boundary
    3. Play around with filters to see what can be seen

    What can be recommended to try here as well? Any thoughts, ideas or even existing examples are fine.

    Continue reading...

Compartilhe esta Página