loading
 
eye ball tracking and mouse interfacing
tania from India  [7 posts]
15 year
I want to track the eyeballs thru roborealm,and then interface with mouse so that the cursor moves with the movement of eyes...

can anybody suggest me how to proceed??pls help!!!!
Anonymous 15 year
Tania,

Most likely you'd be doing some sort of edge detection followed by circle detection. Hard to say without actually seeing an example image. Do you have one from your setup? Note that the camera will have to be very near (or have really good zoom) in order to capture the pupil of the eye.
tania from India  [7 posts] 15 year
The eyeball can b detectd thru circle detection,but is it possible to get the cordinates of the centre of the circle or the COG of the circle,because we need to interface the mouse by giving those as inputs of get/set variable of mouse interfacing!!
or any other ways of interfacing the mouse??
Anonymous 15 year
Tania,

The circle module can create a CIRCLES array that contains a lot of information about detected circles including the center of the circle.

Have a look at

http://www.roborealm.com/forum/index.php?thread_id=984#1

for more information.

STeven.
tania from India  [7 posts] 15 year
steven,
aftr writing this code in vbscript,an error is shown...
<<<<
circles = GetArrayVariable("CIRCLES")
write circles(0) & ":" & circles(1)
>>>>

error: Subscript out of range: (number: 0)

how to solve??

also pls tell me a solution to the errror---"expected statement"..
thank you.....
Anonymous 15 year
You would get an error when no circles are detected. In VBScript you have to check the type of the variable before assuming that it is an array. For example:

circles = GetArrayVariable("CIRCLES")

if isArray(circles) then
  if ubound(circles) >=1 then

    write circles(0) & ":" & circles(1)

  end if
end if

should do the trick.

expected statement - normally means you are missing a keyword .. such as the "then" at the end of an if statement ... but is NOT an error just for an if statement but a more generic "something is missing" error.

STeven.
tania from India  [7 posts] 15 year
thanks steven!
it gives the first two elements,now
want to acces them.for this i have assigned the value in another variable named c1,c2 by the following way,,but c1,c2 returns 0!!!!

circles=GetArrayVariable("CIRCLES")
setVariable "c1",GetVariable("circles:0")
setVariable"c2",GetVariable("circles:1")
write c1 & ":" & c2



i have attched the .robo file..
wat i want to do is that getting those array variables assigned in c1,c2.now in the mouse module i just will  put c1,c2 in set variable.so that mouse moves on the data-i.e with the co ordinates of the circles-i.e my eyeballs...hope u got the mattr!!!....

program.robo
Anonymous 15 year
Tania,

The above script is not correct. You are getting the circles array and then not using it. We have corrected the script in the attached robofile including those items we have mentioned before which you did not add into the script. Please note that if you do not understand what we post please ask questions specific to that post. Did you not understand the script that we posted in an earlier post?

At any rate, the robofile below show produce the correct c1 and c2 values in detecting a circle. However, we do not think that it is correct in function as the circle threshold values that you set are 65 and 75 which means that a circle needs to be 65 to 75 pixels in diameter in order for it to be detected ... not sure what image you are using but this might be a little restrictive.

Also note that the mouse coordinates can range from 0-800 and 0-600 pixels in an 800x600 screen whereas most webcams have a 320x240 resolution which means that the eye movement will not be able to cover the entire screen. You might want to experiment around with a factor that you multiply c1 and c2 by in order to convert from webcam image size to actual screen size ... naturally you will also lose some precision in doing this but at least your eye movements will be able to cover the entire screen.

What camera setup are you using? Do you have a camera attached to a head mounted system? The reason for the question is one of calibration, i.e. if the persons head moves the mouse cursor might also move unless the camera is mounted relative to the persons head.

STeven.
tania from India  [7 posts] 15 year
steven,

yes! we will be using a head mounted sysytem.probably sumthing like a helmet..
will u pls upload the robo file again about which u mentioned in ur last reply coz i culd nt find it out!!
moreover i am facing another problem tats due to light intensity..the "detect circle" works well on daylight,but at night time it is unable to detect any circle,again we have to change its variables everytime we r using at night time....any solution to this?
Anonymous 15 year
tania,

Yes, lots of possibilities and module that might work. To make this easier can you upload two images one from the day and the other from the night for us to play with?

Thanks,
STeven.
tania from India  [7 posts] 15 year
surely i will do so in my next post! but now i am attaching my robo file here which detects my eyeballs perfectly and continuosly!(daytime)
thnx for ur vbscript.seee this time i have used tat only!!!!!![:)]
apart frm helping me for the intensity problem,will u help me again for another problem????

see will u pls  recheck my mouse module in this robo file,because it cant fetch the circle(0)and circle (1) value properly..will u pls xplain me tat--if in vbscript we r writng the code<<<write circles(0) & ":" & circles(1) >>> writes the first two values,,then why cant we use  the variables circles(0)and circles (1) in set/get variable in mouse module!!wats the matr behind ???
yes acrdingly as u said u r rite!!! i am having a little problem in understanding this circle module!! it says tat all 13 varibles stored in a array -->CIRCLES.ok? now in vbscript we r using the code<<<circles=GetArrayVariable("CIRCLES")>>>
which means fetching the CIRCLES array in another variable circles..ok?
<<<write circles(0) & ":" & circles(1) >>> this command writes the first two values ...then why not circles (0) and circles(1) not working in mouse module!!!!!!..pls do xplain once again if u wont mind!!!!



program.robo
An Olijslagers from Netherlands  [1 posts] 15 year
To use eye-tracking for controlling a PC, you can use the free software CameraMouse. See   http://www.cameramouse.org/
From this website you can download all needed software and many games for trainig and get used to the eye-control. The only thing you need is a webcam with USB.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index