I am capturing the screen using robot.screenCapture() and frame bufferedImage1. Again I am capturing desktop screen and frame bufferedImage2.

Could please tell me how to compare these 2 images (bufferedImage1 and bufferedImage2) pixel by pixel. If there is any difference, then how to frame the part that is different?

有帮助吗?

解决方案

Here's one way to do it:

  1. Compare the entire images, get the percentage of pixels that differ more than a threshold.
  2. Divide into quarters recursively, down to a certain size, and get the same percentage for each quadrant.
  3. Draw the frame around the quadrants that are a certain amount above the average difference. If you need square sections, use a single quadrant based on size and percent difference. Otherwise, you can combine more than one quadrant with large differences.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top