Esempio n. 1
0
        public void Procesa_Texto(string str)
        {
            string[] words = str.Split(' ');
            switch (words[0])
            {
            case "show":
                if (words.Length < 2)
                {
                    terminal.Express("Show what?", Expression_Types.Information);
                    terminal.Express("Try: show <option>", Expression_Types.Information);
                    terminal.Express("Options: vision, <person name>", Expression_Types.Information);
                }
                else
                {
                    switch (words[1])
                    {
                    case "vision":

                        m_Vision_Sense.Show_Sense(true);

                        break;

                    default:
                        /* int index = vision.recognized_people.IndexOf(words[1]);
                         * if (index >= 0)
                         * {
                         *   Vision_Person_Name_Form person_form = new Vision_Person_Name_Form(index);
                         *   person_form.Show();
                         * }
                         * else
                         * {
                         *   Brain.terminal.PrintLn("That person is no registered in the system.");
                         * }*/
                        break;
                    }
                }
                break;

            default:
                terminal.Express("?", Expression_Types.Information);
                break;
            }
        }
Esempio n. 2
0
        internal void Start()
        {
            //Initialize the capture device
            grabber = new Capture();
            grabber.QueryFrame();
            //Initialize the FrameGraber event
            m_Idle_Handler    = new EventHandler(FrameGrabber);
            Application.Idle += m_Idle_Handler;

            //Load haarcascades for face detection
            frontal_face_pattern = new HaarCascade("haarcascade_frontalface_default.xml");
            //eye = new HaarCascade("haarcascade_eye.xml");
            try
            {
                //Load of previus trainned faces and labels for each image
                string   Labelsinfo = File.ReadAllText(Application.StartupPath + "/TrainedFaces/TrainedLabels.txt");
                string[] Labels     = Labelsinfo.Split('%');
                NumLabels = Convert.ToInt16(Labels[0]);
                ContTrain = NumLabels;
                string LoadFaces;

                for (int tf = 1; tf < NumLabels + 1; tf++)
                {
                    LoadFaces = "face" + tf + ".bmp";
                    training_images.Add(new Image <Gray, byte>(Application.StartupPath + "/TrainedFaces/" + LoadFaces));
                    face_labels.Add(Labels[tf]);
                    recognized_people.Add(Labels[tf]);
                    recognized_faces.Add(new Image <Gray, byte>(Application.StartupPath + "/TrainedFaces/" + LoadFaces));
                    recognized_flags.Add(false);
                }
                Train();
            }
            catch (Exception e)
            {
                //MessageBox.Show(e.ToString());
                MessageBox.Show("Nothing in binary database, please add at least a face(Simply train the prototype with the Add Face Button).", "Triained faces load", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            m_Terminal.Express("Vision started.", Expression_Types.Information);
        }
Esempio n. 3
0
        public void Start(ITerminal c)
        {
            terminal = c;

            m_Vision_Sense = Vision.Sense.Get_Sense();
            m_Vision_Sense.Start(c);
            m_Voice_Sense = Speech.Sense.Get_Sense();
            m_Voice_Sense.Start(c);

            m_Expresion_Senses.Add(m_Voice_Sense);

            terminal.Express("Brain started." + Environment.NewLine, Expression_Types.Information);
            terminal.Express("Artificial Neural Network Dynamicly Redesigned (Entidad Artificial) Version beta.", Expression_Types.Console);
            terminal.Express("Official repository: https://github.com/dancasmed/Examples/tree/master/C%20Sharp/Andrea" + Environment.NewLine, Expression_Types.Console);
            terminal.Express("Created by Daniel Castro  [email protected]" + Environment.NewLine, Expression_Types.Console);
            terminal.Express("Available commands:", Expression_Types.Console);
            terminal.Express("show" + Environment.NewLine + Environment.NewLine, Expression_Types.Console);

            Express("Hi, my name is Anndrea", Expression_Types.Interaction);
        }
Esempio n. 4
0
 internal void Start()
 {
     synth.SetOutputToDefaultAudioDevice();
     synth.Rate = -2;
     m_Terminal.Express("Voice started.", Expression_Types.Information);
 }