1

I have segmented liver from CT images using Region Growing. I need to calculate RMS error between the reference image and the segmented region. When I run the code, I get an output of 1.1146. Whwn I rearrange the order of inputs, I get a value of 2.2164. I don't know how far I'm accurate. Because, I don't know the range for RMS error.The first image is reference image 'ref3.jpg' and the second image is the segmented image 'm5.jpg'. Kindly help me. My code is,

%metrics.m
I=imread('ref3.jpg');
J=imread('m5.jpg');  
re2=rms_error(I,J)

----
function [er]=rms_error(A1,A2)
% A1, A2 : Matrices of same size MxN
% er : Rms error
% Author : Kamlesh Pawar

if (size(A1)~= size(A2))
    display('Matrix dimension mismatch while calculating RMS value');
    return;
end

er = sum((A1(:)-A2(:)).^2);

er=sqrt(er/size(A1(:),1));
end

Reference image ref3.jpg Segmented image m5.jpg

kadéem
  • 187
  • 2
  • 10
Gomathi
  • 973
  • 7
  • 17
  • 37

2 Answers2

2

What you really need is called "Region Based Measures for Evaluation of Segmentation Performance".

I can suggest the following measure which are very acceptable measures. 1. Dice Coefficient 2. Sensitivity 3. Hausdorff Distance 4. Mean Absolute Distance

For computational details please refer to the figure below. Where C is the total number of pixels in the image and |s| represents cardinality of any set s. A(s) and A(G) is the area of the close boundary of segmentation results and manual delineation.

May I also suggest you use morphological opening on the automatic segmentation result. Hope this is helpful.

enter image description here

mkuse
  • 2,250
  • 4
  • 32
  • 61
0

Using the RMS error here is not very appropriate. The RMS error measures the amplitude of the deviations between your 2 images, which is of intrest if one compares images consisting of grey values. Your case comes to a categorical comparison: does a pixel belong to the liver (1) or not (0)? To what extent do my images agree?
A first possibility is to measure the correlation between the 2 images. You perform this with corr2.
A second possibility is Cohen's kappa statistic, or Kappa Index of Agreement (KIA). This measure takes into account the agreement due to chance. You can use the function kappa.m, a contribution at Matlab Central which you can find here.

kadéem
  • 187
  • 2
  • 10
  • 1
    How can i calculate Kappa using my set of segmented images, and the two judges sets of images ? – Sara S. Sep 05 '14 at 15:13