I am still very much a beginner in programming and am facing a problem with a Java code. I would be very thankful for suggestions and comments. The problem is as following:
I found a Java code online that is designed to compare two pictures and highlight the differences between them. However, the way the code works is by using a loop that compares the RGB value of each pixel of the two pictures and highlights it in a certain color if the value is equal. This however results in a problem that even the slightest shift in camera angle or lighting conditions between the two pictures leads to a different RGB value of the pixels making the code highlight them as a difference even though the pictures are mostly identical. The code is written below and i have added the link to photos showing examples of the outcome of the code. What would you suggest i change in the code? Thank you for your help in advance.
Himai Minh wrote:Maybe, if the RGB value of image 1 and image 2 are equal or difference <= abs(1) , consider the images are the same ?
Thank you for your reply!
Thats actually a smart idea to add a delta of tolerance to the comparison, but do you know how big the difference is between the RGB values for different colors is? I think a tolerance of 1 would be too small.