Exemple #1
0
        public void calcularDiferencia(Imagen objetivo)
        {
            SingletonCache singleton = SingletonCache.Instance;

            if (singleton.histColorChecked && singleton.histFormaChecked)
            {
                if (singleton.DistGChecked)
                {
                    diferencia  = histColor.distanciaO(objetivo);
                    diferencia += histForma.distanciaO(objetivo) * 2;

                    diferencia /= 3;
                }
                if (singleton.DistManChecked)
                {
                    diferencia  = histColor.distanciaManhattan(objetivo);
                    diferencia += histForma.distanciaManhattan(objetivo) * 2;

                    diferencia /= 3;
                }
            }
            else if (singleton.histColorChecked)
            {
                if (singleton.DistGChecked)
                {
                    diferencia = histColor.distanciaO(objetivo);
                }
                if (singleton.DistManChecked)
                {
                    diferencia = histColor.distanciaManhattan(objetivo);
                }
            }
            else
            {
                if (singleton.DistGChecked)
                {
                    diferencia = histForma.distanciaO(objetivo);
                }
                if (singleton.DistManChecked)
                {
                    diferencia = histForma.distanciaManhattan(objetivo);
                }
            }
        }