예제 #1
0
 /// <summary>
 /// Calculate the similarity to another image.
 /// </summary>
 /// <param name="compare">The image to compare with.</param>
 /// <returns>Return a value from 0 to 1 that is the similarity.</returns>
 public double CalculateSimilarity(ComparableImage compare)
 {
     return projections.CalculateSimilarity(compare.projections);
 }
예제 #2
0
 private static ComparableImage GetHistogram(Transaction tran, string first)
 {
     ComparableImage pc = null;
     var pcData = tran.Select<string, HistogramData>("hist", first);
     if (!pcData.Exists)
     {
         pc = new ComparableImage(new FileInfo(first));
         tran.Insert("hist", first, new HistogramData(pc.Projections.HorizontalProjection, pc.Projections.VerticalProjection));
     }
     else
     {
         pc = new ComparableImage(new FileInfo(first), pcData.Value.X, pcData.Value.Y);
     }
     return pc;
 }