/// <summary> /// Compares 2 images, and returns a boolean value indicating if the change is greater than an accuracy value. /// </summary> /// <param name="source1">Image 1</param> /// <param name="source2">Image 2</param> /// <param name="accuracy">Accuracy of the comparisson</param> /// <returns>boolean</returns> public bool ImagesMatch(Image source1, Image source2, float accuracy) { difference = ImageComparer.ImageComparePercentage(source1, source2, Config.settings.imageCompareSettings.fuzziness); differenceString = (difference * 100).ToString("0.##\\%"); return(difference < accuracy); }
public bool ImagesMatch() { if ((!File.Exists(ImageLocation)) || (UpdateImages)) { UpdateImage(); } difference = ImageComparer.ImageComparePercentage(storedImage, liveImage, Config.settings.imageCompareSettings.fuzziness); differenceString = (difference * 100).ToString("0.##\\%"); return(difference < Config.settings.imageCompareSettings.accuracy); }
/// <summary> /// Compares 2 images and return the difference expressed as a percentage /// </summary> /// <param name="source1">Image 1</param> /// <param name="source2">Image 2</param> /// <param name="fuzzines">Image 2</param> /// <returns>float value that indicates the difference expressed as percentage</returns> public string ImagesMatchReturnValue(Image source1, Image source2, int fuzzines = -1) { byte fuz; if (fuzzines == -1) { fuz = Config.Settings.imageCompareSettings.fuzziness; } else { fuz = Byte.Parse(fuzzines.ToString()); } difference = ImageComparer.ImageComparePercentage(source1, source2, fuz); differenceString = (difference * 100).ToString("0.##"); return(differenceString); }