Skip to main content
deleted 32 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

image - Image template matching algorithm from scratch

The key area's I'm interesting in are readability, maintainability, DRY, and if the program performance/efficiency could be imporvedimproved in any way.

imageImage scanning class:

scoreScore calculation class:

outputsOutputs:

special note: this program is designed to work with pixels with 3 channels each (RGB), this is just a dummy example but it also works for fully built out 'images'.

Edit:

Template matching is taking a small 'image' and scanning it over a larger image one pixel at a time until a match is found.

During each iteration of the scan the template and a block of the image, which is the same size as the template, are compared. They are given a score. The closer the score (in this specific scoring metric) to 0 the better. A perfect match gets a score of 0.

Special note:

This program is designed to work with pixels with 3 channels each (RGB), this is just a dummy example but it also works for fully built out 'images'.

image - template matching algorithm from scratch

The key area's I'm interesting in are readability, maintainability, DRY, and if the program performance/efficiency could be imporved in any way.

image scanning class:

score calculation class:

outputs:

special note: this program is designed to work with pixels with 3 channels each (RGB), this is just a dummy example but it also works for fully built out 'images'.

Edit:

Template matching is taking a small 'image' and scanning it over a larger image one pixel at a time until a match is found.

During each iteration of the scan the template and a block of the image, which is the same size as the template, are compared. They are given a score. The closer the score (in this specific scoring metric) to 0 the better. A perfect match gets a score of 0.

Image template matching algorithm from scratch

The key area's I'm interesting in are readability, maintainability, DRY, and if the program performance/efficiency could be improved in any way.

Image scanning class:

Score calculation class:

Outputs:

Template matching is taking a small 'image' and scanning it over a larger image one pixel at a time until a match is found.

During each iteration of the scan the template and a block of the image, which is the same size as the template, are compared. They are given a score. The closer the score (in this specific scoring metric) to 0 the better. A perfect match gets a score of 0.

Special note:

This program is designed to work with pixels with 3 channels each (RGB), this is just a dummy example but it also works for fully built out 'images'.

edited tags
Link
arm93
  • 431
  • 3
  • 11
Tweeted twitter.com/StackCodeReview/status/1005269036538781696
added 378 characters in body
Source Link
arm93
  • 431
  • 3
  • 11

Edit:

Template matching is taking a small 'image' and scanning it over a larger image one pixel at a time until a match is found.

During each iteration of the scan the template and a block of the image, which is the same size as the template, are compared. They are given a score. The closer the score (in this specific scoring metric) to 0 the better. A perfect match gets a score of 0.

Edit:

Template matching is taking a small 'image' and scanning it over a larger image one pixel at a time until a match is found.

During each iteration of the scan the template and a block of the image, which is the same size as the template, are compared. They are given a score. The closer the score (in this specific scoring metric) to 0 the better. A perfect match gets a score of 0.

edited title
Source Link
arm93
  • 431
  • 3
  • 11
Loading
edited title
Link
arm93
  • 431
  • 3
  • 11
Loading
edited title
Link
arm93
  • 431
  • 3
  • 11
Loading
Source Link
arm93
  • 431
  • 3
  • 11
Loading