title: calculating Euclidean distance between two image in matlab
body: <p>I want to calculate the Euclidean distance between two images in Matlab. I find some examples and I've try them but they are not correct.<br>
  The result of this Euclidean distance should be between <code>0</code> and <code>1</code> but with two different ways I reached to different solutions.<br>
  The first algorithm gives me a 4 digit number such as <code>2000</code> and other digits like this and by the other way I reached numbers such as <code>0.007</code><br>
  What is wrong with it?  </p>
  
  <p>This is one of those algorithms I mentioned:</p>
  
  <pre><code>Im1 = imread('1.jpeg');
  Im2 = imread('2.jpeg');
  
  Im1 = rgb2gray(Im1);
  Im2 = rgb2gray(Im2);
  
  hn1 = imhist(Im1)./numel(Im1);
  hn2 = imhist(Im2)./numel(Im2);
  
  % Calculate the Euclidean distance
  f = sum((hn1 - hn2).^2)
  </code></pre>