필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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 ?

채택된 답변

Image Analyst
Image Analyst 2015년 12월 9일
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
Tan Wen Kun
Tan Wen Kun 2015년 12월 9일
편집: Tan Wen Kun 2015년 12월 9일
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 2015년 12월 9일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by