Ejemplo n.º 1
0
Color::Color(string name){

	setType(name);
	
	if(name=="yellow"){

		//TODO: use "calibration mode" to find HSV min
		//and HSV max values

		setHSVmin(Scalar(0,90,140));
		setHSVmax(Scalar(87,217,256));

		//BGR value for Green:
		setColour(Scalar(0,255,0));

	}
	if(name=="blue"){
		//for orange color
		//TODO: use "calibration mode" to find HSV min
		//and HSV max values

		setHSVmin(Scalar(97,170,57));
		setHSVmax(Scalar(113,256,182));

		//BGR value for Yellow:
		setColour(Scalar(255,0,0));

	}
	if(name=="red"){

		//TODO: use "calibration mode" to find HSV min
		//and HSV max values

		setHSVmin(Scalar(71,131,136));
		setHSVmax(Scalar(227,209,243));

		//BGR value for Red:
		setColour(Scalar(0,0,255));

	}
	if(name=="green"){
		//for green color
		//TODO: use "calibration mode" to find HSV min
		//and HSV max values

		setHSVmin(Scalar(69,90,47));
		setHSVmax(Scalar(97,256,160));

		//BGR value for Red:
		setColour(Scalar(0,0,255));

	}


}
Ejemplo n.º 2
0
Object::Object(string name){

	setType(name);
	
	if(name=="blue"){

		//TODO: use "calibration mode" to find HSV min
		//and HSV max values

		setHSVmin(Scalar(0, 100, 83));
		setHSVmax(Scalar(32, 172, 168));

		//BGR value for Green:
		setColor(Scalar(255,0,0));

	}
	if(name=="green"){

		//TODO: use "calibration mode" to find HSV min
		//and HSV max values

		setHSVmin(Scalar(162, 26, 198));
		setHSVmax(Scalar(218, 94, 256));

		//BGR value for Yellow:
		setColor(Scalar(0,255,0));

	}
	if(name=="yellow"){

		//TODO: use "calibration mode" to find HSV min
		//and HSV max values

        setHSVmin(Scalar(29, 70, 159));
        setHSVmax(Scalar(68, 170, 211));

		//BGR value for Red:
		setColor(Scalar(0,255,255));

	}
	if(name=="red"){

		//TODO: use "calibration mode" to find HSV min
		//and HSV max values

		setHSVmin(Scalar(0, 179, 33));
        setHSVmax(Scalar(4, 256, 137));

		//BGR value for Red:
		setColor(Scalar(0,0,255));

	}
}
Ejemplo n.º 3
0
/**************************************************************************//**
 * @author Julian Brackins
 *
 * @par Description:
 * LED Constructor for when a name is passed in as a parameter. This decides
 * what colour the LED is.
 *
 *****************************************************************************/
LED::LED(std::string name)
{

	setColour(name);

    //TODO: Adjust HSV vals to something more appropriate...	
	if(name=="green")
	{
		setHSVmin(cv::Scalar(57, 116, 132));
		setHSVmax(cv::Scalar(69, 154, 177));

		//BGR value for Green:
		setText(cv::Scalar(0,255,0));
	}
	if(name=="yellow")
	{
		setHSVmin(cv::Scalar(17, 34, 201));
		setHSVmax(cv::Scalar(45, 256, 256));

		//BGR value for Yellow:
		setText(cv::Scalar(0,255,255));
	}
	if(name=="red")
	{
        setHSVmin(cv::Scalar(0,205,121));
        setHSVmax(cv::Scalar(8,256,224));

		//BGR value for Red:
		setText(cv::Scalar(0,0,255));
	}
	if(name=="blue")
	{
		setHSVmin(cv::Scalar(100, 140, 105));
		setHSVmax(cv::Scalar(120, 180, 181));

		//BGR value for Red:
		setText(cv::Scalar(0,0,255));
	}
	if(name=="calibrate")
	{
		setHSVmin(cv::Scalar(0, 0, 0));
		setHSVmax(cv::Scalar(256, 256, 256));

		//BGR value for Red:
		setText(cv::Scalar(0,0,255));	
	}

}
Ejemplo n.º 4
0
Marker::Marker(string name){
	setType(name);
	if (name == "yellow"){
		setHSVmin(cv::Scalar(25, 50, 131));
		setHSVmax(cv::Scalar(40, 213, 221));
		setColour(cv::Scalar(230, 245, 50));
	}
}
Ejemplo n.º 5
0
players::players(string name){

	setType(name);
	if (name == "Home player"){   //blue
		setHSVmin(Scalar(93, 99, 95));
		setHSVmax(Scalar(137, 256, 256));
		setcolor(Scalar(255, 0, 0));
	}
	if (name == "Away player"){  //red

		setHSVmin(Scalar(147, 125, 56));
		setHSVmax(Scalar(256, 255, 255));
		setcolor(Scalar(0, 0, 255));
	}
	if (name == "Ball"){

	}
}
TrackedObject::TrackedObject(std::string name)
{
	setType(name);
	
	if(name=="blue TrackedObject detected")
	{
		setHSVmin(Scalar(46,83,24));
		setHSVmax(Scalar(118,236,152));
		setColor(Scalar(255,255,0));

	}
	if(name=="red TrackedObject detected")
	{
		setHSVmin(Scalar(0,192,0));
		setHSVmax(Scalar(256,256,256));
		setColor(Scalar(0,0,255));
	}
}
Ejemplo n.º 7
0
Object::Object( string name ) {

  setType(name);


  if ( name=="white" ) {

    setHSVmin(Scalar(0,0,180));
    setHSVmax(Scalar(256,38,256));

    setColor(Scalar(255,0,0));
  }

  if(name=="blue"){

    //TODO: use "calibration mode" to find HSV min
    //and HSV max values

    setHSVmin(Scalar(92,0,0));
    setHSVmax(Scalar(124,256,256));

    //BGR value for Green:
    setColor(Scalar(255,0,0));

  }

  if(name=="green"){

    //TODO: use "calibration mode" to find HSV min
    //and HSV max values

    setHSVmin(Scalar(34,50,50));
    setHSVmax(Scalar(80,220,200));

    //BGR value for Yellow:
    setColor(Scalar(0,255,0));

  }

  if(name=="yellow"){

    //TODO: use "calibration mode" to find HSV min
    //and HSV max values

    setHSVmin(Scalar(20,124,123));
    setHSVmax(Scalar(30,256,256));

    //BGR value for Red:
    setColor(Scalar(0,255,255));

  }

  if(name=="red") {

    //TODO: use "calibration mode" to find HSV min
    //and HSV max values

    setHSVmin(Scalar(0,200,0));
    setHSVmax(Scalar(19,255,255));

    //BGR value for Red:
    setColor(Scalar(0,0,255));

  }
}
Ejemplo n.º 8
0
Color::Color(string name){

    setType(name);

    if(name=="Purple"){

        //TODO: use "calibration mode" to find HSV min
        //and HSV max values

        setHSVmin(Scalar(125,54,62));//(0,187,0));
        setHSVmax(Scalar(163,149,123));//(6,256,256));

        //BGR value for Red:
        setColour(Scalar(0,0,255));

    }
    if(name=="Pink"){

        //TODO: use "calibration mode" to find HSV min
        //and HSV max values

        setHSVmin(Scalar(125,141,143));//(16,141,196));//(12,149,65));//(12,149,65));
        setHSVmax(Scalar(224,222,256));//(181,230,256));//(181,230,230)); //(181,222,256));

        //BGR value for Pink:
        setColour(Scalar(0,255,255));

    }
    if(name=="Blue"){

        //TODO: use "calibration mode" to find HSV min
        //and HSV max values

        setHSVmin(Scalar(58,97,83));
        setHSVmax(Scalar(125,256,216));

        //BGR value for Blue:
        setColour(Scalar(255,0,0));

    }

        if(name=="Green"){

        //TODO: use "calibration mode" to find HSV min
        //and HSV max values

        setHSVmin(Scalar(40,20,67));
        setHSVmax(Scalar(93,125,240));

        //BGR value for black to write the text beside the object:
        setColour(Scalar(0,255,0));

    }

    if(name=="Orange"){

        //TODO: use "calibration mode" to find HSV min
        //and HSV max values

        setHSVmin(Scalar(0,220,179));//(0,179,177));
        setHSVmax(Scalar(163,256,224));//(38,256,242));

        //BGR value for black to write the text beside the object:
        setColour(Scalar(0,255,0));

    }

}