Exemplo n.º 1
0
 /* CONSTRUCTOR */
 public static Boolean initializeCore(String portName)
 {
     print                   = true;
     serialPort              = new SerialPort();
     serialPort.PortName     = portName;
     serialPort.BaudRate     = 57600;
     serialPort.DataBits     = 8;
     serialPort.Parity       = Parity.None;
     serialPort.StopBits     = StopBits.One;
     serialPort.ReadTimeout  = 0;
     serialPort.WriteTimeout = 2;
     serialPort.Handshake    = Handshake.None;
     serialPort.RtsEnable    = false;
     serialPort.DtrEnable    = false;
     //serialPort.DataReceived += new System.EventHandler(dataReceived);
     return(AuxiliarFunctions.openPort(serialPort, print));
 }
Exemplo n.º 2
0
        public static Image <Bgr, Byte> filterColor(Image <Bgr, Byte> image)
        {
            int i, j;

            for (i = 0; i < image.Height; i++)
            {
                for (j = 0; j < image.Width; j++)
                {
                    Bgr now_color = image[i, j];
                    if (AuxiliarFunctions.isNotInRange(now_color, redmin, redmax, bluemin, bluemax, greenmin, greenmax))
                    {
                        image[i, j] = new Bgr(0, 0, 0);
                    }
                    else
                    {
                        image[i, j] = colorSelected;
                    }
                }
            }
            return(image);
        }