I am looking for an efficient way to compare 2 images and get the changed areas as a result.
My current attempt has the following steps:
- Compare each horizontal line and keep the changed line index in a list
- Compare each vertical line and keep the changed line index in a list
- Iterate over each changed horizontal line, finding each start and end point of the height while iterating over the vertical changes lines finding the width of the area.
This method has its flaws and seems not really fast.
One of the flaws is that if there are 2 changed areas on a diagonal, this method detects 4 changed areas. however this small abnormality isnt an issue for my use case.
Are there any more efficient methods? I was thinking, how does VNC or TeamViewer detect screen changes?
The idea is that there is a base image. A user draws (not in application) extra details to it. I want to compare these images and find where the user has drawn extra details.