Answers.Body: <p>The first idea to come to my mind, is to calculate the pixel-wise difference, and then pass it through a median filter of a suitable radius. But if your element's height changes significantly and it pushes everything down, then this will be seen as a significant change even after the median filtering.</p>
  <p>If you want to ignore all differences due to constant shifting, you'll need to employ more complex algorithms. Then edit-distance and dynamic programming comes to my mind.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-26T09:38:08.453Z
Answers.LastActivityDate: 2023-10-26T09:38:08.453Z
Answers.UserDisplayName: NikoNyrh
Body: <p>I have an automated visual regression test harness for my web app. It takes baseline and change snapshots using puppeteer and compares them using pixelmatch. If I change the height of an element on the screen however, it pushes everything else on the page down slightly and pixelmatch identifies it as a difference.</p>
  <p>I'm wondering if there are any models that can identify visual differences between two very similar images but is robust enough to ignore &quot;slight&quot; layout changes.</p>
  
Tags: <computer-vision>
Title: Can computer vision identify visual discrepancies in images?
UserDisplayName: Robert W
ThreadText: # Can computer vision identify visual discrepancies in images?
  
  (Asked by: username_0 on 2023-10-25)
  
  I have an automated visual regression test harness for my web app. It takes baseline and change snapshots using puppeteer and compares them using pixelmatch. If I change the height of an element on the screen however, it pushes everything else on the page down slightly and pixelmatch identifies it as a difference.
  
  I'm wondering if there are any models that can identify visual differences between two very similar images but is robust enough to ignore "slight" layout changes.
  
  **Tags:** computer-vision
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-10-26. Score: 1
  
  The first idea to come to my mind, is to calculate the pixel-wise difference, and then pass it through a median filter of a suitable radius. But if your element's height changes significantly and it pushes everything down, then this will be seen as a significant change even after the median filtering.
  
  If you want to ignore all differences due to constant shifting, you'll need to employ more complex algorithms. Then edit-distance and dynamic programming comes to my mind.
  
  
  ---
  
  