1 | initial version |
If anyone has the same problem. It can be solved by using opencv inside psychopy rather than opensesame.
Psychopy allows for inline_scripts to be split into different phases of a routine, thereby making the while-loop avoidable and solving both problems in one go. The code can then be separated into code that needs to be run at the start of each trial, the code inside the loop, which is run once per frame, and the code that needs to be run at the end of each trial.