how to get region of interest and calculate the hit rate and precision rate?

1 Ansicht (letzte 30 Tage)
How to draw out the total object pixel of interest region in an image?
I want calculate the hit rate= correct pixel deteced/total object pixel
precision= correct pixel detect/total detected pixel
elephant is my original image and result is my segmentation which is very bad. I now want to calculate the hit rate and precision rate. How to do it?
How to superimpose(transparent) the result to elephant ?

Akzeptierte Antwort

Image Analyst
Image Analyst am 9 Dez. 2015
Calculate the area of the elephant from the outline you traced around it using poly2mask, then sum.
elephantMask = poly2mask(x, y, rows, columns);
elephantArea = sum(elephantMask(:));
Then calculate the area of overlap between your segmentation and the true area
numSegmentationPixels = sum(segmentationMask(:))
overlapPixels = elephantMask & segmentationMask;
numOverlapPixels = sum(overlapPixels(:))
Then use your formula for precison:
precision = numOverlapPixels / numSegmentationPixels;
  4 Kommentare
Tan Wen Kun
Tan Wen Kun am 9 Dez. 2015
Bearbeitet: Tan Wen Kun am 9 Dez. 2015
what is different between drawing and masking? I got the original image and result image. How I going to do?
Draw on original then mask on result?
Can you show me by the image I given?
Image Analyst
Image Analyst am 9 Dez. 2015
Drawing is just tracing the curve by hand over the image. It will give you the coordinates that you drew. Masking takes that one step further. It uses those coordinates and then creates a binary image that's true inside the curve and false outside. You can then use that binary image to set the inside or outside of the mask in the original image to any intensity or color you want, such as black or white or unchanged. The demos already demonstrate what you are asking for I believe.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by