gkaguirrelab / transparentTrack

Determine pupil size and gaze location in IR video of the eye
MIT License
16 stars 9 forks source link

Error: Objective Function Undefined at Initial Point #123

Closed mdefende closed 6 years ago

mdefende commented 6 years ago

Hi. I'm trying to run the pipeline from beginning to end on one of the videos we recorded in our setup. I was following the code written in the DEMO_eyeTracking, changing paths and such. I didn't make the specific measurements that were in that script for creating the scene geometry, so I just used the default settings instead with the calls:

sceneGeometry = createSceneGeomtry(): [cameraDepth, cameraDepthSD] = depthFromIrisDiameter(sceneGeometry,maxIrisDiamPixels);

The pipeline runs very well up until the estimateSceneParams call where the error Objective Function Undefined at Initial Point is thrown. I'm including a screenshot of the entire error output for more information.

estimatesceneparams_error

I can upload the eyetracking video file if that would help, but I was wondering if this error may be due to just using the defaults for creating the scene geometry or if there is something else I am missing. Thanks

mdefende commented 6 years ago

Also, I'm using the most recent version of the toolbox from the TbTb registry. I deleted and redownloaded it today. Let me know what other information would be helpful with this. Thanks!

gkaguirre commented 6 years ago

Matt -- Thanks for posting this. Let me take a look. As I'm sure you've seen, the code has been undergoing some heavy revision in recent weeks. I have not properly tested the scene Geometry estimation routines since I split off the model eye code. I'll run through the demo for this in the next day or so and let you know what I find.

gkaguirre commented 6 years ago

Matt -- I just ran the DEMO_eyeTracking.m routine from the start through the estimateSceneParams stage. It ran without errors, which raises the possibility that the values you are passing for sceneParamsUB/LB/UBp/LBp are defective in some way. I propose that you put a breakpoint stop on line 165 of the estimateSceneParams.m routine and then run the analysis on your video (perhaps skipping steps 1-6 to save time). Once you hit that breakpoint, please inspect the values for p.Results.sceneParamsLB, etc, and post them here.

mdefende commented 6 years ago

p.Results.sceneParamsLB = [-30, -20, -20, 90, 0.75, 0.9]; p.Results.sceneParamsLBp = [-15, -5, -5, 100, 0.85, 0.95]; p.Results.sceneParamsUBp = [15, 5, 5, 160, 1.15, 1.05]; p.Results.sceneParamsUB = [30, 20, 20, 200, 1.25, 1.1];

I'm not setting these values outside of the estimateSceneParams function since I'm not familiar with what the values mean physically and what numbers would be appropriate so I just went with the defaults since it seemed like they were a large enough range to cover our setup.

gkaguirre commented 6 years ago

Thanks. Could you post as well one still frame from the video?

--

Geoffrey Karl Aguirre, MD, PhD https://cfn.upenn.edu/aguirre Associate Professor of Neurology University of Pennsylvania

On Jun 14, 2018, at 11:59 PM, mdefende notifications@github.com wrote:

p.Results.sceneParamsLB = [-30, -20, -20, 90, 0.75, 0.9]; p.Results.sceneParamsLBp = [-15, -5, -5, 100, 0.85, 0.95]; p.Results.sceneParamsUBp = [15, 5, 5, 160, 1.15, 1.05]; p.Results.sceneParamsUB = [30, 20, 20, 200, 1.25, 1.1];

I'm not setting these values outside of the estimateSceneParams function since I'm not familiar with what the values mean physically and what numbers would be appropriate so I just went with the defaults since it seemed like they were a large enough range to cover our setup.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mdefende commented 6 years ago

mdp001_ret01_frame1

mdp014_gazecal01_frame1

It happens in both of these videos. I haven't had time to try it on the rest of the videos I have yet, unfortunately.

Edit: Also, these are from 2 different subjects

gkaguirre commented 6 years ago

Could you please post the _pupil.mat file for one of the subjects that is crashing at the estimate scene parameters step? I'll take a look and see if it is having trouble selecting appropriate ellipses to guide the search.

mdefende commented 6 years ago

MDP014_GazeCal01_pupil.mat.zip

I've attached the pupil file for MDP014 as a zip file since GitHub doesn't allow attachment of .mat files apparently.

gkaguirre commented 6 years ago

Matt -- Thanks for providing the pupil files. I've now pushed updates to transparentTrack and gkaModelEye that fix the problem you were having. The routine was failing for a particular circumstance in which a valid ellipse was not available for a perimeter.

I noticed that the RMSE values for the initial ellipse fits to your video are a bit high. We find that an RMSE close to to 1 is typical for well fit video frames from the LiveTrack camera; an RMSE value of 2 or greater is by default considered a "bad" frame. Much of your video has RMSE values that are larger than these. You could try adjusting the parameters that are being used to extract the pupil perimeter at the earlier stages. A recent addition to the toolbox is an interactive tool for optimizing these parameters. Check out estimatePipelineParamsGUI.m within the utilities folder. This tool is still under development, including the header comments, but it may be useful.