Similarity check between two binary images

Hallo I want to apply a check if the two binary images are similar. I subtract a binary image 1 from the other to get a difference image. where Confidence = (sum(Image_1(:)) - Overlapping_Area)*100 /sum(Image_1 (:)) ;
It would not be reliable if the matching images have lot of shapes and rest borders lines in difference image. Any idea?

댓글 수: 3

Jan
Jan 2017년 8월 29일
What does "rest borders lines in difference image" mean?
Do you mean, that the number of different pixels is not sufficient for your problem? Then define what "similarity" means in your case. What about images with 25% of the pixels are black: 1. the lower left rectangle, 2. the upper right rectangle, 3. random distribution. Which are more similar?
As soon as this is exactly defined mathematically, the implementation in Matlab is easy.
Adam
Adam 2017년 8월 29일
Just taking a sum over the whole image is never going to give you an accurate measure. You need a per-pixel measure and then apply a sum at the end of that, not right at the start where you are basically just counting true or false values, irrespective of their locations.
Rik
Rik 2017년 8월 29일
I agree with Adam, although if you're going to do arithmetic operations with binary things, first convert them to a data type that can hold possible values (generally casting to double is the best, unless speed memory are extremely important).
Generally, when you ask a question on this forum, you should remember that this is a Matlab forum. That means that the less jargon is used and the less background knowledge about the actual application is needed, the more people can help you. This increases the chance of you getting an answer and the answer being useful in the future to someone else.

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

 채택된 답변

Image Analyst
Image Analyst 2017년 8월 29일

0 개 추천

Try the Dice Similarity Coefficient
% Find out where either mask is true.
unionMask = mask1 | mask2;
% Find the differences. Not used - just for fun/visualization.
%xorMask = xor(flippedMask, mask);
% Find the common/overlap area.
andMask = mask1 & mask2;
% Compute the Dice Coefficient
dice = nnz(andMask) / nnz(unionMask);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Display Image에 대해 자세히 알아보기

질문:

Az
2017년 8월 29일

답변:

2017년 8월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by