MATLAB: Precision and recall computation

background subtrcationImage Processing Toolboxprecisionrecallreceiver operating characteristicrocroc curve

i have a background subtracted image and its ground truth. How can i find the accuracy using precision and recall.precision=tp/(tp+fp),and recall=tp/(tp+fn). F measure=2*p*r/p+r. i want to get these values. please help

Best Answer

How are you defining true positive (tp), false positive (fp), and false negative (fn)? Is it just based on whether the difference between your output pixel and your ground truth pixel is zero or non-zero? Wouldn't accuracy just be the ratio of true positive pixels to the number of pixels in your image?