필터 지우기
필터 지우기

Finding the difference between two images algorithm.

조회 수: 20 (최근 30일)
shay afuta
shay afuta 2018년 7월 28일
댓글: Image Analyst 2021년 4월 21일
Hello,I am trying to write code to find the difference between two similar images. My way was: make them gray (with rgb2gray) subtract and then add threshold) but it gave me nothing.
The way I am working isnt correct ? maybe I am missing something ?
  댓글 수: 3
Rik
Rik 2018년 7월 28일
There is a lot that can go wrong here. We can guess what went wrong, but the best way is if you upload example images and the code you were using.
shay afuta
shay afuta 2018년 7월 29일
I want to make algorithm that can slove the game "guess the difference". You upload 2 similar photos and get white dots in the places when there is any difference.

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

답변 (2개)

Image Analyst
Image Analyst 2018년 7월 28일
Subtracting will clip negative values at zero - not good! Cast to double before that.
Try the built-in functions immse() or psnr().
If you want to do it yourself, check out imabsdiff().
  댓글 수: 2
shay afuta
shay afuta 2018년 7월 29일
I forgot to mention that I subtracted with abs(and now I tried with double).
Like this : abs(double(im1gray)-double(im2gray));
But it still giving me in white places in the pictures that are same. The built-in functions immse() or psnr() giving me error like that treshold so still I dont got the final picture I want(black background with white when there is any difference).
Image Analyst
Image Analyst 2018년 7월 29일
Are you sure you're displaying the difference image with [] - otherwise it will do that.
differenceImage = abs(double(im1gray)-double(im2gray));
imshow(differenceImage, []);

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


Savita Hanchinal
Savita Hanchinal 2021년 4월 21일
please anyone help me ...which algorithm is best for fake currency detection
  댓글 수: 2
Rik
Rik 2021년 4월 21일
The best algorithm is probably classified, as it can be used to avoid counterfeit detection.
Also, by posting an answer you decreased your chances of getting effective help.
Have a read here and here. It will greatly improve your chances of getting an answer.

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

Community Treasure Hunt

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

Start Hunting!

Translated by