How to plot a graph when closing a computer view script on Raspberry pi?

0

I have a code using opencv Raspberry Pi and it is executing a loop pattern recognition, in the end I close the script using "Ctrl + X", without any problem! I want to by "stop" the graphics processing, perform a function to plot the recognition information, such as position, size, and other parameters. Can I do it like? In the example code I put the function call when it stops .. but I did not succeed. Function name is "Report_Movements

while True:

// outras funções de reconhecimento, loop do processamento

if cv.WaitKey(10) == 27:
 break
Relatorio_Movimentos(Parado, Aj_Sup, Aj_Inf, Dir, Esq, Frt, Trs)
cv.DestroyAllWindows()  
gpio.cleanup()  
    
asked by anonymous 31.05.2014 / 00:15

1 answer

2
// Se o usuário pressionar a tecla ESC
if cv.WaitKey(10) == 27:
    // Exibir o relatório
    Relatorio_Movimentos(Parado, Aj_Sup, Aj_Inf, Dir, Esq, Frt, Trs)

    // Observe que se a função acima exibir uma janela do OpenCV, você deve invocar:
    //cv.WaitKey(0)
    break
    
06.06.2014 / 04:04