If I understand correctly, you want to capture the screen of your computer into MATLAB and then locate the circles in there.
I do not think that there is a way to capture your screen in real-time and insert it into MATLAB. If you are using an eye-tracking software, my suggestion would be to capture the process in video format and then import the video in MATLAB using the VideoReader function. You can find more details for this function in the following link:
Once you import the video into MATLAB you can process each frame to locate the circles. I would like to suggest the following workflow to do that:
- Since you already know the background of your screen, have a snapshot of it without the circles. Then, once you have a frame of your video subtract the background snapshot from it. The resulting image should be a black image with only the two circles being visible.
- To locate the circle, you could use the imfindcircles function. You can find more details on how to use this function, as well as examples, on the following link:
You could directly go to step 2 but, performing step 1 first will allow you to avoid any false positives (circles included in your background image). In case you want to avoid step 1, you could set the radiusRange property of the imfindcircles function to the radius of the circles that you want to detect.