0

I'm using ImageMagick with version 7.0 installed in my machine. For RMSE comparison for the below CLI input i'm getting some values which are different when i use dll in my c# code.

CLI code:

magick.exe compare -metric RMSE -subimage-search "image1.jpg" "image2.jpg" null:

C# code:

double diff = image1.Compare(image2, ErrorMetric.RootMeanSquared);

Is anyone know how to get the same results?

Nikhil Dinesh
  • 3,359
  • 2
  • 38
  • 41
  • 1
    That may not be a fair comparison. The first seems to do a sub image-search. I do not see any flag in the second to do the same, so I suspect that it is not searching across the whole image. I could be wrong, since I do not know C# – fmw42 Oct 22 '18 at 16:41

1 Answers1

1

It looks like your Magick.NET code is different from what you want to do on the command line. That command would translated to this instead:

var searchResult = image1.SubImageSearch(image2, ErrorMetric.RootMeanSquared);
var diff = searchResult.SimilarityMetric;
fmw42
  • 46,825
  • 10
  • 62
  • 80
dlemstra
  • 7,813
  • 2
  • 27
  • 43
  • Hi dlemstra, im using this call in one of my services. my image1 is an hd image and image 2 is very small area. While calling this method, its taking more than 1 min to return. How can I stop the execution after 30 sec ? – Nikhil Dinesh Mar 08 '19 at 07:35