Example #1
0
        //an area must appear in both eyes to count
        //partial areas as the edge of the field of view will have only one endpoint
        //this relies on having only one area per color in the visual field
        private void FindAreasOfColor()
        {
            areas.Clear();
            if (boundaries.Count == 0)
            {
                return;
            }
            BinocularBoundary bb1 = boundaries[0];

            for (int i = 1; i < boundaries.Count; i++)
            {
                BinocularBoundary bb2 = boundaries[i];
                if (bb1.theColor == bb2.theColor)
                {
                    Area aa = new Area()
                    {
                        PL       = bb1.p,
                        PR       = bb2.p,
                        lChanged = bb1.changed,
                        RChanged = bb2.changed,
                        theColor = bb1.theColor,
                    };
                    //aa.angleFromTexture = GetAngleFromTexture(aa);
                    Segment s = new Segment()
                    {
                        P1 = aa.PL, P2 = aa.PR, theColor = aa.theColor,
                    };
                    Module2DModel nmModel = (Module2DModel)FindModuleByType(typeof(Module2DModel));
                    if (nmModel != null)
                    {
                        aa.t = nmModel.MostLikelySegment(s);
                    }
                    areas.Add(aa);
                }
                bb1 = bb2;
            }
        }