A non-transitory computer-readable medium storing a computer program for preprocessing screenshot frames and detecting active elements, the program configured to cause at least one processor to: run computer vision, CV, preprocessing on a previous screenshot frame to determine types and locations of graphical elements in the previous screenshot frame ; determine that a change occurred in a region where a current screenshot frame differs from the previous screenshot frame , the region at least partially included within an area of one or more graphical elements that permit text entry; and characterized in that when the current screenshot frame changes more than a threshold relative to the previous screenshot frame: wait until a new current screenshot frame does not change more than the threshold relative to a new previous screenshot frame, and when the new current screenshot frame does not change more than the threshold relative to the new previous screenshot frame: run the CV preprocessing on the new current screenshot frame to determine types and locations of graphical elements in the new current screenshot frame; determine that a new change occurred in a region where the new current screenshot frame differs from the new previous screenshot frame, the region at least partially included within an area of one or more graphical elements that permit text entry, and set the graphical element where the new change occurred as an active element. run computer vision, CV, preprocessing on a previous screenshot frame to determine types and locations of graphical elements in the previous screenshot frame ; determine that a change occurred in a region where a current screenshot frame differs from the previous screenshot frame , the region at least partially included within an area of one or more graphical elements that permit text entry; and characterized in that when the current screenshot frame changes more than a threshold relative to the previous screenshot frame: wait until a new current screenshot frame does not change more than the threshold relative to a new previous screenshot frame, and when the new current screenshot frame does not change more than the threshold relative to the new previous screenshot frame: run the CV preprocessing on the new current screenshot frame to determine types and locations of graphical elements in the new current screenshot frame; determine that a new change occurred in a region where the new current screenshot frame differs from the new previous screenshot frame, the region at least partially included within an area of one or more graphical elements that permit text entry, and set the graphical element where the new change occurred as an active element. wait until a new current screenshot frame does not change more than the threshold relative to a new previous screenshot frame, and when the new current screenshot frame does not change more than the threshold relative to the new previous screenshot frame: run the CV preprocessing on the new current screenshot frame to determine types and locations of graphical elements in the new current screenshot frame; determine that a new change occurred in a region where the new current screenshot frame differs from the new previous screenshot frame, the region at least partially included within an area of one or more graphical elements that permit text entry, and set the graphical element where the new change occurred as an active element. run the CV preprocessing on the new current screenshot frame to determine types and locations of graphical elements in the new current screenshot frame; determine that a new change occurred in a region where the new current screenshot frame differs from the new previous screenshot frame, the region at least partially included within an area of one or more graphical elements that permit text entry, and set the graphical element where the new change occurred as an active element. <EOS>