Example #1
0
        private ReferenceColorMatch MatchColor(ReferenceColor r, Color meanColor)
        {
            var distance = GetEuclideanDistanceBetweenColors(r.Color, meanColor);

            var confidence = CalculateConfidence(distance, 255);

            return(new ReferenceColorMatch(r, confidence));
        }
Example #2
0
        private void btnTransform_Click(object sender, EventArgs e)
        {
            var src  = data.Get <Color>(Constants.srcColor);
            var dest = data.Get <Color>(Constants.destColor);
            ColorTransformCreator refColor = new ReferenceColor(src, dest);

            bmp = refColor.Transform(bmp);
            pictureBox1.Image = bmp;
        }
 private void SetBackGround(int num)
 {
     if (backgrounds [num] != null)
     {
         backgroundToUse = backgrounds [num];
         GameObject     bkg = (GameObject)Instantiate(backgroundToUse, backgroundHolder, false);
         ReferenceColor rfc = bkg.GetComponent <ReferenceColor> ();
         if (rfc != null)
         {
             Color col = rfc.col;
             mtc.SetColors(col);
         }
         else
         {
             mtc.SetColors(Color.grey);
         }
     }
 }
Example #4
0
 public ReferenceColorMatch(ReferenceColor referenceColor, double confidence)
 {
     ReferenceColor = referenceColor;
     Confidence     = confidence;
 }