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()