public double CalculateSimilarity(RgbProjections compare)
        {
            var horizontalSimilarity = CalculateProjectionSimilarity(horizontalProjection, compare.horizontalProjection);
            var verticalSimilarity   = CalculateProjectionSimilarity(verticalProjection, compare.verticalProjection);

            return(Math.Max(horizontalSimilarity, verticalSimilarity));
        }
Beispiel #2
0
        public ComparableImage(FileInfo file)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            if (!file.Exists)
            {
                throw new FileNotFoundException();
            }

            this.file = file;

            using (var bitmap = ImageUtility.ResizeBitmap(new Bitmap(file.FullName), 100, 100))
            {
                projections = new RgbProjections(ImageUtility.GetRgbProjections(bitmap));
            }
        }